Exemplo n.º 1
0
        public void Execute()
        {
            if (m_player.CurrentRoom != null)
            {
                m_player.CurrentRoom.RemovePlayerUnsafe(m_player);
            }

            BaseWaitingRoom room = RoomMgr.WaitingRoom;

            if (room.AddPlayer(m_player))
            {
                BaseRoom[]      list     = RoomMgr.Rooms;
                List <BaseRoom> tempList = new List <BaseRoom>();
                //int maxRoomInList = 7;
                for (int i = 0; i < list.Length; i++)
                {
                    if (!list[i].IsEmpty)
                    {
                        tempList.Add(list[i]);
                        //m_player.Out.SendUpdateRoomList(list[i]);
                    }
                }
                m_player.Out.SendUpdateRoomList(tempList);

                GamePlayer[] players = room.GetPlayersSafe();
                foreach (GamePlayer p in players)
                {
                    if (p != m_player)
                    {
                        m_player.Out.SendSceneAddPlayer(p);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void Execute()
 {
     if (this.m_player != null)
     {
         if (this.m_player.CurrentRoom != null)
         {
             RoomMgr.ExitRoom(this.m_player.CurrentRoom, this.m_player);
         }
         BaseWaitingRoom room = RoomMgr.WaitingRoom;
         if (room.AddPlayer(this.m_player))
         {
             List <BaseRoom> list = RoomMgr.GetWaitingRoom(this.m_hallType, 0, 9, 0);
             this.m_player.Out.SendUpdateRoomList(list);
             GamePlayer[] players = room.GetPlayersSafe();
             GamePlayer[] array   = players;
             for (int i = 0; i < array.Length; i++)
             {
                 GamePlayer p = array[i];
                 if (p != this.m_player)
                 {
                     this.m_player.Out.SendSceneAddPlayer(p);
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        public void Execute()
        {
            //if (m_player.CurrentRoom != null)
            //    m_player.CurrentRoom.RemovePlayer(m_player);

            BaseWaitingRoom room = RoomMgr.WaitingRoom;

            room.RemovePlayer(m_player);
            //if (room.AddPlayer(m_player))
            //{
            //    BaseRoom[] list = RoomMgr.Rooms;
            //    for (int i = 0; i < list.Length; i++)
            //    {
            //        if (!list[i].IsEmpty)
            //        {
            //            m_player.Out.SendUpdateRoomList(list[i]);
            //        }
            //    }

            //    GamePlayer[] players = room.GetPlayersSafe();
            //    foreach (GamePlayer p in players)
            //    {
            //        if (p != m_player)
            //        {
            //            m_player.Out.SendSceneAddPlayer(p);
            //        }
            //    }
            //}
        }
Exemplo n.º 4
0
 public static bool Setup(int maxRoom)
 {
     maxRoom               = ((maxRoom < 1) ? 1 : maxRoom);
     RoomMgr.m_thread      = new Thread(new ThreadStart(RoomMgr.RoomThread));
     RoomMgr.m_actionQueue = new Queue <IAction>();
     RoomMgr.m_rooms       = new BaseRoom[maxRoom];
     for (int i = 0; i < maxRoom; i++)
     {
         RoomMgr.m_rooms[i] = new BaseRoom(i + 1);
     }
     RoomMgr.m_waitingRoom = new BaseWaitingRoom();
     return(true);
 }
Exemplo n.º 5
0
        public static bool Setup(int maxRoom)
        {
            maxRoom = maxRoom < 1 ? 1 : maxRoom;
            m_thread = new Thread(new ThreadStart(RoomThread));
            m_actionQueue = new Queue<IAction>();
            m_rooms = new BaseRoom[maxRoom];
            for (int i = 0; i < maxRoom; i++)
            {
                m_rooms[i] = new BaseRoom(i + 1);
            }
            m_waitingRoom = new BaseWaitingRoom();

            return true;
        }
Exemplo n.º 6
0
        public void Execute()
        {
            if (this.m_player.CurrentRoom != null)
            {
                this.m_player.CurrentRoom.RemovePlayerUnsafe(this.m_player);
            }
            BaseWaitingRoom waitingRoom = RoomMgr.WaitingRoom;

            if (waitingRoom.AddPlayer(this.m_player))
            {
                BaseRoom[]      rooms = RoomMgr.Rooms;
                List <BaseRoom> list  = new List <BaseRoom>();
                for (int i = 0; i < rooms.Length; i++)
                {
                    if (!rooms[i].IsEmpty)
                    {
                        if (this.m_player.ScreenStyle == 1 && (rooms[i].RoomType == eRoomType.Match || rooms[i].RoomType == eRoomType.Freedom))
                        {
                            list.Add(rooms[i]);
                        }
                        if (this.m_player.ScreenStyle == 2 && (rooms[i].RoomType == eRoomType.Dungeon || rooms[i].RoomType == eRoomType.Freshman))
                        {
                            list.Add(rooms[i]);
                        }
                    }
                }
                this.m_player.Out.SendUpdateRoomList(list);
                GamePlayer[] playersSafe = waitingRoom.GetPlayersSafe();
                GamePlayer[] array       = playersSafe;
                for (int j = 0; j < array.Length; j++)
                {
                    GamePlayer gamePlayer = array[j];
                    if (gamePlayer != this.m_player)
                    {
                        this.m_player.Out.SendSceneAddPlayer(gamePlayer);
                    }
                }
            }
        }
Exemplo n.º 7
0
        public void Execute()
        {
            BaseWaitingRoom room = RoomMgr.WaitingRoom;

            room.RemovePlayer(m_player);
        }
Exemplo n.º 8
0
        public void Execute()
        {
            BaseWaitingRoom waitingRoom = RoomMgr.WaitingRoom;

            waitingRoom.RemovePlayer(this.m_player);
        }