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

Merge pull request #1000 from vcmi/multiplayer

Multiplayer
This commit is contained in:
Andrii Danylchenko
2022-10-03 20:16:39 +03:00
committed by GitHub
14 changed files with 164 additions and 58 deletions

View File

@@ -220,7 +220,7 @@ void CVCMIServer::threadAnnounceLobby()
}
}
bool CVCMIServer::prepareToStartGame()
void CVCMIServer::prepareToRestart()
{
if(state == EServerState::GAMEPLAY)
{
@@ -231,9 +231,19 @@ bool CVCMIServer::prepareToStartGame()
// FIXME: dirry hack to make sure old CGameHandler::run is finished
boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
}
for(auto c : connections)
{
c->enterLobbyConnectionMode();
c->disableStackSendingByID();
}
boost::unique_lock<boost::recursive_mutex> queueLock(mx);
gh = nullptr;
}
if(!gh)
gh = std::make_shared<CGameHandler>(this);
bool CVCMIServer::prepareToStartGame()
{
gh = std::make_shared<CGameHandler>(this);
switch(si->mode)
{
case StartInfo::CAMPAIGN: