Ejemplo n.º 1
0
def getFreeTemplateName(clientId, defaultName='default'):
    tname = configure.getVcTemplate('free', clientId, HALL_GAMEID)
    if tname:
        return tname
    template = hallmoduledefault.getClientModuleDefaultConf(clientId, 'free')
    if template is None:
        template = {}
    return template.get('template', defaultName)
Ejemplo n.º 2
0
def getFreeTemplateName(clientId, defaultName='default'):
    tname = configure.getVcTemplate('free', clientId, HALL_GAMEID)
    if tname:
        return tname
    template = hallmoduledefault.getClientModuleDefaultConf(clientId, 'free')
    if template is None:
        template = {}
    return template.get('template', defaultName)
Ejemplo n.º 3
0
def getGamewinShareinfo(gameId, clientId):
    '''
    获取结算分享所需的
    '''
    templateName = configure.getVcTemplate('share.gamewin', clientId, gameId)
    shareConf = configure.getGameJson(gameId, 'share.gamewin', {},
                                      configure.CLIENT_ID_TEMPLATE)
    templateMap = shareConf.get('templates', {})
    retConf = templateMap.get(templateName, {}).get('default', {})
    return retConf
Ejemplo n.º 4
0
def getFriendTableConf(clientId):
    templateName = configure.getVcTemplate('friendtable', clientId,
                                           DIZHU_GAMEID)
    ftconf = configure.getGameJson(DIZHU_GAMEID, 'friendtable', {},
                                   configure.CLIENT_ID_TEMPLATE)
    templateMap = ftconf.get('templates', {})

    conf = templateMap.get(templateName)
    if not conf:
        vcconf = configure.getGameJson(DIZHU_GAMEID, 'friendtable:vc', None,
                                       None)
        if vcconf:
            templateName = vcconf.get('default', None)
            if templateName:
                conf = templateMap.get(templateName)
    conf = conf or {}
    if ftlog.is_debug():
        ftlog.debug('getFriendTableConf:', 'clientId=', clientId,
                    'templateName=', templateName, 'conf=', conf,
                    'templateMap=', templateMap)
    return conf
Ejemplo n.º 5
0
    def loadTaskModel(self, userId, timestamp, clientId=None):
        ftlog.debug('HallChargeSubTaskSystem.loadTaskModel...')
        template_name = configure.getVcTemplate('hall_tasks', clientId)
        template = _templates.get(template_name)
        if not template:
            return None

        task_unitid = template.get(self.TYPE_ID)
        ftlog.debug('template_name:', template_name, ' template:', template,
                    ' task_unitid:', task_unitid)

        if not task_unitid:
            return None

        # 玩家身上只能有一个本类型的taskunit
        task_units = self._taskUnit.values()
        user_task_units = task_units[0].taskSystem.loadUserTaskUnits(
            userId, task_units, timestamp)
        user_task_units = [temp for temp in user_task_units if temp.taskMap]
        ftlog.debug('task_units:', task_units, ' user_task_units:',
                    user_task_units)

        if user_task_units:
            user_task_unit = user_task_units[0]
            if user_task_unit.taskUnitId != task_unitid:
                return None  # 已结取任务,且跟当前模板不一致,那么不显示
        else:
            user_task_unit = TYUserTaskUnit(userId,
                                            self._taskUnit.get(task_unitid))

        ftlog.debug('user_task_unit:', user_task_unit)
        user_task_unit = self._fix_user_task_unit(user_task_unit, timestamp)

        ftlog.debug('after _fix_user_task_unit user_task_unit:',
                    user_task_unit)
        if not self.userCanSeeTaskUnit(user_task_unit, timestamp):
            # 有充值任务,但不可见
            return None

        return self._loadTaskModel(user_task_unit, timestamp)
