Fixed an intermittent bug when gathering profile names (Player Names) for use in the Hello Packet destine for the server.
This commit is contained in:
@@ -96,15 +96,18 @@ void NetworkSyncManager::PostStartUp(CString ServerIP)
|
|||||||
Write1(m_packet, (uint8_t) ctr);
|
Write1(m_packet, (uint8_t) ctr);
|
||||||
|
|
||||||
vector<CString> profileNames;
|
vector<CString> profileNames;
|
||||||
|
profileNames.push_back("[No Prof]"); //Make a no profile option
|
||||||
PROFILEMAN->GetLocalProfileNames(profileNames);
|
PROFILEMAN->GetLocalProfileNames(profileNames);
|
||||||
|
|
||||||
FOREACH_PlayerNumber(pn)
|
FOREACH_PlayerNumber(pn)
|
||||||
{
|
{
|
||||||
int localID = atoi(PREFSMAN->m_sDefaultLocalProfileID[pn])-1;
|
int localID = atoi(PREFSMAN->m_sDefaultLocalProfileID[pn]);
|
||||||
if (localID >= 0 && localID < int(profileNames.size()))
|
/* If the length of the m_sDefaultLocalProfileID[pn] is greater than 0
|
||||||
WriteNT(m_packet, profileNames[localID]);
|
there must be a profile there. */
|
||||||
else
|
if (PREFSMAN->m_sDefaultLocalProfileID[pn].length() > 0)
|
||||||
WriteNT(m_packet, "[No Prof]");
|
WriteNT(m_packet, profileNames[localID+1]);
|
||||||
|
else
|
||||||
|
WriteNT(m_packet, profileNames[localID]);
|
||||||
}
|
}
|
||||||
|
|
||||||
NetPlayerClient->SendPack((char*)m_packet.Data,m_packet.Position);
|
NetPlayerClient->SendPack((char*)m_packet.Data,m_packet.Position);
|
||||||
|
|||||||
Reference in New Issue
Block a user