當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。