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:
@@ -87,7 +87,7 @@ void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPl
|
||||
bool createFakeSocket = false;
|
||||
bool localPlayer = false;
|
||||
|
||||
NetworkPlayerDurango *networkPlayer = static_cast<NetworkPlayerDurango *>(addNetworkPlayer(pDQRPlayer));
|
||||
NetworkPlayerDurango *networkPlayer = (NetworkPlayerDurango *)addNetworkPlayer(pDQRPlayer);
|
||||
|
||||
// Request full display name for this player
|
||||
m_pDQRNet->RequestDisplayName(pDQRPlayer);
|
||||
@@ -166,7 +166,7 @@ void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPl
|
||||
|
||||
for( int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if(playerChangedCallback[idx] != nullptr)
|
||||
if(playerChangedCallback[idx] != NULL)
|
||||
playerChangedCallback[idx]( playerChangedCallbackParam[idx], networkPlayer, false );
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPl
|
||||
int localPlayerCount = 0;
|
||||
for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if( m_pDQRNet->GetLocalPlayerByUserIndex(idx) != nullptr ) ++localPlayerCount;
|
||||
if( m_pDQRNet->GetLocalPlayerByUserIndex(idx) != NULL ) ++localPlayerCount;
|
||||
}
|
||||
|
||||
float appTime = app.getAppTime();
|
||||
@@ -198,7 +198,7 @@ void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRP
|
||||
{
|
||||
// Get our wrapper object associated with this player.
|
||||
Socket *socket = networkPlayer->GetSocket();
|
||||
if( socket != nullptr )
|
||||
if( socket != NULL )
|
||||
{
|
||||
// If we are in game then remove this player from the game as well.
|
||||
// We may get here either from the player requesting to exit the game,
|
||||
@@ -214,14 +214,14 @@ void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRP
|
||||
// We need this as long as the game server still needs to communicate with the player
|
||||
//delete socket;
|
||||
|
||||
networkPlayer->SetSocket( nullptr );
|
||||
networkPlayer->SetSocket( NULL );
|
||||
}
|
||||
|
||||
if( m_pDQRNet->IsHost() && !m_bHostChanged )
|
||||
{
|
||||
if( isSystemPrimaryPlayer(pDQRPlayer) )
|
||||
{
|
||||
DQRNetworkPlayer *pNewDQRPrimaryPlayer = nullptr;
|
||||
DQRNetworkPlayer *pNewDQRPrimaryPlayer = NULL;
|
||||
for(unsigned int i = 0; i < m_pDQRNet->GetPlayerCount(); ++i )
|
||||
{
|
||||
DQRNetworkPlayer *pDQRPlayer2 = m_pDQRNet->GetPlayerByIndex( i );
|
||||
@@ -238,7 +238,7 @@ void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRP
|
||||
m_machineDQRPrimaryPlayers.erase( it );
|
||||
}
|
||||
|
||||
if( pNewDQRPrimaryPlayer != nullptr )
|
||||
if( pNewDQRPrimaryPlayer != NULL )
|
||||
m_machineDQRPrimaryPlayers.push_back( pNewDQRPrimaryPlayer );
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRP
|
||||
|
||||
for( int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if(playerChangedCallback[idx] != nullptr)
|
||||
if(playerChangedCallback[idx] != NULL)
|
||||
playerChangedCallback[idx]( playerChangedCallbackParam[idx], networkPlayer, true );
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRP
|
||||
int localPlayerCount = 0;
|
||||
for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if( m_pDQRNet->GetLocalPlayerByUserIndex(idx) != nullptr ) ++localPlayerCount;
|
||||
if( m_pDQRNet->GetLocalPlayerByUserIndex(idx) != NULL ) ++localPlayerCount;
|
||||
}
|
||||
|
||||
float appTime = app.getAppTime();
|
||||
@@ -289,7 +289,7 @@ void CPlatformNetworkManagerDurango::HandleDataReceived(DQRNetworkPlayer *player
|
||||
INetworkPlayer *pPlayerFrom = getNetworkPlayer(playerFrom);
|
||||
Socket *socket = pPlayerFrom->GetSocket();
|
||||
|
||||
if(socket != nullptr)
|
||||
if(socket != NULL)
|
||||
socket->pushDataToQueue(data, dataSize, false);
|
||||
}
|
||||
else
|
||||
@@ -298,7 +298,7 @@ void CPlatformNetworkManagerDurango::HandleDataReceived(DQRNetworkPlayer *player
|
||||
INetworkPlayer *pPlayerTo = getNetworkPlayer(playerTo);
|
||||
Socket *socket = pPlayerTo->GetSocket();
|
||||
//app.DebugPrintf( "Pushing data into read queue for user \"%ls\"\n", apPlayersTo[dwPlayer]->GetGamertag());
|
||||
if(socket != nullptr)
|
||||
if(socket != NULL)
|
||||
socket->pushDataToQueue(data, dataSize);
|
||||
}
|
||||
}
|
||||
@@ -319,7 +319,7 @@ bool CPlatformNetworkManagerDurango::Initialise(CGameNetworkManager *pGameNetwor
|
||||
g_pPlatformNetworkManager = this;
|
||||
for( int i = 0; i < XUSER_MAX_COUNT; i++ )
|
||||
{
|
||||
playerChangedCallback[ i ] = nullptr;
|
||||
playerChangedCallback[ i ] = NULL;
|
||||
}
|
||||
|
||||
m_bLeavingGame = false;
|
||||
@@ -330,14 +330,14 @@ bool CPlatformNetworkManagerDurango::Initialise(CGameNetworkManager *pGameNetwor
|
||||
m_bSearchPending = false;
|
||||
|
||||
m_bIsOfflineGame = false;
|
||||
m_pSearchParam = nullptr;
|
||||
m_SessionsUpdatedCallback = nullptr;
|
||||
m_pSearchParam = NULL;
|
||||
m_SessionsUpdatedCallback = NULL;
|
||||
|
||||
m_searchResultsCount = 0;
|
||||
m_lastSearchStartTime = 0;
|
||||
|
||||
// The results that will be filled in with the current search
|
||||
m_pSearchResults = nullptr;
|
||||
m_pSearchResults = NULL;
|
||||
|
||||
Windows::Networking::Connectivity::NetworkInformation::NetworkStatusChanged += ref new Windows::Networking::Connectivity::NetworkStatusChangedEventHandler( []( Platform::Object^ pxObject )
|
||||
{
|
||||
@@ -585,8 +585,8 @@ void CPlatformNetworkManagerDurango::UnRegisterPlayerChangedCallback(int iPad, v
|
||||
{
|
||||
if(playerChangedCallbackParam[iPad] == callbackParam)
|
||||
{
|
||||
playerChangedCallback[iPad] = nullptr;
|
||||
playerChangedCallbackParam[iPad] = nullptr;
|
||||
playerChangedCallback[iPad] = NULL;
|
||||
playerChangedCallbackParam[iPad] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -613,12 +613,12 @@ bool CPlatformNetworkManagerDurango::_RunNetworkGame()
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerDurango::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= nullptr*/)
|
||||
void CPlatformNetworkManagerDurango::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/)
|
||||
{
|
||||
if( this->m_bLeavingGame )
|
||||
return;
|
||||
|
||||
if( GetHostPlayer() == nullptr )
|
||||
if( GetHostPlayer() == NULL )
|
||||
return;
|
||||
|
||||
m_hostGameSessionData.m_uiGameHostSettings = app.GetGameHostOption(eGameHostOption_All);
|
||||
@@ -628,18 +628,18 @@ void CPlatformNetworkManagerDurango::UpdateAndSetGameSessionData(INetworkPlayer
|
||||
|
||||
int CPlatformNetworkManagerDurango::RemovePlayerOnSocketClosedThreadProc( void* lpParam )
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = static_cast<INetworkPlayer *>(lpParam);
|
||||
INetworkPlayer *pNetworkPlayer = (INetworkPlayer *)lpParam;
|
||||
|
||||
Socket *socket = pNetworkPlayer->GetSocket();
|
||||
|
||||
if( socket != nullptr )
|
||||
if( socket != NULL )
|
||||
{
|
||||
//printf("Waiting for socket closed event\n");
|
||||
socket->m_socketClosedEvent->WaitForSignal(INFINITE);
|
||||
|
||||
//printf("Socket closed event has fired\n");
|
||||
// 4J Stu - Clear our reference to this socket
|
||||
pNetworkPlayer->SetSocket( nullptr );
|
||||
pNetworkPlayer->SetSocket( NULL );
|
||||
delete socket;
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ void CPlatformNetworkManagerDurango::SystemFlagReset()
|
||||
void CPlatformNetworkManagerDurango::SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index)
|
||||
{
|
||||
if( ( index < 0 ) || ( index >= m_flagIndexSize ) ) return;
|
||||
if( pNetworkPlayer == nullptr ) return;
|
||||
if( pNetworkPlayer == NULL ) return;
|
||||
|
||||
for( unsigned int i = 0; i < m_playerFlags.size(); i++ )
|
||||
{
|
||||
@@ -728,7 +728,7 @@ void CPlatformNetworkManagerDurango::SystemFlagSet(INetworkPlayer *pNetworkPlaye
|
||||
bool CPlatformNetworkManagerDurango::SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index)
|
||||
{
|
||||
if( ( index < 0 ) || ( index >= m_flagIndexSize ) ) return false;
|
||||
if( pNetworkPlayer == nullptr )
|
||||
if( pNetworkPlayer == NULL )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -769,7 +769,7 @@ void CPlatformNetworkManagerDurango::TickSearch()
|
||||
}
|
||||
m_bSearchPending = false;
|
||||
|
||||
if( m_SessionsUpdatedCallback != nullptr ) m_SessionsUpdatedCallback(m_pSearchParam);
|
||||
if( m_SessionsUpdatedCallback != NULL ) m_SessionsUpdatedCallback(m_pSearchParam);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -777,7 +777,7 @@ void CPlatformNetworkManagerDurango::TickSearch()
|
||||
if( !m_pDQRNet->FriendPartyManagerIsBusy() )
|
||||
{
|
||||
// Don't start searches unless we have registered a callback
|
||||
if( m_SessionsUpdatedCallback != nullptr && (m_lastSearchStartTime + MINECRAFT_DURANGO_PARTY_SEARCH_DELAY_MILLISECONDS) < GetTickCount() )
|
||||
if( m_SessionsUpdatedCallback != NULL && (m_lastSearchStartTime + MINECRAFT_DURANGO_PARTY_SEARCH_DELAY_MILLISECONDS) < GetTickCount() )
|
||||
{
|
||||
if( m_pDQRNet->FriendPartyManagerSearch() );
|
||||
{
|
||||
@@ -794,13 +794,13 @@ vector<FriendSessionInfo *> *CPlatformNetworkManagerDurango::GetSessionList(int
|
||||
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>();
|
||||
for( int i = 0; i < m_searchResultsCount; i++ )
|
||||
{
|
||||
GameSessionData *gameSessionData = static_cast<GameSessionData *>(m_pSearchResults[i].m_extData);
|
||||
GameSessionData *gameSessionData = (GameSessionData *)m_pSearchResults[i].m_extData;
|
||||
if( ( gameSessionData->netVersion == MINECRAFT_NET_VERSION ) &&
|
||||
( gameSessionData->isReadyToJoin ) )
|
||||
{
|
||||
FriendSessionInfo *session = new FriendSessionInfo();
|
||||
session->searchResult = m_pSearchResults[i];
|
||||
session->searchResult.m_extData = nullptr; // We have another copy of the GameSessionData, so don't need to make another copy of this here
|
||||
session->searchResult.m_extData = NULL; // We have another copy of the GameSessionData, so don't need to make another copy of this here
|
||||
session->displayLabelLength = session->searchResult.m_playerNames[0].size();
|
||||
session->displayLabel = new wchar_t[ session->displayLabelLength + 1 ];
|
||||
memcpy(&session->data, gameSessionData, sizeof(GameSessionData));
|
||||
@@ -832,7 +832,7 @@ void CPlatformNetworkManagerDurango::ForceFriendsSessionRefresh()
|
||||
m_lastSearchStartTime = 0;
|
||||
m_searchResultsCount = 0;
|
||||
delete [] m_pSearchResults;
|
||||
m_pSearchResults = nullptr;
|
||||
m_pSearchResults = NULL;
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerDurango::addNetworkPlayer(DQRNetworkPlayer *pDQRPlayer)
|
||||
@@ -858,7 +858,7 @@ void CPlatformNetworkManagerDurango::removeNetworkPlayer(DQRNetworkPlayer *pDQRP
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerDurango::getNetworkPlayer(DQRNetworkPlayer *pDQRPlayer)
|
||||
{
|
||||
return pDQRPlayer ? (INetworkPlayer *)(pDQRPlayer->GetCustomDataValue()) : nullptr;
|
||||
return pDQRPlayer ? (INetworkPlayer *)(pDQRPlayer->GetCustomDataValue()) : NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user