Beispiel #1
0
        private void UpdateActivePlayers()
        {
            var message = PlayersUpdateMessage.Create(activePlayers);

            SendMessageToClients(GameMsgType.UpdateActivePlayers, message);

            OnActivePlayersUpdated?.Invoke();
        }
        public static PlayersUpdateMessage Create(List <NetworkPlayer> activePlayers)
        {
            var message = new PlayersUpdateMessage();

            message.Players = new PlayerData[activePlayers.Count];

            for (int i = 0; i < activePlayers.Count; i++)
            {
                message.Players[i] = PlayerData.Create(activePlayers[i]);
            }
            return(message);
        }