1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fixes and cleanup of game client network shutdown and restart

This commit is contained in:
Ivan Savenko
2024-02-03 19:08:45 +02:00
parent 6eef197cea
commit 2c2bec791c
17 changed files with 102 additions and 146 deletions

View File

@@ -445,7 +445,10 @@ void CGameHandler::changeSecSkill(const CGHeroInstance * hero, SecondarySkill wh
void CGameHandler::handleClientDisconnection(std::shared_ptr<CConnection> c)
{
if(lobby->getState() == EServerState::SHUTDOWN || !gs || !gs->scenarioOps)
{
assert(0); // game should have shut down before reaching this point!
return;
}
for(auto & playerConnections : connections)
{
@@ -3609,7 +3612,7 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
if(p->human)
{
lobby->setState(EServerState::GAMEPLAY_ENDED);
lobby->setState(EServerState::SHUTDOWN);
}
}
else