Integrate C++11 branch into 5_1-new
This commit is contained in:
+14
-14
@@ -67,8 +67,8 @@ int NetworkSyncManager::GetSMOnlineSalt()
|
||||
static LocalizedString INITIALIZING_CLIENT_NETWORK ( "NetworkSyncManager", "Initializing Client Network..." );
|
||||
NetworkSyncManager::NetworkSyncManager( LoadingWindow *ld )
|
||||
{
|
||||
LANserver = NULL; //So we know if it has been created yet
|
||||
BroadcastReception = NULL;
|
||||
LANserver = nullptr; //So we know if it has been created yet
|
||||
BroadcastReception = nullptr;
|
||||
|
||||
ld->SetText( INITIALIZING_CLIENT_NETWORK );
|
||||
NetPlayerClient = new EzSockets;
|
||||
@@ -384,11 +384,11 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
|
||||
Steps * tSteps;
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
ctr = uint8_t(ctr+tSteps->GetMeter()*16);
|
||||
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_2];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
ctr = uint8_t( ctr+tSteps->GetMeter() );
|
||||
|
||||
m_packet.Write1( ctr );
|
||||
@@ -396,11 +396,11 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
ctr=0;
|
||||
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
ctr = uint8_t( ctr + (int)tSteps->GetDifficulty()*16 );
|
||||
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_2];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
ctr = uint8_t( ctr + (int)tSteps->GetDifficulty() );
|
||||
|
||||
m_packet.Write1( ctr );
|
||||
@@ -409,7 +409,7 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
ctr = char( position*16 );
|
||||
m_packet.Write1( ctr );
|
||||
|
||||
if( GAMESTATE->m_pCurSong != NULL )
|
||||
if( GAMESTATE->m_pCurSong != nullptr )
|
||||
{
|
||||
m_packet.WriteNT( GAMESTATE->m_pCurSong->m_sMainTitle );
|
||||
m_packet.WriteNT( GAMESTATE->m_pCurSong->m_sSubTitle );
|
||||
@@ -422,7 +422,7 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
m_packet.WriteNT( "" );
|
||||
}
|
||||
|
||||
if( GAMESTATE->m_pCurCourse != NULL )
|
||||
if( GAMESTATE->m_pCurCourse != nullptr )
|
||||
m_packet.WriteNT( GAMESTATE->m_pCurCourse->GetDisplayFullTitle() );
|
||||
else
|
||||
m_packet.WriteNT( RString() );
|
||||
@@ -437,12 +437,12 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
m_packet.WriteNT( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetCurrent().GetString() );
|
||||
}
|
||||
for (int i=0; i<2-players; ++i)
|
||||
m_packet.WriteNT(""); //Write a NULL if no player
|
||||
m_packet.WriteNT(""); //Write a nullptr if no player
|
||||
|
||||
//Send song hash/chartkey
|
||||
if (m_ServerVersion >= 129) {
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
if (tSteps != NULL && GAMESTATE->IsPlayerEnabled(PLAYER_1)) {
|
||||
if (tSteps != nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_1)) {
|
||||
m_packet.WriteNT(tSteps->GetChartKey());
|
||||
}
|
||||
else
|
||||
@@ -451,7 +451,7 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
}
|
||||
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_2];
|
||||
if (tSteps != NULL && GAMESTATE->IsPlayerEnabled(PLAYER_2)) {
|
||||
if (tSteps != nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_2)) {
|
||||
m_packet.WriteNT(tSteps->GetChartKey());
|
||||
}
|
||||
else
|
||||
@@ -998,7 +998,7 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
{
|
||||
// \r\n\r\n = Separator from HTTP Header and Body
|
||||
char* cBodyStart = strstr(cBuffer, "\r\n\r\n");
|
||||
if( cBodyStart != NULL )
|
||||
if( cBodyStart != nullptr )
|
||||
{
|
||||
// Get the HTTP Header only
|
||||
int iHeaderLength = cBodyStart - cBuffer;
|
||||
@@ -1032,13 +1032,13 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
if( 0 == strcasecmp(sFieldName,"X-SM-Build") )
|
||||
{
|
||||
bSuccess = true;
|
||||
uCurrentSMBuild = strtoul( sFieldValue, NULL, 10 );
|
||||
uCurrentSMBuild = strtoul( sFieldValue, nullptr, 10 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // if( svResponse[0].find("200") != RString::npos )
|
||||
} // if( cBodyStart != NULL )
|
||||
} // if( cBodyStart != nullptr )
|
||||
} // if( iBytes )
|
||||
SAFE_DELETE( cBuffer );
|
||||
} // if( socket->connect(sHost, uPort) )
|
||||
|
||||
Reference in New Issue
Block a user