示例#1
0
        public static void SendInitialLobbyData(RemotePlayer p)
        {
            var players = GetPlayerList().Where(t => t.ID != p.ID);
            S2C_InitialLobbyData data = new S2C_InitialLobbyData();

            data.AvailablePlayers = players.Select(t => t.GetDisplay()).ToArray();
            data.PlayersOnline    = ProtoServer.GetPlayerCount();
            p.Connection.Send(data);
        }
示例#2
0
        public static void BroadcastPlayerCount()
        {
            var players = GetPlayerList();
            var packet  = new S2C_ServerPlayersOnlineCount(ProtoServer.GetPlayerCount());

            foreach (var p in players)
            {
                p.Connection.Send(packet);
            }
        }