From 14a3c6ad14cb77ac8b5881f0217f8a272a5b5888 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 25 Nov 2024 17:31:20 +0000 Subject: [PATCH] Fix freeze on closing server before starting the game Fixes possible freeze that seems to be caused by client shutting down socket before sending its final LobbyClientDisconnected packet, leading to server not processing disconnection of host correctly, which in turn causes client to wait server shutdown forever. Looks like regression from #4722 - Fixes #4912 and its duplicates --- server/CVCMIServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index 54fa8a25f..53b6879d8 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -300,7 +300,7 @@ void CVCMIServer::onDisconnected(const std::shared_ptr & con std::shared_ptr c = findConnection(connection); // player may have already disconnected via clientDisconnected call - if (c && gh && getState() == EServerState::GAMEPLAY) + if (c) { LobbyClientDisconnected lcd; lcd.c = c;