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

Redesign loading solution

This commit is contained in:
nordsoft
2023-08-22 20:10:20 +04:00
parent d9a2a7bfd0
commit dfaf778d16
10 changed files with 105 additions and 32 deletions

View File

@@ -289,9 +289,6 @@ void ApplyOnServerNetPackVisitor::visitLobbyStartGame(LobbyStartGame & pack)
result = false;
return;
}
// Announce loading
std::unique_ptr<LobbyLoadProgress> loadProgress(new LobbyLoadProgress);
srv.addToAnnounceQueue(std::move(loadProgress));
// Server will prepare gamestate and we announce StartInfo to clients
if(!srv.prepareToStartGame())
@@ -303,6 +300,7 @@ void ApplyOnServerNetPackVisitor::visitLobbyStartGame(LobbyStartGame & pack)
pack.initializedStartInfo = std::make_shared<StartInfo>(*srv.gh->getStartInfo(true));
pack.initializedGameState = srv.gh->gameState();
srv.state = EServerState::GAMEPLAY_STARTING;
result = true;
}