//检测一个房间是否能开始游戏
        public static void DetetionRoomStartGame(this MatchRoomComponent matchRoomComponent, int roomId)
        {
            MatchRoom matchRoom = matchRoomComponent.GetRoom(roomId);

            if (matchRoom != null && !matchRoom.IsGameBeing && matchRoom.DetetionMayStartGame())
            {
                matchRoom.StartGame();//开始游戏
            }
        }
Пример #2
0
        public void StartGame(UserToken token, SocketModel mes)
        {
            DuelMesDTO dto    = mes.getMessage <DuelMesDTO>();
            int        userID = cache.getId(token);
            MatchRoom  room   = matchRoomMap[userMatch[userID]];

            room.StartGame(dto);

            getRoomInfo(userMatch[userID]).roomState = "正在游戏";
            UpdateRoomListToAll();
        }