当前位置: 首页>>代码示例>>Python>>正文


Python TodoTaskHelper.makeTodoTasksByFactory方法代码示例

本文整理汇总了Python中hall.entity.todotask.TodoTaskHelper.makeTodoTasksByFactory方法的典型用法代码示例。如果您正苦于以下问题:Python TodoTaskHelper.makeTodoTasksByFactory方法的具体用法?Python TodoTaskHelper.makeTodoTasksByFactory怎么用?Python TodoTaskHelper.makeTodoTasksByFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hall.entity.todotask.TodoTaskHelper的用法示例。


在下文中一共展示了TodoTaskHelper.makeTodoTasksByFactory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: encodePromote

# 需要导入模块: from hall.entity.todotask import TodoTaskHelper [as 别名]
# 或者: from hall.entity.todotask.TodoTaskHelper import makeTodoTasksByFactory [as 别名]
 def encodePromote(cls, gameId, userId, clientId, promote):
     try:
         todotasks = TodoTaskHelper.makeTodoTasksByFactory(gameId, userId, clientId, promote.promotion.todotasks)
         tempRedPoint = False
         timestamp = pktimestamp.getCurrentTimestamp()
         ftlog.debug('promote.promotion.redPoint =', promote.promotion.redPoint)
         for d in promote.promotion.redPoint:
             if d:
                 tempRedPoint = d.check(HALL_GAMEID, userId, clientId, timestamp)
         ret = {
             'id': promote.promotion.promotionId,
             'loc': promote.position.pos,
             'name': promote.promotion.displayName,
             'url': promote.promotion.url,
             'defaultRes': promote.promotion.defaultRes,
             'animate': promote.promotion.animate,
             'redPoint': tempRedPoint,
             'tasks': TodoTaskHelper.encodeTodoTasks(todotasks)
         }
         if promote.stopTime != -1:
             ret['endtime'] = datetime.fromtimestamp(promote.stopTime).strftime('%Y-%m-%d %H:%M:%S')
         return ret
     except:
         ftlog.error('PromotionHelper.encodePromote gameId=', gameId,
                     'userId=', userId,
                     'clientId=', clientId,
                     'promotionId=', promote.promotion.promotionId)
         return None
开发者ID:zhaozw,项目名称:hall37,代码行数:30,代码来源:promotion_loc_handler.py

示例2: queryFangKaBuyInfo

# 需要导入模块: from hall.entity.todotask import TodoTaskHelper [as 别名]
# 或者: from hall.entity.todotask.TodoTaskHelper import makeTodoTasksByFactory [as 别名]
def queryFangKaBuyInfo(gameId, userId, clientId):
    templateName = hallconf.getFangKaBuyInfoCliengConf(clientId)
    if templateName:
        ret = _fbTemplateMap.get(templateName, None)
        if not ret:
            return

        # 执行todotask
        ftlog.debug('hall_fangka_buy_info.queryFangKaBuyInfo gameId=', gameId,
                    'userId=', userId,
                    'clientId=', clientId,
                    'templateName=', templateName,
                    'tasks=', ret.todotasks)
        todotasks = TodoTaskRegister.decodeList(ret.todotasks)
        tasks = TodoTaskHelper.makeTodoTasksByFactory(gameId, userId, clientId, todotasks)
        TodoTaskHelper.sendTodoTask(gameId, userId, tasks)
开发者ID:zhaozw,项目名称:hall37,代码行数:18,代码来源:hall_fangka_buy_info.py

示例3: doCheckout

# 需要导入模块: from hall.entity.todotask import TodoTaskHelper [as 别名]
# 或者: from hall.entity.todotask.TodoTaskHelper import makeTodoTasksByFactory [as 别名]
 def doCheckout(self, gameId, userId, clientId, freeItemId):
     """
     {
         "cmd": "game",
         "params": {
             "action": "free_checkout",
             "userId": 10856,
             "gameId": 9999,
             "freeItemId": 1
         }
     }
     """
     timestamp = pktimestamp.getCurrentTimestamp()
     freeList = hallfree.getFree(gameId, userId, clientId, timestamp)
     free = FreeHelper.getFreeById(freeList, freeItemId)
     if free:
         curState = FreeHelper.getCurStateOfFreeItem(gameId, userId, clientId, free, timestamp)
         if curState:
             todotasks = TodoTaskHelper.makeTodoTasksByFactory(gameId, userId, clientId, curState.todotaskList)
             if todotasks:
                 TodoTaskHelper.sendTodoTask(gameId, userId, todotasks)
