1 parent
119bff3514
commit
b9a2951901
308 files changed
+5368
-5360
No files matched your search
@@ -44,8 +44,8 @@
|
||||
CGameNetworkManager g_NetworkManager;
|
||||
CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager;
|
||||
|
||||
int64_t CGameNetworkManager::messageQueue[512];
|
||||
int64_t CGameNetworkManager::byteQueue[512];
|
||||
__int64 CGameNetworkManager::messageQueue[512];
|
||||
__int64 CGameNetworkManager::byteQueue[512];
|
||||
int CGameNetworkManager::messageQueuePos = 0;
|
||||
|
||||
CGameNetworkManager::CGameNetworkManager()
|
||||
@@ -74,7 +74,7 @@ void CGameNetworkManager::Initialise()
|
||||
#else
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerStub();
|
||||
#endif
|
||||
s_pPlatformNetworkManager->Initialise( this, flagIndexSize );
|
||||
s_pPlatformNetworkManager->Initialise( this, flagIndexSize );
|
||||
m_bNetworkThreadRunning = false;
|
||||
m_bInitialised = true;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ void CGameNetworkManager::DoWork()
|
||||
if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && bConnected == false && g_NetworkManager.IsInSession() )
|
||||
{
|
||||
app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XN_LIVE_INVITE_ACCEPTED:
|
||||
@@ -161,12 +161,12 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
|
||||
|
||||
success = s_pPlatformNetworkManager->_RunNetworkGame();
|
||||
if(!success)
|
||||
{
|
||||
{
|
||||
app.SetAction(ProfileManager.GetPrimaryPad(),eAppAction_ExitWorld,(void *)TRUE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( g_NetworkManager.IsLeavingGame() ) return false;
|
||||
|
||||
app.SetGameStarted(true);
|
||||
@@ -188,12 +188,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
ProfileManager.SetDeferredSignoutEnabled(true);
|
||||
#endif
|
||||
|
||||
int64_t seed = 0;
|
||||
__int64 seed = 0;
|
||||
if(lpParameter != NULL)
|
||||
{
|
||||
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
||||
seed = param->seed;
|
||||
|
||||
|
||||
app.setLevelGenerationOptions(param->levelGen);
|
||||
if(param->levelGen != NULL)
|
||||
{
|
||||
@@ -204,12 +204,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
}
|
||||
else
|
||||
{
|
||||
param->seed = seed = app.getLevelGenerationOptions()->getLevelSeed();
|
||||
param->seed = seed = app.getLevelGenerationOptions()->getLevelSeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int64_t sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running
|
||||
static __int64 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running
|
||||
ServerStoppedCreate(false);
|
||||
if( g_NetworkManager.IsHost() )
|
||||
{
|
||||
@@ -227,7 +227,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
ServerReadyWait();
|
||||
ServerReadyDestroy();
|
||||
|
||||
if( MinecraftServer::serverHalted() )
|
||||
if( MinecraftServer::serverHalted() )
|
||||
return false;
|
||||
|
||||
// printf("Server ready to go!\n");
|
||||
@@ -238,7 +238,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
}
|
||||
|
||||
#ifndef _XBOX
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
// Make sure that we have transitioned through any joining/creating stages and are actually playing the game, so that we know the players should be valid
|
||||
bool changedMessage = false;
|
||||
while(!IsReadyToPlayOrIdle())
|
||||
@@ -458,7 +458,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(g_NetworkManager.IsLeavingGame() || !IsInSession() )
|
||||
{
|
||||
for(AUTO_VAR(it, createdConnections.begin()); it < createdConnections.end(); ++it)
|
||||
@@ -754,7 +754,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
||||
ProfileManager.SetPrimaryPad(iPad);
|
||||
|
||||
g_NetworkManager.SetLocalGame(false);
|
||||
|
||||
|
||||
// If the player was signed in before selecting play, we'll not have read the profile yet, so query the sign-in status to get this to happen
|
||||
ProfileManager.QuerySigninStatus();
|
||||
|
||||
@@ -770,7 +770,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
||||
pInviteInfo ); // pInviteInfo
|
||||
if( !success )
|
||||
{
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -816,7 +816,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
||||
Compression::UseDefaultThreadStorage();
|
||||
Tile::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
|
||||
|
||||
g_NetworkManager.m_bNetworkThreadRunning = true;
|
||||
bool success = g_NetworkManager._RunNetworkGame(lpParameter);
|
||||
g_NetworkManager.m_bNetworkThreadRunning = false;
|
||||
@@ -828,7 +828,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
||||
Sleep(1);
|
||||
}
|
||||
ui.CleanUpSkinReload();
|
||||
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
|
||||
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
|
||||
{
|
||||
app.SetDisconnectReason( DisconnectPacket::eDisconnect_ConnectionCreationFailed );
|
||||
}
|
||||
@@ -850,7 +850,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
||||
|
||||
int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
||||
{
|
||||
int64_t seed = 0;
|
||||
__int64 seed = 0;
|
||||
if(lpParameter != NULL)
|
||||
{
|
||||
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
||||
@@ -861,7 +861,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
||||
SetThreadName(-1, "Minecraft Server thread");
|
||||
AABB::CreateNewThreadStorage();
|
||||
Vec3::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
Compression::UseDefaultThreadStorage();
|
||||
OldChunkStorage::UseDefaultThreadStorage();
|
||||
Entity::useSmallIds();
|
||||
@@ -869,7 +869,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
||||
Tile::CreateNewThreadStorage();
|
||||
|
||||
MinecraftServer::main(seed, lpParameter); //saveData, app.GetGameHostOption(eGameHostOption_All));
|
||||
|
||||
|
||||
Tile::ReleaseThreadStorage();
|
||||
AABB::ReleaseThreadStorage();
|
||||
Vec3::ReleaseThreadStorage();
|
||||
@@ -926,7 +926,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
|
||||
// The pair of methods MustSignInReturned_0 & PSNSignInReturned_0 handle this
|
||||
int CGameNetworkManager::MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(&CGameNetworkManager::PSNSignInReturned_0, pParam,true);
|
||||
@@ -986,7 +986,7 @@ int CGameNetworkManager::PSNSignInReturned_0(void* pParam, bool bContinue, int i
|
||||
// The pair of methods MustSignInReturned_1 & PSNSignInReturned_1 handle this
|
||||
int CGameNetworkManager::MustSignInReturned_1(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(&CGameNetworkManager::PSNSignInReturned_1, pParam,true);
|
||||
@@ -1018,7 +1018,7 @@ int CGameNetworkManager::PSNSignInReturned_1(void* pParam, bool bContinue, int i
|
||||
#elif defined __ORBIS__
|
||||
// TODO: No Orbis equivalent (should there be?)
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,7 +1043,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
Vec3::UseDefaultThreadStorage();
|
||||
Compression::UseDefaultThreadStorage();
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
MinecraftServer *pServer = MinecraftServer::getInstance();
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||
@@ -1082,7 +1082,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
pMinecraft->progressRenderer->progressStartNoAbort( g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT) );
|
||||
pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
pMinecraft->progressRenderer->progressStartNoAbort( g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT) );
|
||||
pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||
@@ -1096,7 +1096,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
|
||||
// wait for the server to be in a non-ticking state
|
||||
pServer->m_serverPausedEvent->WaitForSignal(INFINITE);
|
||||
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||
// Swap these two messages around as one is too long to display at 480
|
||||
pMinecraft->progressRenderer->progressStartNoAbort( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||
@@ -1158,7 +1158,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
|
||||
// Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same
|
||||
g_NetworkManager.m_bLastDisconnectWasLostRoomOnly = false;
|
||||
g_NetworkManager.m_bFullSessionMessageOnNextSessionChange = false;
|
||||
@@ -1189,7 +1189,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
|
||||
// Restore the network player of all the server players that are local
|
||||
if( pServer != NULL )
|
||||
{
|
||||
@@ -1218,7 +1218,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pMinecraft->progressRenderer->progressStagePercentage(100);
|
||||
|
||||
#ifndef _XBOX
|
||||
@@ -1240,7 +1240,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
#endif
|
||||
|
||||
// Start the game again
|
||||
app.SetGameStarted(true);
|
||||
app.SetGameStarted(true);
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
|
||||
app.SetChangingSessionType(false);
|
||||
app.SetReallyChangingSessionType(false);
|
||||
@@ -1294,7 +1294,7 @@ void CGameNetworkManager::StateChange_AnyToJoining()
|
||||
app.DebugPrintf("Disabling Guest Signin\n");
|
||||
XEnableGuestSignin(FALSE);
|
||||
Minecraft::GetInstance()->clearPendingClientTextureRequests();
|
||||
|
||||
|
||||
ConnectionProgressParams *param = new ConnectionProgressParams();
|
||||
param->iPad = ProfileManager.GetPrimaryPad();
|
||||
param->stringId = -1;
|
||||
@@ -1342,7 +1342,7 @@ void CGameNetworkManager::StateChange_AnyToStarting()
|
||||
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
|
||||
completionData->iPad = ProfileManager.GetPrimaryPad();
|
||||
loadingParams->completionData = completionData;
|
||||
|
||||
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams);
|
||||
}
|
||||
}
|
||||
@@ -1463,7 +1463,7 @@ void CGameNetworkManager::PlayerJoining( INetworkPlayer *pNetworkPlayer )
|
||||
bool multiplayer = g_NetworkManager.GetPlayerCount() > 1, localgame = g_NetworkManager.IsLocalGame();
|
||||
for (int iPad=0; iPad<XUSER_MAX_COUNT; ++iPad)
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(iPad);
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(iPad);
|
||||
if (pNetworkPlayer == NULL) continue;
|
||||
|
||||
app.SetRichPresenceContext(iPad,CONTEXT_GAME_STATE_BLANK);
|
||||
@@ -1488,7 +1488,7 @@ void CGameNetworkManager::PlayerJoining( INetworkPlayer *pNetworkPlayer )
|
||||
else
|
||||
{
|
||||
if( !pNetworkPlayer->IsHost() )
|
||||
{
|
||||
{
|
||||
for(int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if(Minecraft::GetInstance()->localplayers[idx] != NULL)
|
||||
@@ -1544,7 +1544,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
}
|
||||
|
||||
// Need to check we're signed in to PSN
|
||||
bool isSignedInLive = true;
|
||||
bool isSignedInLive = true;
|
||||
bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable();
|
||||
int iPadNotSignedInLive = -1;
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++)
|
||||
@@ -1584,7 +1584,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// Not signed in to PSN
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
@@ -1601,10 +1601,10 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
{
|
||||
m_pInviteInfo = (INVITE_INFO *) pInviteInfo;
|
||||
m_iPlayerInvited = userIndex;
|
||||
|
||||
|
||||
m_pUpsell = new PsPlusUpsellWrapper(index);
|
||||
m_pUpsell->displayUpsell();
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1612,7 +1612,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
|
||||
#ifdef __PSVITA__
|
||||
// Need to check we're signed in to PSN
|
||||
bool isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
|
||||
bool isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
|
||||
if (!isSignedInLive)
|
||||
{
|
||||
// Determine why they're not "signed in live"
|
||||
@@ -1625,7 +1625,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
// ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable());
|
||||
// }
|
||||
// else
|
||||
{
|
||||
{
|
||||
// Not signed in to PSN
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
@@ -1648,9 +1648,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
// 4J-PB we shouldn't bring any inactive players into the game, except for the invited player (who may be an inactive player)
|
||||
// 4J Stu - If we are not in a game, then bring in all players signed in
|
||||
if(index==userIndex || pMinecraft->localplayers[index]!=NULL )
|
||||
{
|
||||
{
|
||||
++joiningUsers;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
localUsersMask |= GetLocalPlayerMask( index );
|
||||
}
|
||||
}
|
||||
@@ -1667,7 +1667,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_XBOX) || defined(__PS3__)
|
||||
if(joiningUsers > 1 && !RenderManager.IsHiDef() && userIndex != ProfileManager.GetPrimaryPad())
|
||||
{
|
||||
@@ -1716,9 +1716,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
}
|
||||
#endif
|
||||
if( !g_NetworkManager.IsInSession() )
|
||||
{
|
||||
{
|
||||
#ifndef __PS3__
|
||||
HandleInviteWhenInMenus(userIndex, pInviteInfo);
|
||||
HandleInviteWhenInMenus(userIndex, pInviteInfo);
|
||||
#else
|
||||
// PS3 is more complicated here - we need to make sure that the player is online. If they are then we can do the same as the xbox, if not we need to try and get them online and then, if they do sign in, go down the same path
|
||||
if(ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()))
|
||||
@@ -1771,7 +1771,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
if(!ProfileManager.IsFullVersion())
|
||||
{
|
||||
// The marketplace will fail with the primary player set to -1
|
||||
ProfileManager.SetPrimaryPad(userIndex);
|
||||
ProfileManager.SetPrimaryPad(userIndex);
|
||||
|
||||
app.SetAction(userIndex,eAppAction_DashboardTrialJoinFromInvite);
|
||||
}
|
||||
@@ -1809,7 +1809,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
ProfileManager.QuerySigninStatus();
|
||||
|
||||
// 4J-PB - clear any previous connection errors
|
||||
Minecraft::GetInstance()->clearConnectionFailed();
|
||||
Minecraft::GetInstance()->clearConnectionFailed();
|
||||
|
||||
g_NetworkManager.SetLocalGame(false);
|
||||
|
||||
@@ -1819,7 +1819,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
bool success = g_NetworkManager.JoinGameFromInviteInfo( userIndex, localUsersMask, pInviteInfo );
|
||||
if( !success )
|
||||
{
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,11 +99,11 @@ public:
|
||||
void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
|
||||
void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
void ForceFriendsSessionRefresh();
|
||||
|
||||
|
||||
// Session joining and leaving
|
||||
|
||||
bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo);
|
||||
eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask);
|
||||
eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask);
|
||||
static void CancelJoinGame(LPVOID lpParam); // Not part of the shared interface
|
||||
bool LeaveGame(bool bMigrateHost);
|
||||
static int JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad);
|
||||
@@ -112,13 +112,13 @@ public:
|
||||
void ResetLeavingGame();
|
||||
|
||||
// Threads
|
||||
|
||||
|
||||
bool IsNetworkThreadRunning();
|
||||
static int RunNetworkGameThreadProc( void* lpParameter );
|
||||
static int ServerThreadProc( void* lpParameter );
|
||||
static int ExitAndJoinFromInviteThreadProc( void* lpParam );
|
||||
|
||||
#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__)
|
||||
#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__)
|
||||
static int MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int PSNSignInReturned_0(void* pParam, bool bContinue, int iPad);
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
static void _LeaveGame();
|
||||
static int ChangeSessionTypeThreadProc( void* lpParam );
|
||||
|
||||
// System flags
|
||||
// System flags
|
||||
|
||||
void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
@@ -144,8 +144,8 @@ public:
|
||||
|
||||
void ServerStoppedCreate(bool create); // Create the signal
|
||||
void ServerStopped(); // Signal that we are ready
|
||||
void ServerStoppedWait(); // Wait for the signal
|
||||
void ServerStoppedDestroy(); // Destroy signal
|
||||
void ServerStoppedWait(); // Wait for the signal
|
||||
void ServerStoppedDestroy(); // Destroy signal
|
||||
bool ServerStoppedValid(); // Is non-NULL
|
||||
|
||||
#ifdef __PSVITA__
|
||||
@@ -163,9 +163,9 @@ public:
|
||||
|
||||
// Used for debugging output
|
||||
static const int messageQueue_length = 512;
|
||||
static int64_t messageQueue[messageQueue_length];
|
||||
static __int64 messageQueue[messageQueue_length];
|
||||
static const int byteQueue_length = 512;
|
||||
static int64_t byteQueue[byteQueue_length];
|
||||
static __int64 byteQueue[byteQueue_length];
|
||||
static int messageQueuePos;
|
||||
|
||||
// Methods called from PlatformNetworkManager
|
||||
|
||||
@@ -25,11 +25,11 @@ static SceRemoteStorageStatus statParams;
|
||||
// {
|
||||
// app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// void remoteStorageCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||
// {
|
||||
// app.DebugPrintf("remoteStorageCallback err : 0x%08x\n");
|
||||
//
|
||||
//
|
||||
// app.getRemoteStorage()->getRemoteFileInfo(&statParams, remoteStorageGetInfoCallback, NULL);
|
||||
// }
|
||||
|
||||
@@ -161,17 +161,17 @@ ESavePlatform SonyRemoteStorage::getSavePlatform()
|
||||
|
||||
}
|
||||
|
||||
int64_t SonyRemoteStorage::getSaveSeed()
|
||||
__int64 SonyRemoteStorage::getSaveSeed()
|
||||
{
|
||||
if(m_getInfoStatus != e_infoFound)
|
||||
return 0;
|
||||
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
|
||||
char seedString[17];
|
||||
ZeroMemory(seedString,17);
|
||||
ZeroMemory(seedString,17);
|
||||
memcpy(seedString, pDescData->m_seed,16);
|
||||
|
||||
uint64_t seed = 0;
|
||||
__uint64 seed = 0;
|
||||
std::stringstream ss;
|
||||
ss << seedString;
|
||||
ss >> std::hex >> seed;
|
||||
@@ -185,7 +185,7 @@ unsigned int SonyRemoteStorage::getSaveHostOptions()
|
||||
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
|
||||
char optionsString[9];
|
||||
ZeroMemory(optionsString,9);
|
||||
ZeroMemory(optionsString,9);
|
||||
memcpy(optionsString, pDescData->m_hostOptions,8);
|
||||
|
||||
unsigned int uiHostOptions = 0;
|
||||
@@ -202,7 +202,7 @@ unsigned int SonyRemoteStorage::getSaveTexturePack()
|
||||
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
|
||||
char textureString[9];
|
||||
ZeroMemory(textureString,9);
|
||||
ZeroMemory(textureString,9);
|
||||
memcpy(textureString, pDescData->m_texturePack,8);
|
||||
|
||||
unsigned int uiTexturePack = 0;
|
||||
@@ -219,9 +219,9 @@ const char* SonyRemoteStorage::getRemoteSaveFilename()
|
||||
|
||||
int SonyRemoteStorage::getSaveFilesize()
|
||||
{
|
||||
if(m_getInfoStatus == e_infoFound)
|
||||
if(m_getInfoStatus == e_infoFound)
|
||||
{
|
||||
return m_remoteFileInfo->fileSize;
|
||||
return m_remoteFileInfo->fileSize;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -284,9 +284,9 @@ bool SonyRemoteStorage::saveIsAvailable()
|
||||
if(m_getInfoStatus != e_infoFound)
|
||||
return false;
|
||||
#ifdef __PS3__
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA);
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA);
|
||||
#elif defined __PSVITA__
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3);
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3);
|
||||
#else // __ORBIS__
|
||||
return true;
|
||||
#endif
|
||||
@@ -294,7 +294,7 @@ bool SonyRemoteStorage::saveIsAvailable()
|
||||
|
||||
int SonyRemoteStorage::getDataProgress()
|
||||
{
|
||||
int64_t time = System::currentTimeMillis();
|
||||
__int64 time = System::currentTimeMillis();
|
||||
int elapsedSecs = (time - m_startTime) / 1000;
|
||||
int progVal = m_dataProgress + (elapsedSecs/3);
|
||||
if(progVal > 95)
|
||||
@@ -310,15 +310,15 @@ bool SonyRemoteStorage::shutdown()
|
||||
if(m_bInitialised)
|
||||
{
|
||||
int ret = sceRemoteStorageTerm();
|
||||
if(ret >= 0)
|
||||
if(ret >= 0)
|
||||
{
|
||||
app.DebugPrintf("Term request done \n");
|
||||
m_bInitialised = false;
|
||||
free(m_memPoolBuffer);
|
||||
m_memPoolBuffer = NULL;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error in Term request: 0x%x \n", ret);
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "..\..\Common\Network\Sony\sceRemoteStorage\header\sceRemoteStorage.h"
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
SceRemoteStorageData* m_remoteFileInfo;
|
||||
|
||||
class DescriptionData
|
||||
{
|
||||
{
|
||||
// this stuff is read from a JSON query, so it all has to be text based, max 256 bytes
|
||||
public:
|
||||
char m_platform[4];
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
const char* getLocalFilename();
|
||||
const char* getSaveNameUTF8();
|
||||
ESavePlatform getSavePlatform();
|
||||
int64_t getSaveSeed();
|
||||
__int64 getSaveSeed();
|
||||
unsigned int getSaveHostOptions();
|
||||
unsigned int getSaveTexturePack();
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);
|
||||
static int setDataThread(void* lpParam);
|
||||
|
||||
SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {}
|
||||
SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {}
|
||||
|
||||
protected:
|
||||
const char* getRemoteSaveFilename();
|
||||
@@ -111,7 +111,7 @@ protected:
|
||||
unsigned int m_thumbnailDataSize;
|
||||
C4JThread* m_SetDataThread;
|
||||
PSAVE_INFO m_setDataSaveInfo;
|
||||
int64_t m_startTime;
|
||||
__int64 m_startTime;
|
||||
|
||||
bool m_bAborting;
|
||||
bool m_bTransferStarted;
|
||||
|
||||
Reference in new issue
Block a user