forked from cafeberry/cafeberry
psvita networking (Experimental)
This commit is contained in:
@@ -24,6 +24,7 @@ class PlayerUID
|
||||
int m_userID; // user logged on to the XMB
|
||||
|
||||
public:
|
||||
ULONGLONG XUID;
|
||||
|
||||
class Hash
|
||||
{
|
||||
@@ -34,6 +35,8 @@ public:
|
||||
PlayerUID();
|
||||
PlayerUID(int userID, SceNpOnlineId& onlineID, bool bSignedInPSN, int quadrant);
|
||||
PlayerUID(std::wstring fromString);
|
||||
PlayerUID(ULONGLONG xuid) { XUID = xuid; }
|
||||
operator ULONGLONG() const { return XUID; }
|
||||
|
||||
bool operator==(const PlayerUID& rhs) const;
|
||||
bool operator!=(const PlayerUID& rhs);
|
||||
@@ -56,6 +59,7 @@ private:
|
||||
|
||||
typedef PlayerUID *PPlayerUID;
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
class GameSessionUID
|
||||
{
|
||||
char m_onlineID[SCE_NP_ONLINEID_MAX_LENGTH];
|
||||
@@ -76,6 +80,7 @@ public:
|
||||
void setForAdhoc();
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
enum eAwardType
|
||||
{
|
||||
|
||||
@@ -14,13 +14,18 @@
|
||||
#include "PSVita\Network\SonyRemoteStorage_Vita.h"
|
||||
#include "PSVita\Network\SonyCommerce_Vita.h"
|
||||
#include "..\..\Common\Network\Sony\SonyRemoteStorage.h"
|
||||
#include "PSVita/Network/PSVita_NPToolkit.h"
|
||||
#include <message_dialog.h>
|
||||
#include <savedata_dialog.h>
|
||||
#include "Common\UI\UI.h"
|
||||
#include "PSVita\PSVitaExtras\PSVitaStrings.h"
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
#include "PSVita/Network/PSVita_NPToolkit.h"
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
#define VITA_COMMERCE_ENABLED
|
||||
#endif
|
||||
CConsoleMinecraftApp app;
|
||||
|
||||
CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
|
||||
@@ -1021,6 +1026,7 @@ void CConsoleMinecraftApp::AppEventTick()
|
||||
res = sceAppUtilReceiveAppEvent(&eventParam);
|
||||
if (res == SCE_OK)
|
||||
{
|
||||
#ifndef DISABLE_PSN
|
||||
if (SCE_APPUTIL_APPEVENT_TYPE_NP_APP_DATA_MESSAGE == eventParam.type)
|
||||
{
|
||||
PSVitaNPToolkit::getMessageData(&eventParam);
|
||||
@@ -1035,6 +1041,7 @@ void CConsoleMinecraftApp::AppEventTick()
|
||||
app.DebugPrintf("unknown app event : 0x%08x\n", eventParam.type);
|
||||
assert(0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1073,6 +1080,7 @@ void CConsoleMinecraftApp::AppEventTick()
|
||||
|
||||
bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
|
||||
{
|
||||
#ifdef VITA_COMMERCE
|
||||
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
|
||||
|
||||
bool bEmptyStore=true;
|
||||
@@ -1102,6 +1110,9 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
|
||||
}
|
||||
|
||||
return bEmptyStore;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
#include "Leaderboards\PSVitaLeaderboardManager.h"
|
||||
#include "Common\Network\Sony\SQRNetworkManager.h"
|
||||
#include "PSVita/Network/PSVita_NPToolkit.h"
|
||||
#include "PSVita\Network\SonyVoiceChat_Vita.h"
|
||||
#endif
|
||||
#include "PSVita\PSVitaExtras\ShutdownManager.h"
|
||||
|
||||
//#define HEAPINSPECTOR_PS3 1
|
||||
@@ -54,12 +59,10 @@
|
||||
#include "..\..\Minecraft.World\OldChunkStorage.h"
|
||||
//#include "PS3\PS3Extras\EdgeZLib.h"
|
||||
#include "..\..\Minecraft.World\C4JThread.h"
|
||||
#include "Common\Network\Sony\SQRNetworkManager.h"
|
||||
#include "Common\UI\IUIScene_PauseMenu.h"
|
||||
#include "Conf.h"
|
||||
#include "PSVita/Network/PSVita_NPToolkit.h"
|
||||
#include "PSVita\Network\SonyVoiceChat_Vita.h"
|
||||
#include "..\..\Minecraft.World\FireworksRecipe.h"
|
||||
#include "..\..\Minecraft.Client\Common\Network\NetworkSocketLayer.h"
|
||||
|
||||
#include <libsysmodule.h>
|
||||
#include <libperf.h>
|
||||
@@ -376,7 +379,9 @@ void RegisterAwardsWithProfileManager()
|
||||
ProfileManager.RichPresenceInit(4,1);
|
||||
|
||||
//Chris TODO
|
||||
#ifndef DISABLE_PSN
|
||||
ProfileManager.SetRichPresenceSettingFn(SQRNetworkManager_Vita::SetRichPresence);
|
||||
#endif
|
||||
char *pchRichPresenceString;
|
||||
|
||||
pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_GAMESTATE);
|
||||
@@ -517,7 +522,9 @@ int main()
|
||||
}
|
||||
|
||||
app.InitTime();
|
||||
#ifndef DISABLE_PSN
|
||||
PSVitaNPToolkit::init();
|
||||
#endif
|
||||
|
||||
// initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message
|
||||
StorageManager.Init( 0, L"savegame.dat", "savePackName", FIFTY_ONE_MB, &CConsoleMinecraftApp::DisplaySavingMessage, (LPVOID)&app, NULL);
|
||||
@@ -759,6 +766,7 @@ int main()
|
||||
// XN_SYS_SIGNINCHANGED notifications. This does mean that we need to have a callback in the
|
||||
// ProfileManager for XN_LIVE_INVITE_ACCEPTED for QNet.
|
||||
g_NetworkManager.Initialise();
|
||||
NetworkSocketLayer::Initialize();
|
||||
g_NetworkManager.SetLocalGame(true);
|
||||
|
||||
// Set the default sound levels
|
||||
@@ -796,8 +804,9 @@ int main()
|
||||
#endif
|
||||
while( true )
|
||||
{
|
||||
#ifndef DISABLE_PSN
|
||||
SonyVoiceChat_Vita::tick();
|
||||
|
||||
#endif
|
||||
RenderManager.StartFrame();
|
||||
#if 0
|
||||
if(pMinecraft->soundEngine->isStreamingWavebankReady() &&
|
||||
@@ -846,7 +855,9 @@ int main()
|
||||
g_NetworkManager.DoWork();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
LeaderboardManager::Instance()->Tick();
|
||||
#endif
|
||||
// Render game graphics.
|
||||
if(app.GetGameStarted())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user