private void HandlePlayerRemove(GSPacketIn pkg)
        {
            GamePlayer player = WorldMgr.GetPlayerById(pkg.ClientID);
            int        roomId = pkg.ReadInt();

            if (player != null && player.CurrentRoom != null && player.CurrentRoom.RoomId == roomId)
            {
                RoomMgr.AddAction(new ExitRoomAction(player.CurrentRoom, player));
                RoomMgr.AddAction(new EnterWaitingRoomAction(player, 1));
            }
        }
Beispiel #2
0
        public void RandomNPC(int roomId, int fightRoomId)
        {
            BaseRoom room = null;
            Dictionary <int, BaseRoom> rooms;

            Monitor.Enter(rooms = this.m_rooms);
            try
            {
                if (this.m_rooms.ContainsKey(roomId) && this.m_rooms[roomId].FightRoomID == fightRoomId)
                {
                    room = this.m_rooms[roomId];
                    this.m_rooms.Remove(roomId);
                }
            }
            finally
            {
                Monitor.Exit(rooms);
            }
            if (room != null)
            {
                RoomMgr.AddAction(new PickUpNPCAction(room));
            }
        }