Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
This commit is contained in:
@@ -331,7 +331,7 @@ void hexStrToBin(
|
||||
val <<= 4;
|
||||
}
|
||||
else {
|
||||
if (pBinBuf != nullptr && binOffset < binBufSize) {
|
||||
if (pBinBuf != NULL && binOffset < binBufSize) {
|
||||
memcpy(pBinBuf + binOffset, &val, 1);
|
||||
val = 0;
|
||||
}
|
||||
@@ -339,7 +339,7 @@ void hexStrToBin(
|
||||
}
|
||||
}
|
||||
|
||||
if (val != 0 && pBinBuf != nullptr && binOffset < binBufSize) {
|
||||
if (val != 0 && pBinBuf != NULL && binOffset < binBufSize) {
|
||||
memcpy(pBinBuf + binOffset, &val, 1);
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ void PSVitaNPToolkit::init()
|
||||
|
||||
// extern void npStateCallback(SceNpServiceState state, int retCode, void *userdata);
|
||||
|
||||
ret = sceNpRegisterServiceStateCallback(npStateCallback, nullptr);
|
||||
ret = sceNpRegisterServiceStateCallback(npStateCallback, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceNpRegisterServiceStateCallback() failed. ret = 0x%x\n", ret);
|
||||
|
||||
@@ -45,8 +45,8 @@ int SQRNetworkManager_AdHoc_Vita::m_adhocStatus = false;
|
||||
|
||||
static unsigned char s_Matching2Pool[SCE_NET_ADHOC_MATCHING_POOLSIZE_DEFAULT];
|
||||
|
||||
int (* SQRNetworkManager_AdHoc_Vita::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = nullptr;
|
||||
void * SQRNetworkManager_AdHoc_Vita::s_SignInCompleteParam = nullptr;
|
||||
int (* SQRNetworkManager_AdHoc_Vita::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = NULL;
|
||||
void * SQRNetworkManager_AdHoc_Vita::s_SignInCompleteParam = NULL;
|
||||
sce::Toolkit::NP::PresenceDetails SQRNetworkManager_AdHoc_Vita::s_lastPresenceInfo;
|
||||
int SQRNetworkManager_AdHoc_Vita::s_resendPresenceCountdown = 0;
|
||||
bool SQRNetworkManager_AdHoc_Vita::s_presenceStatusDirty = false;
|
||||
@@ -127,8 +127,8 @@ SQRNetworkManager_AdHoc_Vita::SQRNetworkManager_AdHoc_Vita(ISQRNetworkManagerLis
|
||||
m_isInSession = false;
|
||||
m_offlineGame = false;
|
||||
m_offlineSQR = false;
|
||||
m_aServerId = nullptr;
|
||||
// m_gameBootInvite = nullptr;
|
||||
m_aServerId = NULL;
|
||||
// m_gameBootInvite = NULL;
|
||||
m_adhocStatus = false;
|
||||
m_bLinkDisconnected = false;
|
||||
m_bIsInitialised=false;
|
||||
@@ -166,7 +166,7 @@ void SQRNetworkManager_AdHoc_Vita::Initialise()
|
||||
|
||||
int32_t ret = 0;
|
||||
// int32_t libCtxId = 0;
|
||||
// ret = sceNpInGameMessageInitialize(NP_IN_GAME_MESSAGE_POOL_SIZE, nullptr);
|
||||
// ret = sceNpInGameMessageInitialize(NP_IN_GAME_MESSAGE_POOL_SIZE, NULL);
|
||||
// assert (ret >= 0);
|
||||
// libCtxId = ret;
|
||||
|
||||
@@ -203,7 +203,7 @@ void SQRNetworkManager_AdHoc_Vita::Initialise()
|
||||
// npConf.commId = &s_npCommunicationId;
|
||||
// npConf.commPassphrase = &s_npCommunicationPassphrase;
|
||||
// npConf.commSignature = &s_npCommunicationSignature;
|
||||
// ret = sceNpInit(&npConf, nullptr);
|
||||
// ret = sceNpInit(&npConf, NULL);
|
||||
// if (ret < 0 && ret != SCE_NP_ERROR_ALREADY_INITIALIZED)
|
||||
// {
|
||||
// app.DebugPrintf("sceNpInit failed, ret=%x\n", ret);
|
||||
@@ -388,14 +388,14 @@ bool SQRNetworkManager_AdHoc_Vita::CreateMatchingContext(bool bServer /*= false*
|
||||
|
||||
|
||||
// Free up any external data that we received from the previous search
|
||||
for( size_t i = 0; i < m_aFriendSearchResults.size(); i++ )
|
||||
for( int i = 0; i < m_aFriendSearchResults.size(); i++ )
|
||||
{
|
||||
if(m_aFriendSearchResults[i].m_RoomExtDataReceived)
|
||||
free(m_aFriendSearchResults[i].m_RoomExtDataReceived);
|
||||
m_aFriendSearchResults[i].m_RoomExtDataReceived = nullptr;
|
||||
m_aFriendSearchResults[i].m_RoomExtDataReceived = NULL;
|
||||
if(m_aFriendSearchResults[i].m_gameSessionData)
|
||||
free(m_aFriendSearchResults[i].m_gameSessionData);
|
||||
m_aFriendSearchResults[i].m_gameSessionData = nullptr;
|
||||
m_aFriendSearchResults[i].m_gameSessionData = NULL;
|
||||
}
|
||||
m_friendCount = 0;
|
||||
m_aFriendSearchResults.clear();
|
||||
@@ -406,7 +406,7 @@ bool SQRNetworkManager_AdHoc_Vita::CreateMatchingContext(bool bServer /*= false*
|
||||
ret = sceNetAdhocMatchingStart(m_matchingContext,
|
||||
SCE_KERNEL_DEFAULT_PRIORITY_USER, MATCHING_EVENT_HANDLER_STACK_SIZE,
|
||||
SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT,
|
||||
0, nullptr);//sizeof(g_myInfo.name), &g_myInfo.name);
|
||||
0, NULL);//sizeof(g_myInfo.name), &g_myInfo.name);
|
||||
|
||||
if( ( ret < 0 ) || ForceErrorPoint( SNM_FORCE_ERROR_CONTEXT_START_ASYNC ) )
|
||||
{
|
||||
@@ -448,7 +448,7 @@ void SQRNetworkManager_AdHoc_Vita::InitialiseAfterOnline()
|
||||
if( s_SignInCompleteCallbackFn )
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,true,0);
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void SQRNetworkManager_AdHoc_Vita::Tick()
|
||||
// if( ( m_gameBootInvite m) && ( s_safeToRespondToGameBootInvite ) )
|
||||
// {
|
||||
// m_listener->HandleInviteReceived( ProfileManager.GetPrimaryPad(), m_gameBootInvite );
|
||||
// m_gameBootInvite = nullptr;
|
||||
// m_gameBootInvite = NULL;
|
||||
// }
|
||||
|
||||
ErrorHandlingTick();
|
||||
@@ -585,7 +585,7 @@ void SQRNetworkManager_AdHoc_Vita::ErrorHandlingTick()
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
}
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
app.DebugPrintf("Network error: SNM_INT_STATE_INITIALISE_FAILED\n");
|
||||
if( m_isInSession && m_offlineSQR )
|
||||
@@ -777,7 +777,7 @@ void SQRNetworkManager_AdHoc_Vita::FriendSearchTick()
|
||||
// {
|
||||
// m_friendSearchState = SNM_FRIEND_SEARCH_STATE_GETTING_FRIEND_INFO;
|
||||
// delete m_getFriendCountThread;
|
||||
// m_getFriendCountThread = nullptr;
|
||||
// m_getFriendCountThread = NULL;
|
||||
FriendRoomManagerSearch2();
|
||||
// }
|
||||
}
|
||||
@@ -797,7 +797,7 @@ int SQRNetworkManager_AdHoc_Vita::BasicEventThreadProc( void *lpParameter )
|
||||
//
|
||||
// do
|
||||
// {
|
||||
// ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, nullptr);
|
||||
// ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, NULL);
|
||||
//
|
||||
// // If the sys_event_t we've sent here from the handler has a non-zero data1 element, this is to signify that we should terminate the thread
|
||||
// if( event.udata == 0 )
|
||||
@@ -855,7 +855,7 @@ int SQRNetworkManager_AdHoc_Vita::BasicEventThreadProc( void *lpParameter )
|
||||
// // There shouldn't ever be more than 100 friends returned but limit here just in case
|
||||
// if( manager->m_friendCount > 100 ) manager->m_friendCount = 100;
|
||||
//
|
||||
// SceNpId* friendIDs = nullptr;
|
||||
// SceNpId* friendIDs = NULL;
|
||||
// if(manager->m_friendCount > 0)
|
||||
// {
|
||||
// // grab all the friend IDs first
|
||||
@@ -995,7 +995,7 @@ SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetPlayerByIndex(int idx)
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetPlayerBySmallId(int idx)
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csRoomSyncData);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetLocalPlayerByUserIndex(int idx)
|
||||
@@ -1028,7 +1028,7 @@ SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetLocalPlayerByUserIndex(int id
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csRoomSyncData);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetHostPlayer()
|
||||
@@ -1041,11 +1041,11 @@ SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetHostPlayer()
|
||||
|
||||
SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetPlayerIfReady(SQRNetworkPlayer *player)
|
||||
{
|
||||
if( player == nullptr ) return nullptr;
|
||||
if( player == NULL ) return NULL;
|
||||
|
||||
if( player->IsReady() ) return player;
|
||||
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Update state internally
|
||||
@@ -1086,7 +1086,7 @@ void SQRNetworkManager_AdHoc_Vita::ResetToIdle()
|
||||
{
|
||||
memberIDs.push_back(m_aRoomSlotPlayers[i]->m_roomMemberId);
|
||||
}
|
||||
for(size_t i=0;i<memberIDs.size();i++)
|
||||
for(int i=0;i<memberIDs.size();i++)
|
||||
{
|
||||
if(memberIDs[i] != m_hostMemberId)
|
||||
RemoveRemotePlayersAndSync(memberIDs[i], 15);
|
||||
@@ -1117,7 +1117,7 @@ bool SQRNetworkManager_AdHoc_Vita::JoinRoom(SQRNetworkManager_AdHoc_Vita::Sessio
|
||||
{
|
||||
// Set up the presence info we would like to synchronise out when we have fully joined the game
|
||||
// CPlatformNetworkManagerSony::SetSQRPresenceInfoFromExtData(&s_lastPresenceSyncInfo, searchResult->m_extData, searchResult->m_sessionId.m_RoomId, searchResult->m_sessionId.m_ServerId);
|
||||
return JoinRoom(searchResult->m_netAddr, localPlayerMask, nullptr);
|
||||
return JoinRoom(searchResult->m_netAddr, localPlayerMask, NULL);
|
||||
}
|
||||
|
||||
bool SQRNetworkManager_AdHoc_Vita::JoinRoom(SceNpMatching2RoomId roomId, SceNpMatching2ServerId serverId, int localPlayerMask, const PresenceSyncInfo *presence)
|
||||
@@ -1137,7 +1137,7 @@ bool SQRNetworkManager_AdHoc_Vita::JoinRoom(SceNetInAddr netAddr, int localPlaye
|
||||
}
|
||||
else
|
||||
{
|
||||
for(size_t i=0;i<m_aFriendSearchResults.size();i++)
|
||||
for(int i=0;i<m_aFriendSearchResults.size();i++)
|
||||
{
|
||||
if(m_aFriendSearchResults[i].m_netAddr.s_addr == netAddr.s_addr)
|
||||
{
|
||||
@@ -1162,7 +1162,7 @@ bool SQRNetworkManager_AdHoc_Vita::JoinRoom(SceNetInAddr netAddr, int localPlaye
|
||||
if(!CreateMatchingContext())
|
||||
return false;
|
||||
|
||||
int err = sceNetAdhocMatchingSelectTarget(m_matchingContext, &netAddr, 0, nullptr);
|
||||
int err = sceNetAdhocMatchingSelectTarget(m_matchingContext, &netAddr, 0, NULL);
|
||||
m_hostMemberId = getRoomMemberID(&netAddr);
|
||||
m_hostIPAddr = netAddr;
|
||||
|
||||
@@ -1323,7 +1323,7 @@ void SQRNetworkManager_AdHoc_Vita::FindOrCreateNonNetworkPlayer(int slot, int pl
|
||||
}
|
||||
}
|
||||
// Create the player - non-network players can be considered complete as soon as we create them as we aren't waiting on their network connections becoming complete, so can flag them as such and notify via callback
|
||||
PlayerUID *pUID = nullptr;
|
||||
PlayerUID *pUID = NULL;
|
||||
PlayerUID localUID;
|
||||
if( ( playerType == SQRNetworkPlayer::SNP_TYPE_LOCAL ) ||
|
||||
m_isHosting && ( playerType == SQRNetworkPlayer::SNP_TYPE_HOST ) )
|
||||
@@ -1390,7 +1390,7 @@ void SQRNetworkManager_AdHoc_Vita::MapRoomSlotPlayers(int roomSlotPlayerCount/*=
|
||||
if( m_aRoomSlotPlayers[i]->m_type != SQRNetworkPlayer::SNP_TYPE_REMOTE )
|
||||
{
|
||||
m_vecTempPlayers.push_back(m_aRoomSlotPlayers[i]);
|
||||
m_aRoomSlotPlayers[i] = nullptr;
|
||||
m_aRoomSlotPlayers[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1446,7 +1446,7 @@ void SQRNetworkManager_AdHoc_Vita::MapRoomSlotPlayers(int roomSlotPlayerCount/*=
|
||||
if( m_aRoomSlotPlayers[i]->m_type != SQRNetworkPlayer::SNP_TYPE_LOCAL )
|
||||
{
|
||||
m_vecTempPlayers.push_back(m_aRoomSlotPlayers[i]);
|
||||
m_aRoomSlotPlayers[i] = nullptr;
|
||||
m_aRoomSlotPlayers[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1538,7 +1538,7 @@ void SQRNetworkManager_AdHoc_Vita::UpdatePlayersFromRoomSyncUIDs()
|
||||
}
|
||||
|
||||
// Host only - add remote players to our internal storage of player slots, and synchronise this with other room members.
|
||||
bool SQRNetworkManager_AdHoc_Vita::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==nullptr*/ )
|
||||
bool SQRNetworkManager_AdHoc_Vita::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==NULL*/ )
|
||||
{
|
||||
assert( m_isHosting );
|
||||
|
||||
@@ -1658,7 +1658,7 @@ void SQRNetworkManager_AdHoc_Vita::RemoveRemotePlayersAndSync( SceNpMatching2Roo
|
||||
}
|
||||
// Zero last element, that isn't part of the currently sized array anymore
|
||||
memset(&m_roomSyncData.players[m_roomSyncData.getPlayerCount()],0,sizeof(PlayerSyncData));
|
||||
m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = nullptr;
|
||||
m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1701,7 +1701,7 @@ void SQRNetworkManager_AdHoc_Vita::RemoveNetworkPlayers( int mask )
|
||||
{
|
||||
if( m_aRoomSlotPlayers[i] == player )
|
||||
{
|
||||
m_aRoomSlotPlayers[i] = nullptr;
|
||||
m_aRoomSlotPlayers[i] = NULL;
|
||||
}
|
||||
}
|
||||
// And delete the reference from the ctx->player map
|
||||
@@ -1807,7 +1807,7 @@ void SQRNetworkManager_AdHoc_Vita::MatchingEventHandler(int id, int event, SceNe
|
||||
// check we don't have this already
|
||||
int currIndex = -1;
|
||||
bool bChanged = false;
|
||||
for(size_t i=0; i<manager->m_aFriendSearchResults.size(); i++)
|
||||
for(int i=0; i<manager->m_aFriendSearchResults.size(); i++)
|
||||
{
|
||||
if(manager->m_aFriendSearchResults[i].m_netAddr.s_addr == peer->s_addr)
|
||||
{
|
||||
@@ -1843,7 +1843,7 @@ void SQRNetworkManager_AdHoc_Vita::MatchingEventHandler(int id, int event, SceNe
|
||||
|
||||
case SCE_NET_ADHOC_MATCHING_EVENT_REQUEST: // A join request was received
|
||||
app.DebugPrintf("P2P SCE_NET_ADHOC_MATCHING_EVENT_REQUEST Received!!\n");
|
||||
if (optlen > 0 && opt != nullptr)
|
||||
if (optlen > 0 && opt != NULL)
|
||||
{
|
||||
ret = SCE_OK;// parentRequestAdd(opt);
|
||||
if (ret != SCE_OK)
|
||||
@@ -1987,7 +1987,7 @@ void SQRNetworkManager_AdHoc_Vita::MatchingEventHandler(int id, int event, SceNe
|
||||
{
|
||||
app.DebugPrintf("P2P SCE_NET_ADHOC_MATCHING_EVENT_DATA Received!!\n");
|
||||
|
||||
if (optlen <= 0 || opt == nullptr)
|
||||
if (optlen <= 0 || opt == NULL)
|
||||
{
|
||||
assert(0);
|
||||
break;
|
||||
@@ -2270,7 +2270,7 @@ bool SQRNetworkManager_AdHoc_Vita::CreateRudpConnections(SceNetInAddr peer)
|
||||
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_CREATE_RUDP_CONTEXT) ) return false;
|
||||
if( m_isHosting )
|
||||
{
|
||||
m_RudpCtxToPlayerMap[ rudpCtx ] = new SQRNetworkPlayer( this, SQRNetworkPlayer::SNP_TYPE_REMOTE, true, getRoomMemberID((&peer)), 0, rudpCtx, nullptr );
|
||||
m_RudpCtxToPlayerMap[ rudpCtx ] = new SQRNetworkPlayer( this, SQRNetworkPlayer::SNP_TYPE_REMOTE, true, getRoomMemberID((&peer)), 0, rudpCtx, NULL );
|
||||
m_RudpCtxToIPAddrMap[ rudpCtx ] = peer;
|
||||
}
|
||||
else
|
||||
@@ -2311,7 +2311,7 @@ SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetPlayerFromRudpCtx(int rudpCtx
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2322,7 +2322,7 @@ SceNetInAddr* SQRNetworkManager_AdHoc_Vita::GetIPAddrFromRudpCtx(int rudpCtx)
|
||||
{
|
||||
return &it->second;
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2336,7 +2336,7 @@ SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetPlayerFromRoomMemberAndLocalI
|
||||
return it->second;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2406,7 +2406,7 @@ void SQRNetworkManager_AdHoc_Vita::HandleMatchingContextStart()
|
||||
if( m_state == SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT )
|
||||
{
|
||||
SetState( SNM_INT_STATE_IDLE );
|
||||
GetExtDataForRoom(0, nullptr, nullptr, nullptr);
|
||||
GetExtDataForRoom(0, NULL, NULL, NULL);
|
||||
}
|
||||
else if( m_state == SNM_INT_STATE_HOSTING_STARTING_MATCHING_CONTEXT )
|
||||
{
|
||||
@@ -2431,7 +2431,7 @@ void SQRNetworkManager_AdHoc_Vita::HandleMatchingContextStart()
|
||||
if(s_SignInCompleteCallbackFn)
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam, true, 0);
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2446,7 +2446,7 @@ int SQRNetworkManager_AdHoc_Vita::BasicEventCallback(int event, int retCode, uin
|
||||
PSVITA_STUBBED;
|
||||
// SQRNetworkManager_AdHoc_Vita *manager = (SQRNetworkManager_AdHoc_Vita *)arg;
|
||||
// // We aren't allowed to actually get the event directly from this callback, so send our own internal event to a thread dedicated to doing this
|
||||
// sceKernelTriggerUserEvent(m_basicEventQueue, sc_UserEventHandle, nullptr);
|
||||
// sceKernelTriggerUserEvent(m_basicEventQueue, sc_UserEventHandle, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2490,7 +2490,7 @@ void SQRNetworkManager_AdHoc_Vita::SysUtilCallback(uint64_t status, uint64_t par
|
||||
// {
|
||||
// s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
// }
|
||||
// s_SignInCompleteCallbackFn = nullptr;
|
||||
// s_SignInCompleteCallbackFn = NULL;
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
@@ -2505,7 +2505,7 @@ void SQRNetworkManager_AdHoc_Vita::SysUtilCallback(uint64_t status, uint64_t par
|
||||
// {
|
||||
// s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
// }
|
||||
// s_SignInCompleteCallbackFn = nullptr;
|
||||
// s_SignInCompleteCallbackFn = NULL;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@@ -2542,7 +2542,7 @@ void SQRNetworkManager_AdHoc_Vita::updateNetCheckDialog()
|
||||
if( s_SignInCompleteCallbackFn )
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,true,0);
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2561,7 +2561,7 @@ void SQRNetworkManager_AdHoc_Vita::updateNetCheckDialog()
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
}
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2577,7 +2577,7 @@ void SQRNetworkManager_AdHoc_Vita::RudpContextCallback(int ctx_id, int event_id,
|
||||
{
|
||||
case SCE_RUDP_CONTEXT_EVENT_CLOSED:
|
||||
{
|
||||
SQRVoiceConnection* pVoice = nullptr;
|
||||
SQRVoiceConnection* pVoice = NULL;
|
||||
if(sc_voiceChatEnabled)
|
||||
SonyVoiceChat_Vita::GetVoiceConnectionFromRudpCtx(ctx_id);
|
||||
|
||||
@@ -2638,7 +2638,7 @@ void SQRNetworkManager_AdHoc_Vita::RudpContextCallback(int ctx_id, int event_id,
|
||||
case SCE_RUDP_CONTEXT_EVENT_READABLE:
|
||||
if( manager->m_listener )
|
||||
{
|
||||
SQRVoiceConnection* pVoice = nullptr;
|
||||
SQRVoiceConnection* pVoice = NULL;
|
||||
if(sc_voiceChatEnabled)
|
||||
{
|
||||
SonyVoiceChat_Vita::GetVoiceConnectionFromRudpCtx(ctx_id);
|
||||
@@ -2698,7 +2698,7 @@ void SQRNetworkManager_AdHoc_Vita::RudpContextCallback(int ctx_id, int event_id,
|
||||
playerFrom = manager->m_aRoomSlotPlayers[0];
|
||||
playerTo = manager->GetPlayerFromRudpCtx( ctx_id );
|
||||
}
|
||||
if( ( playerFrom != nullptr ) && ( playerTo != nullptr ) )
|
||||
if( ( playerFrom != NULL ) && ( playerTo != NULL ) )
|
||||
{
|
||||
manager->m_listener->HandleDataReceived( playerFrom, playerTo, data, bytesRead );
|
||||
}
|
||||
@@ -2761,7 +2761,7 @@ void SQRNetworkManager_AdHoc_Vita::ServerContextValid_CreateRoom()
|
||||
int ret = -1;
|
||||
if( !ForceErrorPoint(SNM_FORCE_ERROR_GET_WORLD_INFO_LIST) )
|
||||
{
|
||||
ret = sceNpMatching2GetWorldInfoList( m_matchingContext, &reqParam, nullptr, &m_getWorldRequestId);
|
||||
ret = sceNpMatching2GetWorldInfoList( m_matchingContext, &reqParam, NULL, &m_getWorldRequestId);
|
||||
}
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -2790,7 +2790,7 @@ void SQRNetworkManager_AdHoc_Vita::ServerContextValid_JoinRoom()
|
||||
reqParam.roomMemberBinAttrInternalNum = 1;
|
||||
reqParam.roomMemberBinAttrInternal = &binAttr;
|
||||
|
||||
int ret = sceNpMatching2JoinRoom( m_matchingContext, &reqParam, nullptr, &m_joinRoomRequestId );
|
||||
int ret = sceNpMatching2JoinRoom( m_matchingContext, &reqParam, NULL, &m_joinRoomRequestId );
|
||||
if ( (ret < 0) || ForceErrorPoint(SNM_FORCE_ERROR_JOIN_ROOM) )
|
||||
{
|
||||
if( ret == SCE_NP_MATCHING2_SERVER_ERROR_NAT_TYPE_MISMATCH)
|
||||
@@ -2814,14 +2814,14 @@ const SceNpCommunicationSignature* SQRNetworkManager_AdHoc_Vita::GetSceNpCommsSi
|
||||
const SceNpTitleId* SQRNetworkManager_AdHoc_Vita::GetSceNpTitleId()
|
||||
{
|
||||
PSVITA_STUBBED;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
// return &s_npTitleId;
|
||||
}
|
||||
|
||||
const SceNpTitleSecret* SQRNetworkManager_AdHoc_Vita::GetSceNpTitleSecret()
|
||||
{
|
||||
PSVITA_STUBBED;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
// return &s_npTitleSecret;
|
||||
}
|
||||
|
||||
@@ -2852,7 +2852,7 @@ int SQRNetworkManager_AdHoc_Vita::GetRemovedMask(int newMask, int oldMask)
|
||||
void SQRNetworkManager_AdHoc_Vita::GetExtDataForRoom( SceNpMatching2RoomId roomId, void *extData, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam )
|
||||
{
|
||||
|
||||
for(size_t i=0;i<m_aFriendSearchResults.size();i++)
|
||||
for(int i=0;i<m_aFriendSearchResults.size();i++)
|
||||
{
|
||||
if(m_aFriendSearchResults[i].m_netAddr.s_addr == roomId)
|
||||
{
|
||||
@@ -2964,7 +2964,7 @@ void SQRNetworkManager_AdHoc_Vita::AttemptAdhocSignIn(int (*SignInCompleteCallba
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
}
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3039,7 +3039,7 @@ void SQRNetworkManager_AdHoc_Vita::AttemptPSNSignIn(int (*SignInCompleteCallback
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
}
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3234,7 +3234,7 @@ SQRNetworkPlayer *SQRNetworkManager_AdHoc_Vita::GetPlayerByXuid(PlayerUID xuid)
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csRoomSyncData);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void SQRNetworkManager_AdHoc_Vita::UpdateLocalIPAddress()
|
||||
|
||||
@@ -163,7 +163,7 @@ private:
|
||||
void LocalDataSend(SQRNetworkPlayer *playerFrom, SQRNetworkPlayer *playerTo, const void *data, unsigned int dataSize);
|
||||
int GetSessionIndex(SQRNetworkPlayer *player);
|
||||
|
||||
bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = nullptr );
|
||||
bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = NULL );
|
||||
void RemoveRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int mask );
|
||||
void RemoveNetworkPlayers( int mask );
|
||||
void SetLocalPlayersAndSync();
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
// image used for the invite gui, filesize must be smaller than SCE_NP_MESSAGE_DIALOG_MAX_INDEX_ICON_SIZE ( 64K )
|
||||
#define SESSION_IMAGE_PATH "app0:PSVita/session_image.png"
|
||||
|
||||
int (* SQRNetworkManager_Vita::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = nullptr;
|
||||
void * SQRNetworkManager_Vita::s_SignInCompleteParam = nullptr;
|
||||
int (* SQRNetworkManager_Vita::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = NULL;
|
||||
void * SQRNetworkManager_Vita::s_SignInCompleteParam = NULL;
|
||||
sce::Toolkit::NP::PresenceDetails SQRNetworkManager_Vita::s_lastPresenceInfo;
|
||||
int SQRNetworkManager_Vita::s_resendPresenceCountdown = 0;
|
||||
bool SQRNetworkManager_Vita::s_presenceStatusDirty = false;
|
||||
@@ -98,8 +98,8 @@ SQRNetworkManager_Vita::SQRNetworkManager_Vita(ISQRNetworkManagerListener *liste
|
||||
m_isInSession = false;
|
||||
m_offlineGame = false;
|
||||
m_offlineSQR = false;
|
||||
m_aServerId = nullptr;
|
||||
m_gameBootInvite = nullptr;
|
||||
m_aServerId = NULL;
|
||||
m_gameBootInvite = NULL;
|
||||
m_onlineStatus = false;
|
||||
m_bLinkDisconnected = false;
|
||||
m_bShuttingDown = false;
|
||||
@@ -129,7 +129,7 @@ void SQRNetworkManager_Vita::Initialise()
|
||||
m_bShuttingDown = false;
|
||||
int32_t ret = 0;
|
||||
// int32_t libCtxId = 0;
|
||||
// ret = sceNpInGameMessageInitialize(NP_IN_GAME_MESSAGE_POOL_SIZE, nullptr);
|
||||
// ret = sceNpInGameMessageInitialize(NP_IN_GAME_MESSAGE_POOL_SIZE, NULL);
|
||||
// assert (ret >= 0);
|
||||
// libCtxId = ret;
|
||||
|
||||
@@ -162,7 +162,7 @@ void SQRNetworkManager_Vita::Initialise()
|
||||
}
|
||||
|
||||
SetState(SNM_INT_STATE_SIGNING_IN);
|
||||
// AttemptPSNSignIn(nullptr, nullptr);
|
||||
// AttemptPSNSignIn(NULL, NULL);
|
||||
|
||||
// SonyHttp::init();
|
||||
|
||||
@@ -170,7 +170,7 @@ void SQRNetworkManager_Vita::Initialise()
|
||||
// npConf.commId = &s_npCommunicationId;
|
||||
// npConf.commPassphrase = &s_npCommunicationPassphrase;
|
||||
// npConf.commSignature = &s_npCommunicationSignature;
|
||||
// ret = sceNpInit(&npConf, nullptr);
|
||||
// ret = sceNpInit(&npConf, NULL);
|
||||
// if (ret < 0 && ret != SCE_NP_ERROR_ALREADY_INITIALIZED)
|
||||
// {
|
||||
// app.DebugPrintf("sceNpInit failed, ret=%x\n", ret);
|
||||
@@ -295,7 +295,7 @@ void SQRNetworkManager_Vita::InitialiseAfterOnline()
|
||||
if( s_SignInCompleteCallbackFn )
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,true,0);
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -329,7 +329,7 @@ void SQRNetworkManager_Vita::InitialiseAfterOnline()
|
||||
|
||||
app.DebugPrintf("sceNpMatching2CreateContext\n");
|
||||
ret = sceNpMatching2CreateContext(&npID, GetSceNpCommsId(), &s_npCommunicationPassphrase, &m_matchingContext);
|
||||
//ret = sceNpMatching2CreateContext(&npID, nullptr, nullptr, &m_matchingContext);
|
||||
//ret = sceNpMatching2CreateContext(&npID, NULL, NULL, &m_matchingContext);
|
||||
|
||||
if( ( ret < 0 ) || ForceErrorPoint( SNM_FORCE_ERROR_CREATE_MATCHING_CONTEXT ) )
|
||||
{
|
||||
@@ -377,7 +377,7 @@ void SQRNetworkManager_Vita::Tick()
|
||||
if( ( m_gameBootInvite ) && ( s_safeToRespondToGameBootInvite ) )
|
||||
{
|
||||
m_listener->HandleInviteReceived( ProfileManager.GetPrimaryPad(), m_gameBootInvite );
|
||||
m_gameBootInvite = nullptr;
|
||||
m_gameBootInvite = NULL;
|
||||
}
|
||||
|
||||
ErrorHandlingTick();
|
||||
@@ -444,12 +444,12 @@ void SQRNetworkManager_Vita::Tick()
|
||||
if( s_signInCompleteCallbackIfFailed )
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
else if(s_SignInCompleteCallbackFn)
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam, true, 0);
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ void SQRNetworkManager_Vita::ErrorHandlingTick()
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
}
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
app.DebugPrintf("Network error: SNM_INT_STATE_INITIALISE_FAILED\n");
|
||||
if( m_isInSession && m_offlineGame) // m_offlineSQR ) // MGH - changed this to m_offlineGame, as m_offlineSQR can be true when running an online game but the init has failed because the servers are down
|
||||
@@ -578,7 +578,7 @@ void SQRNetworkManager_Vita::UpdateExternalRoomData()
|
||||
reqParam.roomBinAttrExternal = &roomBinAttr;
|
||||
|
||||
app.DebugPrintf("sceNpMatching2SetRoomDataExternal\n");
|
||||
int ret = sceNpMatching2SetRoomDataExternal ( m_matchingContext, &reqParam, nullptr, &m_setRoomDataRequestId );
|
||||
int ret = sceNpMatching2SetRoomDataExternal ( m_matchingContext, &reqParam, NULL, &m_setRoomDataRequestId );
|
||||
app.DebugPrintf(CMinecraftApp::USER_RR,"sceNpMatching2SetRoomDataExternal returns 0x%x, number of players %d\n",ret,((char *)m_joinExtData)[174]);
|
||||
if( ( ret < 0 ) || ForceErrorPoint( SNM_FORCE_ERROR_SET_EXTERNAL_ROOM_DATA ) )
|
||||
{
|
||||
@@ -608,11 +608,11 @@ bool SQRNetworkManager_Vita::FriendRoomManagerSearch()
|
||||
}
|
||||
|
||||
// Free up any external data that we received from the previous search
|
||||
for( size_t i = 0; i < m_aFriendSearchResults.size(); i++ )
|
||||
for( int i = 0; i < m_aFriendSearchResults.size(); i++ )
|
||||
{
|
||||
if(m_aFriendSearchResults[i].m_RoomExtDataReceived)
|
||||
free(m_aFriendSearchResults[i].m_RoomExtDataReceived);
|
||||
m_aFriendSearchResults[i].m_RoomExtDataReceived = nullptr;
|
||||
m_aFriendSearchResults[i].m_RoomExtDataReceived = NULL;
|
||||
}
|
||||
|
||||
m_friendSearchState = SNM_FRIEND_SEARCH_STATE_GETTING_FRIEND_COUNT;
|
||||
@@ -675,7 +675,7 @@ void SQRNetworkManager_Vita::FriendSearchTick()
|
||||
{
|
||||
m_friendSearchState = SNM_FRIEND_SEARCH_STATE_GETTING_FRIEND_INFO;
|
||||
delete m_getFriendCountThread;
|
||||
m_getFriendCountThread = nullptr;
|
||||
m_getFriendCountThread = NULL;
|
||||
FriendRoomManagerSearch2();
|
||||
}
|
||||
}
|
||||
@@ -695,7 +695,7 @@ int SQRNetworkManager_Vita::BasicEventThreadProc( void *lpParameter )
|
||||
//
|
||||
// do
|
||||
// {
|
||||
// ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, nullptr);
|
||||
// ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, NULL);
|
||||
//
|
||||
// // If the sys_event_t we've sent here from the handler has a non-zero data1 element, this is to signify that we should terminate the thread
|
||||
// if( event.udata == 0 )
|
||||
@@ -753,7 +753,7 @@ int SQRNetworkManager_Vita::GetFriendsThreadProc( void* lpParameter )
|
||||
// There shouldn't ever be more than 100 friends returned but limit here just in case
|
||||
if( manager->m_friendCount > 100 ) manager->m_friendCount = 100;
|
||||
|
||||
SceNpId* friendIDs = nullptr;
|
||||
SceNpId* friendIDs = NULL;
|
||||
if(manager->m_friendCount > 0)
|
||||
{
|
||||
// grab all the friend IDs first
|
||||
@@ -890,7 +890,7 @@ SQRNetworkPlayer *SQRNetworkManager_Vita::GetPlayerByIndex(int idx)
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -907,7 +907,7 @@ SQRNetworkPlayer *SQRNetworkManager_Vita::GetPlayerBySmallId(int idx)
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csRoomSyncData);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SQRNetworkPlayer *SQRNetworkManager_Vita::GetLocalPlayerByUserIndex(int idx)
|
||||
@@ -923,7 +923,7 @@ SQRNetworkPlayer *SQRNetworkManager_Vita::GetLocalPlayerByUserIndex(int idx)
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csRoomSyncData);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SQRNetworkPlayer *SQRNetworkManager_Vita::GetHostPlayer()
|
||||
@@ -936,11 +936,11 @@ SQRNetworkPlayer *SQRNetworkManager_Vita::GetHostPlayer()
|
||||
|
||||
SQRNetworkPlayer *SQRNetworkManager_Vita::GetPlayerIfReady(SQRNetworkPlayer *player)
|
||||
{
|
||||
if( player == nullptr ) return nullptr;
|
||||
if( player == NULL ) return NULL;
|
||||
|
||||
if( player->IsReady() ) return player;
|
||||
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Update state internally
|
||||
@@ -1039,7 +1039,7 @@ bool SQRNetworkManager_Vita::JoinRoom(SQRNetworkManager_Vita::SessionSearchResul
|
||||
{
|
||||
// Set up the presence info we would like to synchronise out when we have fully joined the game
|
||||
CPlatformNetworkManagerSony::SetSQRPresenceInfoFromExtData(&s_lastPresenceSyncInfo, searchResult->m_extData, searchResult->m_sessionId.m_RoomId, searchResult->m_sessionId.m_ServerId);
|
||||
return JoinRoom(searchResult->m_sessionId.m_RoomId, searchResult->m_sessionId.m_ServerId, localPlayerMask, nullptr);
|
||||
return JoinRoom(searchResult->m_sessionId.m_RoomId, searchResult->m_sessionId.m_ServerId, localPlayerMask, NULL);
|
||||
}
|
||||
|
||||
// Join room with a specified roomId. This is used when joining from an invite, as well as by the previous method
|
||||
@@ -1106,7 +1106,7 @@ void SQRNetworkManager_Vita::LeaveRoom(bool bActuallyLeaveRoom)
|
||||
|
||||
SetState(SNM_INT_STATE_LEAVING);
|
||||
app.DebugPrintf("sceNpMatching2LeaveRoom\n");
|
||||
int ret = sceNpMatching2LeaveRoom( m_matchingContext, &reqParam, nullptr, &m_leaveRoomRequestId );
|
||||
int ret = sceNpMatching2LeaveRoom( m_matchingContext, &reqParam, NULL, &m_leaveRoomRequestId );
|
||||
if( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_LEAVE_ROOM) )
|
||||
{
|
||||
SetState(SNM_INT_STATE_LEAVING_FAILED);
|
||||
@@ -1214,7 +1214,7 @@ bool SQRNetworkManager_Vita::AddLocalPlayerByUserIndex(int idx)
|
||||
reqParam.roomMemberBinAttrInternal = &binAttr;
|
||||
|
||||
app.DebugPrintf("sceNpMatching2SetRoomMemberDataInternal\n");
|
||||
int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, nullptr, &m_setRoomMemberInternalDataRequestId );
|
||||
int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, NULL, &m_setRoomMemberInternalDataRequestId );
|
||||
|
||||
if( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_SET_ROOM_MEMBER_DATA_INTERNAL) )
|
||||
{
|
||||
@@ -1264,7 +1264,7 @@ bool SQRNetworkManager_Vita::RemoveLocalPlayerByUserIndex(int idx)
|
||||
// And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers.
|
||||
// This will also delete the SQRNetworkPlayer and do all the callbacks that requires etc.
|
||||
MapRoomSlotPlayers(roomSlotPlayerCount);
|
||||
m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = nullptr;
|
||||
m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL;
|
||||
|
||||
// Sync this back out to our networked clients...
|
||||
SyncRoomData();
|
||||
@@ -1302,7 +1302,7 @@ bool SQRNetworkManager_Vita::RemoveLocalPlayerByUserIndex(int idx)
|
||||
reqParam.roomMemberBinAttrInternalNum = 1;
|
||||
reqParam.roomMemberBinAttrInternal = &binAttr;
|
||||
|
||||
int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, nullptr, &m_setRoomMemberInternalDataRequestId );
|
||||
int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, NULL, &m_setRoomMemberInternalDataRequestId );
|
||||
|
||||
if( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_SET_ROOM_MEMBER_DATA_INTERNAL2) )
|
||||
{
|
||||
@@ -1526,14 +1526,14 @@ void SQRNetworkManager_Vita::TickJoinablePresenceData()
|
||||
// // Signed in to PSN but not connected (no internet access)
|
||||
// UINT uiIDA[1];
|
||||
// uiIDA[0] = IDS_OK;
|
||||
// ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr, app.GetStringTable());
|
||||
// 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;
|
||||
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &MustSignInReturnedPresenceInvite, nullptr);
|
||||
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &MustSignInReturnedPresenceInvite, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1573,7 +1573,7 @@ void SQRNetworkManager_Vita::FindOrCreateNonNetworkPlayer(int slot, int playerTy
|
||||
}
|
||||
}
|
||||
// Create the player - non-network players can be considered complete as soon as we create them as we aren't waiting on their network connections becoming complete, so can flag them as such and notify via callback
|
||||
PlayerUID *pUID = nullptr;
|
||||
PlayerUID *pUID = NULL;
|
||||
PlayerUID localUID;
|
||||
if( ( playerType == SQRNetworkPlayer::SNP_TYPE_LOCAL ) ||
|
||||
m_isHosting && ( playerType == SQRNetworkPlayer::SNP_TYPE_HOST ) )
|
||||
@@ -1640,7 +1640,7 @@ void SQRNetworkManager_Vita::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
|
||||
if( m_aRoomSlotPlayers[i]->m_type != SQRNetworkPlayer::SNP_TYPE_REMOTE )
|
||||
{
|
||||
m_vecTempPlayers.push_back(m_aRoomSlotPlayers[i]);
|
||||
m_aRoomSlotPlayers[i] = nullptr;
|
||||
m_aRoomSlotPlayers[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1696,7 +1696,7 @@ void SQRNetworkManager_Vita::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
|
||||
if( m_aRoomSlotPlayers[i]->m_type != SQRNetworkPlayer::SNP_TYPE_LOCAL )
|
||||
{
|
||||
m_vecTempPlayers.push_back(m_aRoomSlotPlayers[i]);
|
||||
m_aRoomSlotPlayers[i] = nullptr;
|
||||
m_aRoomSlotPlayers[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1788,7 +1788,7 @@ void SQRNetworkManager_Vita::UpdatePlayersFromRoomSyncUIDs()
|
||||
}
|
||||
|
||||
// Host only - add remote players to our internal storage of player slots, and synchronise this with other room members.
|
||||
bool SQRNetworkManager_Vita::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==nullptr*/ )
|
||||
bool SQRNetworkManager_Vita::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==NULL*/ )
|
||||
{
|
||||
assert( m_isHosting );
|
||||
|
||||
@@ -1908,7 +1908,7 @@ void SQRNetworkManager_Vita::RemoveRemotePlayersAndSync( SceNpMatching2RoomMembe
|
||||
}
|
||||
// Zero last element, that isn't part of the currently sized array anymore
|
||||
memset(&m_roomSyncData.players[m_roomSyncData.getPlayerCount()],0,sizeof(PlayerSyncData));
|
||||
m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = nullptr;
|
||||
m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1951,7 +1951,7 @@ void SQRNetworkManager_Vita::RemoveNetworkPlayers( int mask )
|
||||
{
|
||||
if( m_aRoomSlotPlayers[i] == player )
|
||||
{
|
||||
m_aRoomSlotPlayers[i] = nullptr;
|
||||
m_aRoomSlotPlayers[i] = NULL;
|
||||
}
|
||||
}
|
||||
// And delete the reference from the ctx->player map
|
||||
@@ -2004,7 +2004,7 @@ void SQRNetworkManager_Vita::SyncRoomData()
|
||||
roomBinAttr.size = sizeof( m_roomSyncData );
|
||||
reqParam.roomBinAttrInternalNum = 1;
|
||||
reqParam.roomBinAttrInternal = &roomBinAttr;
|
||||
sceNpMatching2SetRoomDataInternal ( m_matchingContext, &reqParam, nullptr, &m_setRoomDataRequestId );
|
||||
sceNpMatching2SetRoomDataInternal ( m_matchingContext, &reqParam, NULL, &m_setRoomDataRequestId );
|
||||
}
|
||||
|
||||
// Check if the matching context is valid, and if not attempt to create one. If to do this requires starting an asynchronous process, then sets the internal state to the state passed in
|
||||
@@ -2037,7 +2037,7 @@ bool SQRNetworkManager_Vita::GetMatchingContext(eSQRNetworkManagerInternalState
|
||||
// Create context
|
||||
app.DebugPrintf("sceNpMatching2CreateContext\n");
|
||||
ret = sceNpMatching2CreateContext(&npId, &s_npCommunicationId, &s_npCommunicationPassphrase, &m_matchingContext/*, option*/);
|
||||
//ret = sceNpMatching2CreateContext(&npId, nullptr,nullptr, &m_matchingContext/*, option*/);
|
||||
//ret = sceNpMatching2CreateContext(&npId, NULL,NULL, &m_matchingContext/*, option*/);
|
||||
if( ret < 0 )
|
||||
{
|
||||
app.DebugPrintf("SQRNetworkManager::GetMatchingContext - sceNpMatching2CreateContext failed with code 0x%08x\n", ret);
|
||||
@@ -2137,7 +2137,7 @@ bool SQRNetworkManager_Vita::GetServerContext(SceNpMatching2ServerId serverId)
|
||||
// {
|
||||
// // Get list of server IDs of servers allocated to the application. We don't actually need to do this, but it is as good a way as any to try a matching2 service and check that
|
||||
// // the context *really* is valid.
|
||||
// int serverCount = sceNpMatching2GetServerIdListLocal( m_matchingContext, nullptr, 0 );
|
||||
// int serverCount = sceNpMatching2GetServerIdListLocal( m_matchingContext, NULL, 0 );
|
||||
// // If an error is returned here, we need to destroy and recerate our server - if this goes ok we should come back through this path again
|
||||
// if( ( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_UNAVAILABLE ) || // This error has been seen (occasionally) in a normal working environment
|
||||
// ( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) ) // Also checking for this as a means of simulating the previous error
|
||||
@@ -2233,7 +2233,7 @@ void SQRNetworkManager_Vita::RoomCreateTick()
|
||||
app.DebugPrintf(CMinecraftApp::USER_RR,">> Creating room start\n");
|
||||
s_roomStartTime = System::currentTimeMillis();
|
||||
app.DebugPrintf("sceNpMatching2CreateJoinRoom\n");
|
||||
int ret = sceNpMatching2CreateJoinRoom( m_matchingContext, &reqParam, nullptr, &m_createRoomRequestId );
|
||||
int ret = sceNpMatching2CreateJoinRoom( m_matchingContext, &reqParam, NULL, &m_createRoomRequestId );
|
||||
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_CREATE_JOIN_ROOM) )
|
||||
{
|
||||
SetState(SNM_INT_STATE_HOSTING_CREATE_ROOM_FAILED);
|
||||
@@ -2468,7 +2468,7 @@ bool SQRNetworkManager_Vita::CreateVoiceRudpConnections(SceNpMatching2RoomId roo
|
||||
|
||||
// create this connection if we don't have it already
|
||||
SQRVoiceConnection* pConnection = SonyVoiceChat_Vita::getVoiceConnectionFromRoomMemberID(peerMemberId);
|
||||
if(pConnection == nullptr)
|
||||
if(pConnection == NULL)
|
||||
{
|
||||
|
||||
// Create an Rudp context for the voice connection, this will happen regardless of whether the peer is client or host
|
||||
@@ -2542,7 +2542,7 @@ bool SQRNetworkManager_Vita::CreateRudpConnections(SceNpMatching2RoomId roomId,
|
||||
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_CREATE_RUDP_CONTEXT) ) return false;
|
||||
if( m_isHosting )
|
||||
{
|
||||
m_RudpCtxToPlayerMap[ rudpCtx ] = new SQRNetworkPlayer( this, SQRNetworkPlayer::SNP_TYPE_REMOTE, true, playersMemberId, i, rudpCtx, nullptr );
|
||||
m_RudpCtxToPlayerMap[ rudpCtx ] = new SQRNetworkPlayer( this, SQRNetworkPlayer::SNP_TYPE_REMOTE, true, playersMemberId, i, rudpCtx, NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2576,7 +2576,7 @@ SQRNetworkPlayer *SQRNetworkManager_Vita::GetPlayerFromRudpCtx(int rudpCtx)
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2590,7 +2590,7 @@ SQRNetworkPlayer *SQRNetworkManager_Vita::GetPlayerFromRoomMemberAndLocalIdx(int
|
||||
return it->second;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2693,7 +2693,7 @@ void SQRNetworkManager_Vita::ContextCallback(SceNpMatching2ContextId id, SceNpM
|
||||
if( manager->m_state == SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT )
|
||||
{
|
||||
manager->SetState( SNM_INT_STATE_IDLE );
|
||||
manager->GetExtDataForRoom(0, nullptr, nullptr, nullptr);
|
||||
manager->GetExtDataForRoom(0, NULL, NULL, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2729,7 +2729,7 @@ void SQRNetworkManager_Vita::ContextCallback(SceNpMatching2ContextId id, SceNpM
|
||||
// if(s_SignInCompleteCallbackFn)
|
||||
// {
|
||||
// s_SignInCompleteCallbackFn(s_SignInCompleteParam, true, 0);
|
||||
// s_SignInCompleteCallbackFn = nullptr;
|
||||
// s_SignInCompleteCallbackFn = NULL;
|
||||
// }
|
||||
|
||||
|
||||
@@ -2966,12 +2966,12 @@ void SQRNetworkManager_Vita::DefaultRequestCallback(SceNpMatching2ContextId id,
|
||||
// Set flag to indicate whether we were kicked for being out of room or not
|
||||
reqParam.optData.data[0] = isFull ? 1 : 0;
|
||||
reqParam.optData.len = 1;
|
||||
int ret = sceNpMatching2KickoutRoomMember(manager->m_matchingContext, &reqParam, nullptr, &manager->m_kickRequestId);
|
||||
int ret = sceNpMatching2KickoutRoomMember(manager->m_matchingContext, &reqParam, NULL, &manager->m_kickRequestId);
|
||||
app.DebugPrintf(CMinecraftApp::USER_RR,"sceNpMatching2KickoutRoomMember returns error 0x%x\n",ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pRoomMemberData->roomMemberDataInternal->roomMemberBinAttrInternal->data.ptr == nullptr)
|
||||
if(pRoomMemberData->roomMemberDataInternal->roomMemberBinAttrInternal->data.ptr == NULL)
|
||||
{
|
||||
// the host doesn't send out data, so this must be the host we're connecting to
|
||||
|
||||
@@ -3220,7 +3220,7 @@ void SQRNetworkManager_Vita::RoomEventCallback(SceNpMatching2ContextId id, SceNp
|
||||
reqParam.roomMemberBinAttrInternalNum = 1;
|
||||
reqParam.roomMemberBinAttrInternal = &binAttr;
|
||||
|
||||
int ret = sceNpMatching2SetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, nullptr, &manager->m_setRoomMemberInternalDataRequestId );
|
||||
int ret = sceNpMatching2SetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, NULL, &manager->m_setRoomMemberInternalDataRequestId );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3309,7 +3309,7 @@ void SQRNetworkManager_Vita::SignallingCallback(SceNpMatching2ContextId ctxId, S
|
||||
{
|
||||
SonyVoiceChat_Vita::disconnectRemoteConnection(pVoice);
|
||||
}
|
||||
if(peerMemberId == manager->m_hostMemberId || pVoice == nullptr) // MGH - added check for voice, as we sometime get here before m_hostMemberId has been filled in
|
||||
if(peerMemberId == manager->m_hostMemberId || pVoice == NULL) // MGH - added check for voice, as we sometime get here before m_hostMemberId has been filled in
|
||||
{
|
||||
// Host has left the game... so its all over for this client too. Finish everything up now, including deleting the server context which belongs to this gaming session
|
||||
// This also might be a response to a request to leave the game from our end too so don't need to do anything in that case
|
||||
@@ -3336,7 +3336,7 @@ void SQRNetworkManager_Vita::SignallingCallback(SceNpMatching2ContextId ctxId, S
|
||||
reqParam.attrId = attrs;
|
||||
reqParam.attrIdNum = 1;
|
||||
|
||||
sceNpMatching2GetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, nullptr, &manager->m_roomMemberDataRequestId);
|
||||
sceNpMatching2GetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, NULL, &manager->m_roomMemberDataRequestId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3349,7 +3349,7 @@ int SQRNetworkManager_Vita::BasicEventCallback(int event, int retCode, uint32_t
|
||||
PSVITA_STUBBED;
|
||||
// SQRNetworkManager_Vita *manager = (SQRNetworkManager_Vita *)arg;
|
||||
// // We aren't allowed to actually get the event directly from this callback, so send our own internal event to a thread dedicated to doing this
|
||||
// sceKernelTriggerUserEvent(m_basicEventQueue, sc_UserEventHandle, nullptr);
|
||||
// sceKernelTriggerUserEvent(m_basicEventQueue, sc_UserEventHandle, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3408,7 +3408,7 @@ void SQRNetworkManager_Vita::SysUtilCallback(uint64_t status, uint64_t param, vo
|
||||
// {
|
||||
// s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
// }
|
||||
// s_SignInCompleteCallbackFn = nullptr;
|
||||
// s_SignInCompleteCallbackFn = NULL;
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
@@ -3423,7 +3423,7 @@ void SQRNetworkManager_Vita::SysUtilCallback(uint64_t status, uint64_t param, vo
|
||||
// {
|
||||
// s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
// }
|
||||
// s_SignInCompleteCallbackFn = nullptr;
|
||||
// s_SignInCompleteCallbackFn = NULL;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@@ -3472,7 +3472,7 @@ void SQRNetworkManager_Vita::updateNetCheckDialog()
|
||||
if( s_SignInCompleteCallbackFn )
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,true,0);
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3488,7 +3488,7 @@ void SQRNetworkManager_Vita::updateNetCheckDialog()
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
}
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3611,7 +3611,7 @@ void SQRNetworkManager_Vita::RudpContextCallback(int ctx_id, int event_id, int e
|
||||
playerFrom = manager->m_aRoomSlotPlayers[0];
|
||||
playerTo = manager->GetPlayerFromRudpCtx( ctx_id );
|
||||
}
|
||||
if( ( playerFrom != nullptr ) && ( playerTo != nullptr ) )
|
||||
if( ( playerFrom != NULL ) && ( playerTo != NULL ) )
|
||||
{
|
||||
manager->m_listener->HandleDataReceived( playerFrom, playerTo, data, bytesRead );
|
||||
}
|
||||
@@ -3677,7 +3677,7 @@ void SQRNetworkManager_Vita::ServerContextValid_CreateRoom()
|
||||
{
|
||||
app.DebugPrintf("sceNpMatching2GetWorldInfoList\n");
|
||||
m_getWorldRequestId=0;
|
||||
ret = sceNpMatching2GetWorldInfoList( m_matchingContext, &reqParam, nullptr, &m_getWorldRequestId);
|
||||
ret = sceNpMatching2GetWorldInfoList( m_matchingContext, &reqParam, NULL, &m_getWorldRequestId);
|
||||
}
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -3706,7 +3706,7 @@ void SQRNetworkManager_Vita::ServerContextValid_JoinRoom()
|
||||
reqParam.roomMemberBinAttrInternalNum = 1;
|
||||
reqParam.roomMemberBinAttrInternal = &binAttr;
|
||||
|
||||
int ret = sceNpMatching2JoinRoom( m_matchingContext, &reqParam, nullptr, &m_joinRoomRequestId );
|
||||
int ret = sceNpMatching2JoinRoom( m_matchingContext, &reqParam, NULL, &m_joinRoomRequestId );
|
||||
if ( (ret < 0) || ForceErrorPoint(SNM_FORCE_ERROR_JOIN_ROOM) )
|
||||
{
|
||||
if( ret == SCE_NP_MATCHING2_SERVER_ERROR_NAT_TYPE_MISMATCH)
|
||||
@@ -3730,14 +3730,14 @@ const SceNpCommunicationSignature* SQRNetworkManager_Vita::GetSceNpCommsSig()
|
||||
const SceNpTitleId* SQRNetworkManager_Vita::GetSceNpTitleId()
|
||||
{
|
||||
PSVITA_STUBBED;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
// return &s_npTitleId;
|
||||
}
|
||||
|
||||
const SceNpTitleSecret* SQRNetworkManager_Vita::GetSceNpTitleSecret()
|
||||
{
|
||||
PSVITA_STUBBED;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
// return &s_npTitleSecret;
|
||||
}
|
||||
|
||||
@@ -3771,9 +3771,9 @@ void SQRNetworkManager_Vita::GetExtDataForRoom( SceNpMatching2RoomId roomId, voi
|
||||
static SceNpMatching2RoomId aRoomId[1];
|
||||
static SceNpMatching2AttributeId attr[1];
|
||||
|
||||
// All parameters will be nullptr if this is being called a second time, after creating a new matching context via one of the paths below (using GetMatchingContext).
|
||||
// nullptr parameters therefore basically represents an attempt to retry the last sceNpMatching2GetRoomDataExternalList
|
||||
if( extData != nullptr )
|
||||
// All parameters will be NULL if this is being called a second time, after creating a new matching context via one of the paths below (using GetMatchingContext).
|
||||
// NULL parameters therefore basically represents an attempt to retry the last sceNpMatching2GetRoomDataExternalList
|
||||
if( extData != NULL )
|
||||
{
|
||||
aRoomId[0] = roomId;
|
||||
attr[0] = SCE_NP_MATCHING2_ROOM_BIN_ATTR_EXTERNAL_1_ID;
|
||||
@@ -3797,14 +3797,14 @@ void SQRNetworkManager_Vita::GetExtDataForRoom( SceNpMatching2RoomId roomId, voi
|
||||
return;
|
||||
}
|
||||
|
||||
// Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with nullptr params) once done, so we can reattempt. Don't do anything more now.
|
||||
// Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with NULL params) once done, so we can reattempt. Don't do anything more now.
|
||||
if( m_state == SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT )
|
||||
{
|
||||
app.DebugPrintf("Having to recreate matching context, setting state to SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT\n");
|
||||
return;
|
||||
}
|
||||
|
||||
int ret = sceNpMatching2GetRoomDataExternalList( m_matchingContext, &reqParam, nullptr, &m_roomDataExternalListRequestId );
|
||||
int ret = sceNpMatching2GetRoomDataExternalList( m_matchingContext, &reqParam, NULL, &m_roomDataExternalListRequestId );
|
||||
|
||||
// If we hadn't properly detected that a matching context was unvailable, we might still get an error indicating that it is from the previous call. Handle similarly, but we need
|
||||
// to destroy the context first.
|
||||
@@ -3818,7 +3818,7 @@ void SQRNetworkManager_Vita::GetExtDataForRoom( SceNpMatching2RoomId roomId, voi
|
||||
m_FriendSessionUpdatedFn(false, m_pParamFriendSessionUpdated);
|
||||
return;
|
||||
};
|
||||
// Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with nullptr params) once done, so we can reattempt. Don't do anything more now.
|
||||
// Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with NULL params) once done, so we can reattempt. Don't do anything more now.
|
||||
if( m_state == SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT )
|
||||
{
|
||||
return;
|
||||
@@ -3957,7 +3957,7 @@ void SQRNetworkManager_Vita::AttemptPSNSignIn(int (*SignInCompleteCallbackFn)(vo
|
||||
{
|
||||
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
|
||||
}
|
||||
s_SignInCompleteCallbackFn = nullptr;
|
||||
s_SignInCompleteCallbackFn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4127,6 +4127,6 @@ SQRNetworkPlayer *SQRNetworkManager_Vita::GetPlayerByXuid(PlayerUID xuid)
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csRoomSyncData);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ private:
|
||||
void LocalDataSend(SQRNetworkPlayer *playerFrom, SQRNetworkPlayer *playerTo, const void *data, unsigned int dataSize);
|
||||
int GetSessionIndex(SQRNetworkPlayer *player);
|
||||
|
||||
bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = nullptr );
|
||||
bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = NULL );
|
||||
void RemoveRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int mask );
|
||||
void RemoveNetworkPlayers( int mask );
|
||||
void SetLocalPlayersAndSync();
|
||||
|
||||
@@ -10,22 +10,22 @@ bool SonyCommerce_Vita::m_bCommerceInitialised = false;
|
||||
// SceNpCommerce2SessionInfo SonyCommerce_Vita::m_sessionInfo;
|
||||
SonyCommerce_Vita::State SonyCommerce_Vita::m_state = e_state_noSession;
|
||||
int SonyCommerce_Vita::m_errorCode = 0;
|
||||
LPVOID SonyCommerce_Vita::m_callbackParam = nullptr;
|
||||
LPVOID SonyCommerce_Vita::m_callbackParam = NULL;
|
||||
|
||||
void* SonyCommerce_Vita::m_receiveBuffer = nullptr;
|
||||
void* SonyCommerce_Vita::m_receiveBuffer = NULL;
|
||||
SonyCommerce_Vita::Event SonyCommerce_Vita::m_event;
|
||||
std::queue<SonyCommerce_Vita::Message> SonyCommerce_Vita::m_messageQueue;
|
||||
std::vector<SonyCommerce_Vita::ProductInfo>* SonyCommerce_Vita::m_pProductInfoList = nullptr;
|
||||
SonyCommerce_Vita::ProductInfoDetailed* SonyCommerce_Vita::m_pProductInfoDetailed = nullptr;
|
||||
SonyCommerce_Vita::ProductInfo* SonyCommerce_Vita::m_pProductInfo = nullptr;
|
||||
std::vector<SonyCommerce_Vita::ProductInfo>* SonyCommerce_Vita::m_pProductInfoList = NULL;
|
||||
SonyCommerce_Vita::ProductInfoDetailed* SonyCommerce_Vita::m_pProductInfoDetailed = NULL;
|
||||
SonyCommerce_Vita::ProductInfo* SonyCommerce_Vita::m_pProductInfo = NULL;
|
||||
|
||||
SonyCommerce_Vita::CategoryInfo* SonyCommerce_Vita::m_pCategoryInfo = nullptr;
|
||||
const char* SonyCommerce_Vita::m_pProductID = nullptr;
|
||||
char* SonyCommerce_Vita::m_pCategoryID = nullptr;
|
||||
SonyCommerce_Vita::CategoryInfo* SonyCommerce_Vita::m_pCategoryInfo = NULL;
|
||||
const char* SonyCommerce_Vita::m_pProductID = NULL;
|
||||
char* SonyCommerce_Vita::m_pCategoryID = NULL;
|
||||
SonyCommerce_Vita::CheckoutInputParams SonyCommerce_Vita::m_checkoutInputParams;
|
||||
SonyCommerce_Vita::DownloadListInputParams SonyCommerce_Vita::m_downloadInputParams;
|
||||
|
||||
SonyCommerce_Vita::CallbackFunc SonyCommerce_Vita::m_callbackFunc = nullptr;
|
||||
SonyCommerce_Vita::CallbackFunc SonyCommerce_Vita::m_callbackFunc = NULL;
|
||||
// sys_memory_container_t SonyCommerce_Vita::m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID;
|
||||
bool SonyCommerce_Vita::m_bUpgradingTrial = false;
|
||||
|
||||
@@ -39,7 +39,7 @@ bool SonyCommerce_Vita::m_contextCreated=false; ///< npcommerce2 conte
|
||||
SonyCommerce_Vita::Phase SonyCommerce_Vita::m_currentPhase = e_phase_stopped; ///< Current commerce2 util
|
||||
// char SonyCommerce_Vita::m_commercebuffer[SCE_NP_COMMERCE2_RECV_BUF_SIZE];
|
||||
|
||||
C4JThread* SonyCommerce_Vita::m_tickThread = nullptr;
|
||||
C4JThread* SonyCommerce_Vita::m_tickThread = NULL;
|
||||
bool SonyCommerce_Vita::m_bLicenseChecked=false; // Check the trial/full license for the game
|
||||
bool SonyCommerce_Vita::m_bLicenseInstalled=false; // set to true when the licence has been downloaded and installed (but maybe not checked yet)
|
||||
bool SonyCommerce_Vita::m_bDownloadsPending=false; // set to true if there are any downloads happening in the background, so we check for them completing, and install when finished
|
||||
@@ -60,12 +60,12 @@ static bool s_showingPSStoreIcon = false;
|
||||
SonyCommerce_Vita::ProductInfoDetailed s_trialUpgradeProductInfoDetailed;
|
||||
void SonyCommerce_Vita::Delete()
|
||||
{
|
||||
m_pProductInfoList=nullptr;
|
||||
m_pProductInfoDetailed=nullptr;
|
||||
m_pProductInfo=nullptr;
|
||||
m_pCategoryInfo = nullptr;
|
||||
m_pProductID = nullptr;
|
||||
m_pCategoryID = nullptr;
|
||||
m_pProductInfoList=NULL;
|
||||
m_pProductInfoDetailed=NULL;
|
||||
m_pProductInfo=NULL;
|
||||
m_pCategoryInfo = NULL;
|
||||
m_pProductID = NULL;
|
||||
m_pCategoryID = NULL;
|
||||
}
|
||||
|
||||
void SonyCommerce_Vita::Init()
|
||||
@@ -108,7 +108,7 @@ bool SonyCommerce_Vita::LicenseChecked()
|
||||
|
||||
void SonyCommerce_Vita::CheckForTrialUpgradeKey()
|
||||
{
|
||||
StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, nullptr);
|
||||
StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, NULL);
|
||||
}
|
||||
|
||||
int SonyCommerce_Vita::Shutdown()
|
||||
@@ -163,7 +163,7 @@ void SonyCommerce_Vita::checkBackgroundDownloadStatus()
|
||||
// install the content
|
||||
if(bInstallContent)
|
||||
{
|
||||
InstallContent(InstallContentCallback, nullptr);
|
||||
InstallContent(InstallContentCallback, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -665,7 +665,7 @@ int SonyCommerce_Vita::createContext()
|
||||
// }
|
||||
//
|
||||
// // Create commerce2 context
|
||||
// ret = sceNpCommerce2CreateCtx(SCE_NP_COMMERCE2_VERSION, &npId, commerce2Handler, nullptr, &m_contextId);
|
||||
// ret = sceNpCommerce2CreateCtx(SCE_NP_COMMERCE2_VERSION, &npId, commerce2Handler, NULL, &m_contextId);
|
||||
// if (ret < 0)
|
||||
// {
|
||||
// app.DebugPrintf(4,"createContext sceNpCommerce2CreateCtx problem\n");
|
||||
@@ -771,7 +771,7 @@ void SonyCommerce_Vita::commerce2Handler( const sce::Toolkit::NP::Event& event)
|
||||
// if(ret == SCE_OK)
|
||||
// {
|
||||
copyCategoryInfo(m_pCategoryInfo, g_categoryInfo.get());
|
||||
m_pCategoryInfo = nullptr;
|
||||
m_pCategoryInfo = NULL;
|
||||
m_event = e_event_commerceGotCategoryInfo;
|
||||
// }
|
||||
|
||||
@@ -781,7 +781,7 @@ void SonyCommerce_Vita::commerce2Handler( const sce::Toolkit::NP::Event& event)
|
||||
case sce::Toolkit::NP::Event::UserEvent::commerceGotProductList:
|
||||
{
|
||||
copyProductList(m_pProductInfoList, g_productList.get());
|
||||
m_pProductInfoDetailed = nullptr;
|
||||
m_pProductInfoDetailed = NULL;
|
||||
m_event = e_event_commerceGotProductList;
|
||||
break;
|
||||
}
|
||||
@@ -791,12 +791,12 @@ void SonyCommerce_Vita::commerce2Handler( const sce::Toolkit::NP::Event& event)
|
||||
if(m_pProductInfoDetailed)
|
||||
{
|
||||
copyDetailedProductInfo(m_pProductInfoDetailed, g_detailedProductInfo.get());
|
||||
m_pProductInfoDetailed = nullptr;
|
||||
m_pProductInfoDetailed = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
copyAddDetailedProductInfo(m_pProductInfo, g_detailedProductInfo.get());
|
||||
m_pProductInfo = nullptr;
|
||||
m_pProductInfo = NULL;
|
||||
}
|
||||
m_event = e_event_commerceGotDetailedProductInfo;
|
||||
break;
|
||||
@@ -1180,7 +1180,7 @@ void SonyCommerce_Vita::processEvent()
|
||||
break;
|
||||
case e_event_commerceProductBrowseFinished:
|
||||
app.DebugPrintf(4,"e_event_commerceProductBrowseFinished succeeded: 0x%x\n", m_errorCode);
|
||||
if(m_callbackFunc!=nullptr)
|
||||
if(m_callbackFunc!=NULL)
|
||||
{
|
||||
runCallback();
|
||||
}
|
||||
@@ -1232,7 +1232,7 @@ void SonyCommerce_Vita::processEvent()
|
||||
ProfileManager.SetSysUIShowing(false);
|
||||
|
||||
// 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time
|
||||
if(m_callbackFunc!=nullptr)
|
||||
if(m_callbackFunc!=NULL)
|
||||
{
|
||||
// get the detailed product info again, to see if the purchase has happened or not
|
||||
EnterCriticalSection(&m_queueLock);
|
||||
@@ -1260,7 +1260,7 @@ void SonyCommerce_Vita::processEvent()
|
||||
ProfileManager.SetSysUIShowing(false);
|
||||
|
||||
// 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time
|
||||
if(m_callbackFunc!=nullptr)
|
||||
if(m_callbackFunc!=NULL)
|
||||
{
|
||||
runCallback();
|
||||
}
|
||||
@@ -1328,10 +1328,10 @@ void SonyCommerce_Vita::CreateSession( CallbackFunc cb, LPVOID lpParam )
|
||||
if(m_tickThread && (m_tickThread->isRunning() == false))
|
||||
{
|
||||
delete m_tickThread;
|
||||
m_tickThread = nullptr;
|
||||
m_tickThread = NULL;
|
||||
}
|
||||
if(m_tickThread == nullptr)
|
||||
m_tickThread = new C4JThread(TickLoop, nullptr, "SonyCommerce_Vita tick");
|
||||
if(m_tickThread == NULL)
|
||||
m_tickThread = new C4JThread(TickLoop, NULL, "SonyCommerce_Vita tick");
|
||||
if(m_tickThread->isRunning() == false)
|
||||
{
|
||||
m_currentPhase = e_phase_idle;
|
||||
@@ -1439,7 +1439,7 @@ void SonyCommerce_Vita::DownloadAlreadyPurchased_Game( CallbackFunc cb, LPVOID l
|
||||
|
||||
void SonyCommerce_Vita::InstallContent( CallbackFunc cb, LPVOID lpParam )
|
||||
{
|
||||
if(m_callbackFunc == nullptr && m_messageQueue.size() == 0) // wait till other processes have finished
|
||||
if(m_callbackFunc == NULL && m_messageQueue.size() == 0) // wait till other processes have finished
|
||||
{
|
||||
EnterCriticalSection(&m_queueLock);
|
||||
m_bInstallingContent = true;
|
||||
|
||||
@@ -121,14 +121,14 @@ class SonyCommerce_Vita : public SonyCommerce
|
||||
{
|
||||
assert(m_callbackFunc);
|
||||
CallbackFunc func = m_callbackFunc;
|
||||
m_callbackFunc = nullptr;
|
||||
m_callbackFunc = NULL;
|
||||
if(func)
|
||||
func(m_callbackParam, m_errorCode);
|
||||
m_errorCode = SCE_OK;
|
||||
}
|
||||
static void setCallback(CallbackFunc cb,LPVOID lpParam)
|
||||
{
|
||||
assert(m_callbackFunc == nullptr);
|
||||
assert(m_callbackFunc == NULL);
|
||||
m_callbackFunc = cb;
|
||||
m_callbackParam = lpParam;
|
||||
}
|
||||
|
||||
@@ -131,10 +131,10 @@ int SonyHttp_Vita::sslCallback(SceUInt32 verifyErr, SceSslCert * const sslCert[]
|
||||
(void)userArg;
|
||||
|
||||
app.DebugPrintf("Ssl callback:\n");
|
||||
app.DebugPrintf("\tbase tmpl[%x]\n", static_cast<SceInt32>(userArg));
|
||||
app.DebugPrintf("\tbase tmpl[%x]\n", (SceInt32)userArg);
|
||||
|
||||
if (verifyErr != 0){
|
||||
printSslError(static_cast<SceInt32>(SCE_HTTPS_ERROR_CERT), verifyErr);
|
||||
printSslError((SceInt32)SCE_HTTPS_ERROR_CERT, verifyErr);
|
||||
}
|
||||
for (i = 0; i < certNum; i++){
|
||||
printSslCertInfo(sslCert[i]);
|
||||
@@ -192,7 +192,7 @@ bool SonyHttp_Vita::http_get(const char *targetUrl, void** ppOutData, int* pData
|
||||
}
|
||||
|
||||
/* Register SSL callback */
|
||||
ret = sceHttpsSetSslCallback(tmplId, sslCallback, static_cast<void *>(&tmplId));
|
||||
ret = sceHttpsSetSslCallback(tmplId, sslCallback, (void*)&tmplId);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpsSetSslCallback() error: 0x%08X\n", ret);
|
||||
@@ -215,7 +215,7 @@ bool SonyHttp_Vita::http_get(const char *targetUrl, void** ppOutData, int* pData
|
||||
}
|
||||
reqId = ret;
|
||||
|
||||
ret = sceHttpSendRequest(reqId, nullptr, 0);
|
||||
ret = sceHttpSendRequest(reqId, NULL, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpSendRequest() error: 0x%08X\n", ret);
|
||||
|
||||
@@ -26,7 +26,7 @@ static SceRemoteStorageData s_getDataOutput;
|
||||
|
||||
void SonyRemoteStorage_Vita::staticInternalCallback(const SceRemoteStorageEvent event, int32_t retCode, void * userData)
|
||||
{
|
||||
static_cast<SonyRemoteStorage_Vita *>(userData)->internalCallback(event, retCode);
|
||||
((SonyRemoteStorage_Vita*)userData)->internalCallback(event, retCode);
|
||||
}
|
||||
|
||||
void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, int32_t retCode)
|
||||
@@ -218,7 +218,7 @@ bool SonyRemoteStorage_Vita::init(CallbackFunc cb, LPVOID lpParam)
|
||||
params.timeout.receiveMs = 120 * 1000; //120 seconds is the default
|
||||
params.timeout.sendMs = 120 * 1000; //120 seconds is the default
|
||||
params.pool.memPoolSize = 7 * 1024 * 1024;
|
||||
if(m_memPoolBuffer == nullptr)
|
||||
if(m_memPoolBuffer == NULL)
|
||||
m_memPoolBuffer = malloc(params.pool.memPoolSize);
|
||||
params.pool.memPoolBuffer = m_memPoolBuffer;
|
||||
|
||||
@@ -298,8 +298,8 @@ bool SonyRemoteStorage_Vita::setDataInternal()
|
||||
|
||||
snprintf(m_saveFilename, sizeof(m_saveFilename), "%s:%s/GAMEDATA.bin", "savedata0", m_setDataSaveInfo->UTF8SaveFilename);
|
||||
|
||||
SceFiosSize outSize = sceFiosFileGetSizeSync(nullptr, m_saveFilename);
|
||||
m_uploadSaveSize = static_cast<int>(outSize);
|
||||
SceFiosSize outSize = sceFiosFileGetSizeSync(NULL, m_saveFilename);
|
||||
m_uploadSaveSize = (int)outSize;
|
||||
|
||||
strcpy(m_saveFileDesc, m_setDataSaveInfo->UTF8SaveTitle);
|
||||
m_status = e_setDataInProgress;
|
||||
|
||||
@@ -67,7 +67,7 @@ void LoadPCMVoiceData()
|
||||
{
|
||||
char filename[64];
|
||||
sprintf(filename, "voice%d.pcm", i+1);
|
||||
HANDLE file = CreateFile(filename, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
HANDLE file = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
DWORD dwHigh=0;
|
||||
g_loadedPCMVoiceDataSizes[i] = GetFileSize(file,&dwHigh);
|
||||
|
||||
@@ -75,7 +75,7 @@ void LoadPCMVoiceData()
|
||||
{
|
||||
g_loadedPCMVoiceData[i] = new char[g_loadedPCMVoiceDataSizes[i]];
|
||||
DWORD bytesRead;
|
||||
BOOL bSuccess = ReadFile(file, g_loadedPCMVoiceData[i], g_loadedPCMVoiceDataSizes[i], &bytesRead, nullptr);
|
||||
BOOL bSuccess = ReadFile(file, g_loadedPCMVoiceData[i], g_loadedPCMVoiceDataSizes[i], &bytesRead, NULL);
|
||||
assert(bSuccess);
|
||||
}
|
||||
g_loadedPCMVoiceDataPos[i] = 0;
|
||||
@@ -285,7 +285,7 @@ void SQRVoiceConnection::readRemoteData()
|
||||
if( dataSize > 0 )
|
||||
{
|
||||
VoicePacket packet;
|
||||
unsigned int bytesRead = sceRudpRead( m_rudpCtx, &packet, dataSize, 0, nullptr );
|
||||
unsigned int bytesRead = sceRudpRead( m_rudpCtx, &packet, dataSize, 0, NULL );
|
||||
unsigned int writeSize;
|
||||
if( bytesRead > 0 )
|
||||
{
|
||||
@@ -378,7 +378,7 @@ uint32_t lastReadFrameCnt = 0;
|
||||
|
||||
void PrintAllOutputVoiceStates( std::vector<SQRVoiceConnection*>& connections)
|
||||
{
|
||||
for(size_t rIdx=0;rIdx<connections.size(); rIdx++)
|
||||
for(int rIdx=0;rIdx<connections.size(); rIdx++)
|
||||
{
|
||||
SQRVoiceConnection* pVoice = connections[rIdx];
|
||||
SceVoiceBasePortInfo portInfo;
|
||||
@@ -470,7 +470,7 @@ void SonyVoiceChat_Vita::sendAllVoiceData()
|
||||
if(m_localVoiceDevices[i].isValid())
|
||||
{
|
||||
bool bChatRestricted = false;
|
||||
ProfileManager.GetChatAndContentRestrictions(i,true,&bChatRestricted,nullptr,nullptr);
|
||||
ProfileManager.GetChatAndContentRestrictions(i,true,&bChatRestricted,NULL,NULL);
|
||||
|
||||
if(bChatRestricted)
|
||||
{
|
||||
@@ -565,7 +565,7 @@ void SonyVoiceChat_Vita::sendAllVoiceData()
|
||||
EnterCriticalSection(&m_csRemoteConnections);
|
||||
|
||||
// send this packet out to all our remote connections
|
||||
for(size_t rIdx=0;rIdx<m_remoteConnections.size(); rIdx++)
|
||||
for(int rIdx=0;rIdx<m_remoteConnections.size(); rIdx++)
|
||||
{
|
||||
SQRVoiceConnection* pVoice = m_remoteConnections[rIdx];
|
||||
if(pVoice->m_bConnected)
|
||||
@@ -668,7 +668,7 @@ void SonyVoiceChat_Vita::tick()
|
||||
|
||||
EnterCriticalSection(&m_csRemoteConnections);
|
||||
|
||||
for(size_t i=m_remoteConnections.size()-1;i>=0;i--)
|
||||
for(int i=m_remoteConnections.size()-1;i>=0;i--)
|
||||
{
|
||||
if(m_remoteConnections[i]->m_bFlaggedForShutdown)
|
||||
{
|
||||
@@ -911,7 +911,7 @@ void SonyVoiceChat_Vita::initLocalPlayer(int playerIndex)
|
||||
if(m_localVoiceDevices[playerIndex].isValid() == false)
|
||||
{
|
||||
bool chatRestricted = false;
|
||||
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
|
||||
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
|
||||
|
||||
// create all device ports required
|
||||
m_localVoiceDevices[playerIndex].init(chatRestricted);
|
||||
@@ -948,7 +948,7 @@ SQRVoiceConnection* SonyVoiceChat_Vita::GetVoiceConnectionFromRudpCtx( int RudpC
|
||||
if(m_remoteConnections[i]->m_rudpCtx == RudpCtx)
|
||||
return m_remoteConnections[i];
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void SonyVoiceChat_Vita::connectPlayerToAll( int playerIndex )
|
||||
@@ -973,7 +973,7 @@ SQRVoiceConnection* SonyVoiceChat_Vita::getVoiceConnectionFromRoomMemberID( SceN
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void SonyVoiceChat_Vita::disconnectLocalPlayer( int localIdx )
|
||||
@@ -998,7 +998,7 @@ void SonyVoiceChat_Vita::disconnectLocalPlayer( int localIdx )
|
||||
|
||||
if(m_numLocalDevicesConnected == 0) // no more local players, kill all the remote connections
|
||||
{
|
||||
for(size_t i=0;i<m_remoteConnections.size();i++)
|
||||
for(int i=0;i<m_remoteConnections.size();i++)
|
||||
{
|
||||
delete m_remoteConnections[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user