Exemplo n.º 1
0
def hasDailyData(userId, gameId, key):
    '''
    每日数据是否存在
    :param userId:
    :param gameId:
    :param key:
    '''
    dailyData = weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                                     DAILY_DATA_KEY)
    return dailyData.has_key(key)
Exemplo n.º 2
0
def getDailyData(userId, gameId, key, default=None):
    '''
    获取每日数据
    :param userId:
    :param gameId:
    :param key:
    '''
    dailyData = weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                                     DAILY_DATA_KEY)
    return dailyData.get(key, default)
Exemplo n.º 3
0
def _getTbData(userId):
    datas = weakdata.getWeakData(userId, DIZHU_GAMEID, weakdata.CYCLE_TYPE_DAY,
                                 'treasurebox')
    if not 'tbroomid' in datas:
        datas['tbroomid'] = 0
    if not 'tbplaytimes' in datas:
        datas['tbplaytimes'] = 0
    if not 'tblasttime' in datas:
        datas['tblasttime'] = 0
    ftlog.debug('_getTbData->userIds=', userId, datas)
    return datas
Exemplo n.º 4
0
def setDailyData(userId, gameId, key, value):
    '''
    设置每日数据
    :param userId:
    :param gameId:
    :param key:
    :param value:
    '''
    dailyData = weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                                     DAILY_DATA_KEY)
    dailyData[key] = value
    weakdata.setWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                         DAILY_DATA_KEY, dailyData)
Exemplo n.º 5
0
def _getTbData(gameId, userId):
    data = weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                                'treasurebox')
    if 'tbroomid' not in data:
        data['tbroomid'] = 0
    if 'tbplaytimes' not in data:
        data['tbplaytimes'] = 0
    if 'tblasttime' not in data:
        data['tblasttime'] = 0
    if ftlog.is_debug():
        ftlog.debug('treasurebox._getTbData', 'gameId=', gameId, 'userId=',
                    userId, 'data=', data)
    return data
Exemplo n.º 6
0
def getDay1stDatas(userId, gameId):
    return weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY, '1st')
Exemplo n.º 7
0
def getDayFishDataAll(userId, gameId):
    """
    获取每日数据(每个自然日的0点数据会被清除)
    """
    return weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                                "fish")
Exemplo n.º 8
0
def getDayPoseidonDataAll(userId, gameId):
    """
    获取每日数据(海皇来袭专用)
    """
    return weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                                "poseidon")
Exemplo n.º 9
0
def getDayRobberyDataAll(userId, gameId):
    """
    获取每日数据(招财模式专用)
    """
    return weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY,
                                "robbery")
Exemplo n.º 10
0
def getMonthFishDataAll(userId, gameId):
    """
    获取每月数据(每个自然月的首日0点数据会被清除)
    """
    return weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_MONTH,
                                "fish")
Exemplo n.º 11
0
def getWeekFishDataAll(userId, gameId):
    """
    获取每周数据(每个自然周的周一0点数据会被清除)
    """
    return weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_WEEK,
                                "fish")
Exemplo n.º 12
0
def getDay1stDatas(userId, gameId):
    return weakdata.getWeakData(userId, gameId, weakdata.CYCLE_TYPE_DAY, '1st')