1
0
forked from mirrors/0ad

Fix missing returns after disconnect in 95179c5e46.

Patch by @elexis.

The package sent in fa85527baf / #2420 plus this missing return causes the NetServerTurnManager
to be stalled forever if a client succeeds to send this package on disconnect.

In NotifyFinishedClientCommands, Disconnect calls OnDisconnect calls UninitialiseClient calls m_ClientsData.erase,
but then m_ClientsData[client].readyTurn = turn; reinserts the disconnected client, making the turnmanager wait forever for the disconnected client.

refs https://wildfiregames.com/forum/topic/134742-bug-game-incredibly-slowfreeze-at-start-because-because-of-1-player/
This commit is contained in:
elexis
2025-10-08 19:03:57 +02:00
committed by Vladislav Belov
parent 893f192eaa
commit 2ccd10e566
+2
View File
@@ -69,6 +69,7 @@ void CNetServerTurnManager::NotifyFinishedClientCommands(CNetServerSession& sess
m_ClientsData[client].readyTurn + 1);
session.Disconnect(NDR_INCORRECT_READY_TURN_COMMANDS);
return;
}
m_ClientsData[client].readyTurn = turn;
@@ -124,6 +125,7 @@ void CNetServerTurnManager::NotifyFinishedClientUpdate(CNetServerSession& sessio
m_ClientsData[client].simulatedTurn + 1);
session.Disconnect(NDR_INCORRECT_READY_TURN_SIMULATED);
return;
}
m_ClientsData[client].simulatedTurn = turn;