def doHallGameListV3_81(self, userId, gameId, clientId): template = hallgamelist2.getUITemplate(gameId, userId, clientId) if template is None: ftlog.exception( 'doHallGameListV3_81 error, please check clientId:', clientId) else: _games, pages, innerGames = HallHelper.encodeHallUITemplage2( gameId, userId, clientId, template) from hall.servers.util import gamelistipfilter _games, pages, innerGames = gamelistipfilter.filtergamelist( 3.81, _games, pages, innerGames, userId, clientId, isNeedPopShutDownGameWnd=True) mo = MsgPack() mo.setCmd('hall_game_list') mo.setResult('gameId', gameId) mo.setResult('userId', userId) mo.setResult('games', _games) mo.setResult('pages', pages) mo.setResult('innerGames', innerGames) router.sendToUser(mo, userId)
def enterFriendTable(userId, gameId, clientId, ftId): """进入自建桌""" if ftlog.is_debug(): ftlog.debug('hall_friend_table.enterFriendTable userId:', userId, ' pluginId:', gameId, ' clientId:', clientId, ' ftId:', ftId) pluginId = queryFriendTable(ftId) if not pluginId: TodoTaskHelper.sendTodoTask(HALL_GAMEID, userId, TodoTaskPopTip('该房间不存在')) return if TYPlayer.isRobot(userId): isValidPluginId = True else: isValidPluginId = False from hall.entity import hallgamelist2 template = hallgamelist2.getUITemplate(gameId, userId, clientId) for version in template.versionList: if pluginId == version.game.gameId: isValidPluginId = True break if not isValidPluginId: TodoTaskHelper.sendTodoTask(HALL_GAMEID, userId, TodoTaskPopTip('该安装包不支持此房间号所对应的玩法')) return ftlog.info('hall_friend_table.enterFriendTable userId:', userId, ' lead to pluginId:', pluginId) pluginId = int(pluginId) TYGame(pluginId).enterFriendTable(userId, gameId, clientId, ftId)
def doHallGameListV3_7(self, userId, gameId, clientId): template = hallgamelist2.getUITemplate(gameId, userId, clientId) if template is None: ftlog.exception('doHallGameListV3_7 error, please check clientId:', clientId) else: games, pages, _innerGames = HallHelper.encodeHallUITemplage(gameId, userId, clientId, template) mo = MsgPack() mo.setCmd('hall_game_list') mo.setResult('gameId', gameId) mo.setResult('userId', userId) mo.setResult('games', games) mo.setResult('pages', pages) router.sendToUser(mo, userId)
def doHallGameListV3_7(self, userId, gameId, clientId): template = hallgamelist2.getUITemplate(gameId, userId, clientId) if template is None: ftlog.exception('doHallGameListV3_7 error, please check clientId:', clientId) else: games, pages, _innerGames = HallHelper.encodeHallUITemplage( gameId, userId, clientId, template) mo = MsgPack() mo.setCmd('hall_game_list') mo.setResult('gameId', gameId) mo.setResult('userId', userId) mo.setResult('games', games) mo.setResult('pages', pages) router.sendToUser(mo, userId)
def getGamesUserCanEnter(self, userId, gameId, clientId): ''' 获取用户可以进入那些游戏 ''' gameIds = [] template = hallgamelist2.getUITemplate(gameId, userId, clientId) if template is None: return gameIds _games, pages, innerGames = HallHelper.encodeHallUITemplage2(gameId, userId, clientId, template) from hall.servers.util import gamelistipfilter _games, _, _ = gamelistipfilter.filtergamelist(3.81, _games, pages, innerGames, userId, clientId) for game in _games: gameId = game.get('gameId', 0) if (0 != gameId) and (gameId not in gameIds): gameIds.append(gameId) return gameIds
def sendHallGameList2_handler(cls, userId, gameId, clientId): from poker.util import strutil _, clientVer, _ = strutil.parseClientId(clientId) template = hallgamelist2.getUITemplate(gameId, userId, clientId) if template is None: ftlog.exception('sendHallGameList2 error, please check clientId:', clientId) else: _games, pages, innerGames = HallHelper.encodeHallUITemplage2( gameId, userId, clientId, template) from hall.servers.util import gamelistipfilter _games, pages, innerGames = gamelistipfilter.filtergamelist( clientVer, _games, pages, innerGames, userId, clientId) mo = MsgPack() mo.setCmd('hall_game_list') mo.setResult('gameId', gameId) mo.setResult('userId', userId) mo.setResult('games', _games) mo.setResult('pages', pages) if clientVer >= 3.76: mo.setResult('innerGames', innerGames) router.sendToUser(mo, userId)