mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Replace thread approach with callback based
This commit is contained in:
@@ -38,7 +38,9 @@ void ApplyOnLobbyHandlerNetPackVisitor::visitLobbyClientConnected(LobbyClientCon
|
||||
if(pack.uuid == handler.c->uuid)
|
||||
{
|
||||
handler.c->connectionID = pack.clientId;
|
||||
if(!settings["session"]["headless"].Bool())
|
||||
if(handler.mapToStart)
|
||||
handler.setMapInfo(handler.mapToStart);
|
||||
else if(!settings["session"]["headless"].Bool())
|
||||
GH.windows().createAndPushWindow<CLobbyScreen>(static_cast<ESelectionScreen>(handler.screenType));
|
||||
handler.state = EClientState::LOBBY;
|
||||
}
|
||||
@@ -136,6 +138,11 @@ void ApplyOnLobbyHandlerNetPackVisitor::visitLobbyUpdateState(LobbyUpdateState &
|
||||
{
|
||||
pack.hostChanged = pack.state.hostClientId != handler.hostClientId;
|
||||
static_cast<LobbyState &>(handler) = pack.state;
|
||||
if(handler.mapToStart && handler.mi)
|
||||
{
|
||||
handler.startMapAfterConnection(nullptr);
|
||||
handler.sendStartGame();
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyOnLobbyScreenNetPackVisitor::visitLobbyUpdateState(LobbyUpdateState & pack)
|
||||
|
||||
Reference in New Issue
Block a user