def antiCheatWithTodayTime(userId): todoayTime = pkgamedata.getGameAttrJson(userId, HALL_GAMEID, 'todaytime', {}) dayCount = 0 totalTime = 0 for (_, value) in todoayTime.items(): totalTime += value dayCount += 1 if ftlog.is_debug(): ftlog.debug('antiCheatWithTodayTime userId =', userId, ' daysWithRecord = ', dayCount, ' gameTimeInDaysWithRecord = ', totalTime) cheatDays = hallconf._getHallPublic('cheatDays') cheatGameTime = hallconf._getHallPublic('gameTime') ret = dayCount >= cheatDays and totalTime < cheatGameTime if ftlog.is_debug(): ftlog.debug('antiCheatWithTodayTime cheatDays=', cheatDays, 'cheatGameTime=', cheatGameTime, 'ret=', ret) return ret
def antiCheatWithTodayTime(userId): todoayTime = pkgamedata.getGameAttrJson(userId, HALL_GAMEID, 'todaytime', {}) dayCount = 0 totalTime = 0 for (_, value) in todoayTime.items(): totalTime += value dayCount += 1 if ftlog.is_debug(): ftlog.debug('antiCheatWithTodayTime userId =', userId, ' daysWithRecord = ', dayCount, ' gameTimeInDaysWithRecord = ', totalTime) cheatDays = hallconf._getHallPublic('cheatDays') cheatGameTime = hallconf._getHallPublic('gameTime') if ftlog.is_debug(): ftlog.debug('antiCheatWithTodayTime cheatDays = ', cheatDays, ' cheatGameTime = ', cheatGameTime) if dayCount >= cheatDays and totalTime < cheatGameTime: return True else: return False