def getSegmentRooms(gameId, userId, clientId): ret = [] sessions = hallconf.getHallSessionInfo(gameId, clientId) for session in sessions: if session.get('segment') == 1: return session['rooms'] return ret
def _getQuickStartRoomList(cls, userId, playMode): ''' 获取快开房间列表 ''' clientId = sessiondata.getClientId(userId) sessions = hallconf.getHallSessionInfo(DIZHU_GAMEID, clientId) sessionRoomInfoList = [] for session in sessions: if session.get('playMode') == playMode: for room in session.get('rooms', []): bigRoomId = room.get('id') segment = room.get('segment') ctrlRoomId = bigRoomId * 10000 + 1000 mixId = room.get('mixId') roomConfig = cls._getRoomConfigure(ctrlRoomId, mixId) sessionRoomInfoList.append({ 'bigRoomId': bigRoomId, 'ctrlRoomId': ctrlRoomId, 'mixId': mixId, 'roomConfig': roomConfig, 'segment': segment}) break # 房间过滤排序 if playMode == 'match': sessionRoomInfoList.sort(key=lambda x: x['roomConfig'].get('minQuickStartDiamond')) else: sessionRoomInfoList.sort(key=lambda x: x['roomConfig'].get('minQuickStartChip')) if ftlog.is_debug(): ftlog.debug('DizhuQuickStartWx._getQuickStartRoomList', 'userId=', userId, 'playMode=', playMode, 'sessionRoomInfoList=', sessionRoomInfoList) return sessionRoomInfoList
def doHallInfo(self, userId, gameId, clientId): roominfos = hallconf.getHallSessionInfo(gameId, clientId) msg = MsgPack() msg.setCmd('hall_info') msg.setResult('gameId', gameId) msg.setResult('userId', userId) msg.setResult('sessions', roominfos) router.sendToUser(msg, userId)
def getMatchSessionName(gameId, clientId, bigRoomId): sessions = hallconf.getHallSessionInfo(gameId, clientId) for session in sessions: if session.get('match') == 1: for room in session.get('rooms', []): if room.get('id') == bigRoomId: return room.get('name', '') return ''
def getMatchSessionRankRewards(gameId, clientId, bigRoomId): sessions = hallconf.getHallSessionInfo(gameId, clientId) for session in sessions: if session.get('match') == 1: for room in session.get('rooms', []): if room.get('id') == bigRoomId: return room.get('rank.rewards', []) return []
def getWechatMatchRooms(gameId, userId, clientId): ret = [] roomInfoMap = loadAllRoomInfo(gameId) timestamp = pktimestamp.getCurrentTimestamp() sessions = hallconf.getHallSessionInfo(gameId, clientId) for session in sessions: if session.get('match') == 1: return filterMatchSession(gameId, userId, clientId, roomInfoMap, session, timestamp)['rooms'] return ret
def getSessions(gameId, userId, clientId): ret = [] roomInfoMap = loadAllRoomInfo(gameId) timestamp = pktimestamp.getCurrentTimestamp() sessions = hallconf.getHallSessionInfo(gameId, clientId) for session in sessions: session = filterSession(gameId, userId, clientId, roomInfoMap, session, timestamp) if session: ret.append(session) return ret
def getMatchSessionRoomIds(cls, userId): # 提审用 clientId = sessiondata.getClientId(userId) sessions = hallconf.getHallSessionInfo(DIZHU_GAMEID, clientId) matchSession = {} matchSessionRoomIds = [] for session in sessions: if session.get('match') == 1: matchSession = session break for room in matchSession.get('rooms', []): roomId = room.get('id') matchSessionRoomIds.append(roomId) return matchSessionRoomIds