(3cb6209cf) Show the "starting a round" popup to all clients when the server initiates a new round. Closes #1396

This commit is contained in:
Joonas Rikkonen
2019-04-08 13:37:27 +03:00
parent 24794932dc
commit 33b8c37933
2 changed files with 32 additions and 16 deletions
@@ -768,13 +768,19 @@ namespace Barotrauma.Networking
readyToStartMsg.Write((byte)ClientPacketHeader.RESPONSE_STARTGAME);
GameMain.NetLobbyScreen.UsingShuttle = usingShuttle;
readyToStartMsg.Write(
bool readyToStart =
GameMain.NetLobbyScreen.TrySelectSub(subName, subHash, GameMain.NetLobbyScreen.SubList) &&
GameMain.NetLobbyScreen.TrySelectSub(shuttleName, shuttleHash, GameMain.NetLobbyScreen.ShuttleList.ListBox));
GameMain.NetLobbyScreen.TrySelectSub(shuttleName, shuttleHash, GameMain.NetLobbyScreen.ShuttleList.ListBox);
readyToStartMsg.Write(readyToStart);
WriteCharacterInfo(readyToStartMsg);
client.SendMessage(readyToStartMsg, NetDeliveryMethod.ReliableUnordered);
if (readyToStart && !CoroutineManager.IsCoroutineRunning("WaitForStartRound"))
{
CoroutineManager.StartCoroutine(GameMain.NetLobbyScreen.WaitForStartRound(startButton: null, allowCancel: false), "WaitForStartRound");
}
break;
case ServerPacketHeader.STARTGAME:
startGameCoroutine = GameMain.Instance.ShowLoading(StartGame(inc), false);