Ejemplo n.º 6
0
 def loadTaskModel(self, userId, timestamp, clientId=None):
     template_name = configure.getVcTemplate('hall_tasks', clientId)
     template = _templates.get(template_name)
     if not template:
         return None
     task_unitid = template.get(self.TYPE_ID)
     if not task_unitid:
         return None
     # 玩家身上只能有一个本类型的taskunit
     task_units = self._taskUnit.values()
     user_task_units = task_units[0].taskSystem.loadUserTaskUnits(
         userId, task_units, timestamp)
     user_task_units = [temp for temp in user_task_units if temp.taskMap]
     if user_task_units:
         user_task_unit = user_task_units[0]
         if user_task_unit.taskUnitId != task_unitid:
             return None  # 已结取任务,且跟当前模板不一致,那么不显示
     else:
         user_task_unit = TYUserTaskUnit(userId,
                                         self._taskUnit.get(task_unitid))
     user_task_unit = self._fix_user_task_unit(user_task_unit, timestamp)
     return self._loadTaskModel(user_task_unit, timestamp)
Ejemplo n.º 7
0
def getNewShareInfoByCondiction(gameId, clientId, condiction=None):
    '''
    新分享 根据 牌桌连胜、牌桌赢金币、红包赛、实物赛 4种情况区分shareId和发奖
    '''
    condiction = condiction if condiction else 'default'
    templateName = configure.getVcTemplate('share.gamewin', clientId, gameId)
    shareConf = configure.getGameJson(gameId, 'share.gamewin', {},
                                      configure.CLIENT_ID_TEMPLATE)
    templateMapCond = shareConf.get('templates', {}).get(templateName, {})
    shareConf = templateMapCond.get(str(condiction), {})

    if shareConf:
        itemId = shareConf.get('rewardInfo', {}).get('itemId')
        if itemId:
            assetKind = hallitem.itemSystem.findAssetKind(itemId)
            shareConf['rewardInfo']['img'] = assetKind.pic if assetKind else ''
    else:
        shareConf = templateMapCond.get('default', {})

    if ftlog.is_debug():
        ftlog.debug('getNewShareInfoByCondiction condiction=', condiction,
                    'conf=', shareConf)

    return shareConf if shareConf else getGamewinShareinfo(gameId, clientId)
Ejemplo n.º 8
0
def getMatchClassify(clientId):
    '''
    获取新的比赛分类信息
    插件版本需求3.827及以上
    '''
    templateName = configure.getVcTemplate('match.classify', clientId,
                                           DIZHU_GAMEID)
    mcconf = configure.getGameJson(DIZHU_GAMEID, 'match.classify', {},
                                   configure.CLIENT_ID_TEMPLATE)
    templateMap = mcconf.get('templates', {})

    conf = templateMap.get(templateName)
    if not conf:
        vcconf = configure.getGameJson(DIZHU_GAMEID, 'match.classify:vc', None,
                                       None)
        if vcconf:
            templateName = vcconf.get('default', None)
            if templateName:
                conf = templateMap.get(templateName)
    if ftlog.is_debug():
        ftlog.debug('getMatchClassify:', 'clientId=', clientId,
                    'templateName=', templateName, 'conf=', conf,
                    'templateMap=', templateMap)
    return conf
Ejemplo n.º 9
0
def getVcTemplateConf(clientId, moduleName, tempKeyName=None, needDict=0):
    """根据clientId获取虚配置"""
    tname1 = configure.getVcTemplate(moduleName, clientId)
    ftlog.debug('getVcTemplateConf->', clientId, moduleName, tname1)
    return tname1
Ejemplo n.º 10
0
def getClientChipPlusConf(clientId, gameId):
    return configure.getVcTemplate('chipplus', clientId, gameId)
Ejemplo n.º 11
0
def getVcTemplateConf(clientId, moduleName, tempKeyName=None, needDict=0):
    """根据clientId获取虚配置"""
    tname1 = configure.getVcTemplate(moduleName, clientId)
    ftlog.debug('getVcTemplateConf->', clientId, moduleName, tname1)
    return tname1