开发者ID:zhaozw,项目名称:hall37,代码行数:23,代码来源:free_handler.py

示例4: queryExitRemind

# 需要导入模块: from hall.entity.todotask import TodoTaskHelper [as 别名]
# 或者: from hall.entity.todotask.TodoTaskHelper import makeTodoTasksByFactory [as 别名]
def queryExitRemind(gameId, userId, clientId):
    exitSDK = queryExitSDK(gameId, userId, clientId)
    if ftlog.is_debug():
        ftlog.debug('queryExitRemind exitSDK:', exitSDK)

    gameIdInClientId = strutil.getGameIdFromHallClientId(clientId)
    if ftlog.is_debug():
        ftlog.debug('hall_exit_remind.queryExitRemind gameIdInClientId', gameIdInClientId)

    strGameId = str(gameIdInClientId)
    if strGameId not in hall_exit_remind._ordersMap:
        if ftlog.is_debug():
            ftlog.debug('hall_exit_remind.queryExitRemind no this game exit remind config....')
        return

    orders = hall_exit_remind._ordersMap[strGameId]
    if ftlog.is_debug():
        ftlog.debug('hall_exit_remind.queryExitRemind orders:', orders)

    for order in orders:
        if ftlog.is_debug():
            ftlog.debug('hall_exit_remind.queryExitRemind order:', order)

        conds = UserConditionRegister.decodeList(order.get('conditions', []))
        if ftlog.is_debug():
            ftlog.debug('hall_exit_remind.queryExitRemind conds:', conds)

        bCondsOK = False
        if len(conds) == 0:
            bCondsOK = True

        for cond in conds:
            if cond.check(HALL_GAMEID, userId, clientId, pktimestamp.getCurrentTimestamp()):
                if ftlog.is_debug():
                    ftlog.debug('hall_exit_remind.queryExitRemind cond ok: ', cond)
                bCondsOK = True
                break

        if bCondsOK:
            todotasksDict = order.get('todotasks', [])
            todotasks = TodoTaskRegister.decodeList(todotasksDict)
            if ftlog.is_debug():
                ftlog.debug('hall_exit_remind.queryExitRemind todotasks:', todotasks)

            todos = TodoTaskHelper.makeTodoTasksByFactory(HALL_GAMEID, userId, clientId, todotasks)
            tasks = TodoTaskHelper.encodeTodoTasks(todos)
            if ftlog.is_debug():
                ftlog.debug('hall_exit_remind.queryExitRemind build tasks ok: ', tasks)

            mo = MsgPack()
            mo.setCmd('game')
            mo.setResult('action', 'get_exit_remind')
            mo.setResult('gameId', gameId)
            mo.setResult('userId', userId)
            mo.setResult('button', order.get('button', ''))
            mo.setResult('tips', order.get('tips', ''))
            mo.setResult('tasks', tasks)
            mo.setResult('exitSDK', exitSDK)
            router.sendToUser(mo, userId)

            if ftlog.is_debug():
                ftlog.debug('hall_exit_remind.queryExitRemind userId:', userId, ' clientId:', clientId, ' msg:', mo)

            return
开发者ID:zhaozw,项目名称:hall37,代码行数:66,代码来源:hotfix_hall_exit_remind.py

示例5: _buildToDictImpl

# 需要导入模块: from hall.entity.todotask import TodoTaskHelper [as 别名]
# 或者: from hall.entity.todotask.TodoTaskHelper import makeTodoTasksByFactory [as 别名]
 def _buildToDictImpl(self, gameId, userId, clientId, d):
     todotasks = TodoTaskHelper.makeTodoTasksByFactory(gameId, userId, clientId, self.todotasks)
     d['tasks'] = TodoTaskHelper.encodeTodoTasks(todotasks)
     d['params'] = self.params
开发者ID:zhaozw,项目名称:hall37,代码行数:6,代码来源:hallgamelist2.py


注:本文中的hall.entity.todotask.TodoTaskHelper.makeTodoTasksByFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。