/// <summary> /// Send an event from EventManager to all clients /// </summary> public static ServerToClientEventsMsg SendToAll(EVENT _event) { ServerToClientEventsMsg msg = new ServerToClientEventsMsg { Event = _event }; msg.SendToAll(); return(msg); }
IEnumerator ServerRoundRestart() { CurrentRoundState = RoundState.Ended; //Notify all clients that the round has ended ServerToClientEventsMsg.SendToAll(EVENT.RoundEnded); yield return(WaitFor.Seconds(0.2f)); CustomNetworkManager.Instance.ServerChangeScene(Maps[0]); }
IEnumerator ServerRoundRestart() { Logger.Log("Server restarting round now.", Category.Round); //Notify all clients that the round has ended ServerToClientEventsMsg.SendToAll(EVENT.RoundEnded); yield return(WaitFor.Seconds(0.2f)); CustomNetworkManager.Instance.ServerChangeScene(Maps[0]); }
IEnumerator ServerRoundRestart() { Logger.Log("Server restarting round now.", Category.Round); Chat.AddGameWideSystemMsgToChat("The round is now restarting..."); //Notify all clients that the round has ended ServerToClientEventsMsg.SendToAll(EVENT.RoundEnded); yield return(WaitFor.Seconds(0.2f)); CustomNetworkManager.Instance.ServerChangeScene("OnlineScene"); StopAllCoroutines(); }
IEnumerator ServerRoundRestart() { Logger.Log("Server restarting round now.", Category.Round); //Notify all clients that the round has ended ServerToClientEventsMsg.SendToAll(EVENT.RoundEnded); yield return(WaitFor.Seconds(0.2f)); var maps = JsonUtility.FromJson <MapList>(File.ReadAllText(Path.Combine(Application.streamingAssetsPath, "maps.json"))); CustomNetworkManager.Instance.ServerChangeScene(maps.GetRandomMap()); }