예제 #1
0
        private void SelectGameRoom(Client sender, String[] packetStrings)
        {
            //AddClientToGameRoom
            GameRoom gameRoom = GetGameRoomByName(packetStrings[1]);

            if (gameRoom != null)
            {
                AddClientToGameRoom(sender, gameRoom);
            }
        }
예제 #2
0
 public void DestroyGameRoom(GameRoom GgameRoom)
 {
     for (int i = 0; i < gameRooms.Count; i++)
     {
         if (gameRooms[i] == GgameRoom)
         {
             gameRooms.Remove(GgameRoom);
             GgameRoom = null;
         }
     }
 }
예제 #3
0
        private void CreateGameRoom(Client sender, String[] packetStrings)
        {
            if (GetGameRoomByName(packetStrings[1]) != null || packetStrings[1].Length <= 2)
            {
                sender.Send(PacketDatas.PACKET_ERROR + PacketDatas.PACKET_SPLIT + "There is already a gameroom with the same name or need more then 2 characters");
                return;
            }

            GameRoom gameRoom = new GameRoom(sender, this, packetStrings[1]);

            gameRooms.Add(gameRoom);
            sender.Send(PacketDatas.PACKET_GAME_CREATE + PacketDatas.PACKET_SPLIT + "OK!");
            UpdateGameRooms();
            AddClientToGameRoom(sender, gameRoom);
        }
예제 #4
0
 public Game(GameRoom gameRoom) : base()
 {
     this.gameRoom = gameRoom;
 }
예제 #5
0
 private void AddClientToGameRoom(Client client, GameRoom gameRoom)
 {
     client.Send(PacketDatas.PACKET_GAME_SEL + PacketDatas.PACKET_SPLIT + "OK!");
     gameRoom.AddClient(client);
     RemoveClient(client);
 }