1
0
forked from mirrors/0ad

Fixed 3+ player games. The problem was the FinalizeSlots method in GameAttributes, which confused player and slot IDs by deleting nonexistent slots/players from the array. Since this doesn't seem particularly useful (and is even undesirable for scenarios where some players *want* to be the last slot and to leave others empty), I commented it out rather than having the code incur the extra complexity of supporting renumberings.

This was SVN commit r6228.
This commit is contained in:
Matei
2008-07-14 06:40:05 +00:00
parent 8161197f0e
commit 0cbb38bfd9
4 changed files with 22 additions and 4 deletions
+6 -3
View File
@@ -355,9 +355,11 @@ bool CNetClient::OnAuthenticate( void* pContext, CFsmEvent* pEvent )
CAuthenticateResultMessage* pMessage =( CAuthenticateResultMessage* )pEvent->GetParamRef();
if ( !pMessage ) return true;
LOG(CLogger::Error, LOG_CAT_NET, "CNetClient::OnAuthenticate(): Authentication result: %s", pMessage->m_Message.c_str() );
LOG(CLogger::Error, LOG_CAT_NET, "CNetClient::OnAuthenticate(): Authentication result: %ls", pMessage->m_Message.c_str() );
pSession->SetID( pMessage->m_SessionID );
LOG(CLogger::Error, LOG_CAT_NET, "CNetClient::OnAuthenticate(): My session ID is %d", pMessage->m_SessionID);
}
return true;
@@ -415,8 +417,9 @@ bool CNetClient::OnPreGame( void* pContext, CFsmEvent* pEvent )
// FIXME Validate slot id to prevent us from going boom
CPlayerSlot* pSlot = pClient->m_pGameAttributes->GetSlot( pMessage->m_SlotID );
if ( pSlot == pClient->m_pLocalPlayerSlot )
if ( pSlot == pClient->m_pLocalPlayerSlot ) {
pClient->m_pLocalPlayerSlot = NULL;
}
switch ( pMessage->m_Assignment )
{
@@ -426,8 +429,8 @@ bool CNetClient::OnPreGame( void* pContext, CFsmEvent* pEvent )
if ( pSession->GetID() == pMessage->m_SessionID )
{
pClient->m_pLocalPlayerSlot = pSlot;
pSlot->AssignToSessionID( pMessage->m_SessionID );
}
pSlot->AssignToSessionID( pMessage->m_SessionID );
}
break;