1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Server: add GAMEPLAY_STARTING state (#450)

Fixes issue 2962.
This commit is contained in:
Karlis Senko
2018-04-22 17:40:02 +03:00
committed by Arseniy Shestakov
parent d9d01f0b68
commit 965b33d16a
3 changed files with 6 additions and 1 deletions

View File

@@ -115,6 +115,9 @@ bool LobbyChatMessage::checkClientPermissions(CVCMIServer * srv) const
bool LobbySetMap::applyOnServer(CVCMIServer * srv)
{
if(srv->state != EServerState::LOBBY)
return false;
srv->updateStartInfoOnMapChange(mapInfo, mapGenOpts);
return true;
}
@@ -172,6 +175,7 @@ bool LobbyStartGame::applyOnServer(CVCMIServer * srv)
return false;
}
// Server will prepare gamestate and we announce StartInfo to clients
srv->state = EServerState::GAMEPLAY_STARTING;
srv->prepareToStartGame();
initializedStartInfo = std::make_shared<StartInfo>(*srv->gh->getStartInfo(true));
return true;