From f7c9a5191da1edc83c673c9d363eb79c7b0c9aed Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 14 Aug 2004 05:29:03 +0000 Subject: [PATCH] Fix warning, cleanup a little. --- stepmania/src/NetworkSyncManager.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index bd291c236a..7d66c9886a 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -89,22 +89,22 @@ void NetworkSyncManager::PostStartUp(CString ServerIP) ClearPacket(m_packet); - Write1(m_packet,2); //Hello Packet + Write1(m_packet, 2); //Hello Packet - Write1(m_packet,NETPROTOCOLVERSION); + Write1(m_packet, NETPROTOCOLVERSION); int ctr = 2 * 16 + 0; Write1(m_packet, (uint8_t) ctr); - vector profileNames; + vector profileNames; PROFILEMAN->GetLocalProfileNames(profileNames); FOREACH_PlayerNumber(pn) { - int localID=atoi(PREFSMAN->m_sDefaultLocalProfileID[pn])-1; - if ((localID>=0)&&(localIDm_sDefaultLocalProfileID[pn])-1; + if (localID >= 0 && localID < int(profileNames.size())) + WriteNT(m_packet, profileNames[localID]); else - WriteNT(m_packet,"[No Profile Set]"); + WriteNT(m_packet, "[No Profile Set]"); } NetPlayerClient->SendPack((char*)m_packet.Data,m_packet.Position); @@ -115,8 +115,8 @@ void NetworkSyncManager::PostStartUp(CString ServerIP) //Move mode to blocking in order to give CPU back to the //system, and not wait. - bool dontExit=true; - NetPlayerClient->blocking=true; + bool dontExit = true; + NetPlayerClient->blocking = true; while (dontExit) { ClearPacket(m_packet); @@ -127,7 +127,7 @@ void NetworkSyncManager::PostStartUp(CString ServerIP) //Only allow passing on handshake. //Otherwise scoreboard updates and such will confuse us. } - NetPlayerClient->blocking=false; + NetPlayerClient->blocking = false; m_ServerVersion = Read1(m_packet); m_ServerName = ReadNT(m_packet);