Ejemplo n.º 1
0
    /// <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);
    }
Ejemplo n.º 2
0
    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]);
    }
Ejemplo n.º 3
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]);
    }
Ejemplo n.º 4
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();
    }
Ejemplo n.º 5
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));

        var maps = JsonUtility.FromJson <MapList>(File.ReadAllText(Path.Combine(Application.streamingAssetsPath,
                                                                                "maps.json")));

        CustomNetworkManager.Instance.ServerChangeScene(maps.GetRandomMap());
    }