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

Remove indirect calls to CSH from server handler itself

This commit is contained in:
Ivan Savenko
2024-05-10 18:32:24 +00:00
parent 46f2b8b2d7
commit a74d9791a1

View File

@@ -838,7 +838,7 @@ void CServerHandler::debugStartTest(std::string filename, bool save)
while(!settings["session"]["headless"].Bool() && !GH.windows().topWindow<CLobbyScreen>())
boost::this_thread::sleep_for(boost::chrono::milliseconds(50));
while(!mi || mapInfo->fileURI != CSH->mi->fileURI)
while(!mi || mapInfo->fileURI != mi->fileURI)
{
setMapInfo(mapInfo);
boost::this_thread::sleep_for(boost::chrono::milliseconds(50));
@@ -925,10 +925,10 @@ void CServerHandler::onDisconnected(const std::shared_ptr<INetworkConnection> &
if(client)
{
CSH->endGameplay();
endGameplay();
GH.defActionsDef = 63;
CMM->menu->switchToTab("main");
CSH->showServerError(CGI->generaltexth->translate("vcmi.server.errors.disconnected"));
showServerError(CGI->generaltexth->translate("vcmi.server.errors.disconnected"));
}
else
{
@@ -991,7 +991,7 @@ void CServerHandler::sendLobbyPack(const CPackForLobby & pack) const
bool CServerHandler::inLobbyRoom() const
{
return CSH->serverMode == EServerMode::LOBBY_HOST || CSH->serverMode == EServerMode::LOBBY_GUEST;
return serverMode == EServerMode::LOBBY_HOST || serverMode == EServerMode::LOBBY_GUEST;
}
bool CServerHandler::inGame() const