Exemplo n.º 1
0
        public override void RunImpl()
        {
            Player player = getClient().getPlayer();
            Room   room   = getClient().getPlayer().getRoom();

            if (room != null && player != null)
            {
                if (room.getPlayers().Count == 0)
                {
                    player.getChannel().removeRoom(room);
                }

                room.removePlayer(player);
                player.getChannel().addPlayer(player);
                /* Если в комнате пусто, удаляем с боевого сервера */
                if (room.getPlayers().Count == 0)
                {
                    BattleHandler.DeleteRoom(room);
                }
            }

            getClient().getPlayer().channel.RemoteEmptyRooms();//удаляем пустые комнаты с канала

            getClient().SendPacket(new PROTOCOL_LOBBY_ENTER_ACK());

            getClient().SendPacket(new PROTOCOL_MESSENGER_NOTE_LIST_ACK());
            getClient().SendPacket(new PROTOCOL_MESSENGER_CHECK_ACK());

            /*Thread.Sleep(5000);
             * getClient().SendPacket(new PROTOCOL_MESSAGE_ALL_PLAYERS_ACK()); */
            getClient().getPlayer().setRoom(null);
        }