コード例 #1
0
 void UpdatePlayers()
 {
     foreach (var player in players)
     {
         ServerSend.RoomData(player.index, this);
     }
 }
コード例 #2
0
        public static void CreateRoom(int fromClient, Packet packet)
        {
            if (!Server.clients[fromClient].isTokenChecked)
            {
                Server.clients[fromClient].tcp.Disconnect();
                return;
            }
            string UUID = packet.ReadString();

            if (string.Equals(Server.clients[fromClient].UUID, UUID))
            {
                string roomName = packet.ReadString();
                if (roomName.Length > 1)
                {
                    roomName = roomName.Remove(roomName.Length - 1);
                    LobbyRoomsManager.CreateRoom(fromClient, roomName);
                    LobbyRoom room = LobbyRoomsManager.GetRoom(Server.clients[fromClient].UUID);
                    if (room != null)
                    {
                        ServerSend.RoomData(fromClient, room);
                    }
                }
            }
        }