From ee9cf54149abaa83b49edd3abe4ce12d2ec3006d Mon Sep 17 00:00:00 2001 From: elexis Date: Tue, 5 Jun 2018 12:24:30 +0000 Subject: [PATCH] Fix an OOS on rejoin after doubleclicking on the StartGame button, fixes #5199, refs #5162. Prevents changes to the gamesettings after the game was started, so as to use the correct map seed when generating the random map terrain for rejoiners. D1558 will prevent the UI bug #5206 and FSM error from doubleclicking on StartGame. Differential Revision: https://code.wildfiregames.com/D1562 Tested and accepted by: temple This was SVN commit r21836. --- source/network/NetServer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/network/NetServer.cpp b/source/network/NetServer.cpp index eaadbb7271..721af548bd 100644 --- a/source/network/NetServer.cpp +++ b/source/network/NetServer.cpp @@ -1217,6 +1217,11 @@ bool CNetServerWorker::OnGameSetup(void* context, CFsmEvent* event) CNetServerSession* session = (CNetServerSession*)context; CNetServerWorker& server = session->GetServer(); + // Changing the settings after gamestart is not implemented and would cause an Out-of-sync error. + // This happened when doubleclicking on the startgame button. + if (server.m_State != SERVER_STATE_PREGAME) + return true; + if (session->GetGUID() == server.m_HostGUID) { CGameSetupMessage* message = (CGameSetupMessage*)event->GetParamRef();