Ejemplo n.º 1
0
        private void SelectGameRoom(Client sender, String[] packetStrings)
        {
            //AddClientToGameRoom
            GameRoom gameRoom = GetGameRoomByName(packetStrings[1]);

            if (gameRoom != null)
            {
                AddClientToGameRoom(sender, gameRoom);
            }
        }
Ejemplo n.º 2
0
 public void DestroyGameRoom(GameRoom GgameRoom)
 {
     for (int i = 0; i < gameRooms.Count; i++)
     {
         if (gameRooms[i] == GgameRoom)
         {
             gameRooms.Remove(GgameRoom);
             GgameRoom = null;
         }
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public Game(GameRoom gameRoom) : base()
 {
     this.gameRoom = gameRoom;
 }
Ejemplo n.º 5
0
 private void AddClientToGameRoom(Client client, GameRoom gameRoom)
 {
     client.Send(PacketDatas.PACKET_GAME_SEL + PacketDatas.PACKET_SPLIT + "OK!");
     gameRoom.AddClient(client);
     RemoveClient(client);
 }