1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Finally game restart works

# Conflicts:
#	lib/CGameState.cpp
#	server/CVCMIServer.cpp
This commit is contained in:
nordsoft
2022-09-29 21:08:05 +04:00
parent cbfa125085
commit fea05a4320
9 changed files with 70 additions and 4 deletions

View File

@ -502,6 +502,14 @@ void CServerHandler::sendGuiAction(ui8 action) const
sendLobbyPack(lga);
}
void CServerHandler::sendRestartGame() const
{
LobbyEndGame endGame;
endGame.closeConnection = false;
endGame.restart = true;
sendLobbyPack(endGame);
}
void CServerHandler::sendStartGame(bool allowOnlyAI) const
{
verifyStateBeforeStart(allowOnlyAI ? true : settings["session"]["onlyai"].Bool());
@ -568,6 +576,9 @@ void CServerHandler::endGameplay(bool closeConnection, bool restart)
GH.curInt = CMainMenu::create().get();
}
}
serverConnection->enterLobbyConnectionMode();
serverConnection->disableStackSendingByID();
}
void CServerHandler::startCampaignScenario(std::shared_ptr<CCampaignState> cs)