예제 #1
0
        /// <summary>
        /// Matching을 요청한 User들을 넘겨 받아 Game 방을 생성
        /// </summary>
        /// <param name="user1"></param>
        /// <param name="user2"></param>
        public void CreateRoom(GameUser user1, GameUser user2)
        {
            // Game 방을 생성하여 입장 시킴
            GameRoom battleRoom = new GameRoom(this);

            battleRoom.EnterRoom(user1, user2);

            // Game 방 목록에 추가하여 관리
            this.roomLst.Add(battleRoom);
        }
예제 #2
0
        public static void RemoveUser(GameUser user)
        {
            lock (userList)
            {
                userList.Remove(user);
                gameServer.DisconnectUser(user);

                GameRoom room = user.battleRoom;
                if (room != null)
                {
                    gameServer.roomManager.RemoveRoom(user.battleRoom);
                }
            }
        }
예제 #3
0
 public void RemoveRoom(GameRoom room)
 {
     room.DestroyRoom();
     this.roomLst.Remove(room);
 }
예제 #4
0
 public void EnterRoom(Player player, GameRoom room)
 {
     this.player     = player;
     this.battleRoom = room;
 }