def saveVipGiftStatus(self, userId, vipGiftStatus): ''' 保存用户VIP礼包状态 @param userId: 哪个用户 @param vipGiftStatus: 用户VIP礼包状态 ''' return DaoGameDataHall.HSET(userId, HallKeys.ATT_VIP_GIFT_STATES, vipGiftStatus)
def incrPlayTime(self, userId, detalTime, gameId, roomId, tableId): """ 各个游戏向大厅汇报玩家的游戏时长 """ DaoGameDataHall.HINCRBY(userId, HallKeys.ATT_TOTAL_TIME, detalTime) datas = DaoGameDataHall.HGET(userId, HallKeys.ATT_TODAY_TIME) today = datetime.now().strftime('%Y%m%d')[-6:] if today in datas: datas[today] += detalTime else: datas[today] = detalTime oldday = (datetime.now() - timedelta(days=7)).strftime('%Y%m%d')[-6:] for k in datas.keys()[:]: if k < oldday: del datas[k] DaoGameDataHall.HSET(userId, HallKeys.ATT_TODAY_TIME, datas) return 1
def set_monthcheckin(self, userId, d): return DaoGameDataHall.HSET(userId, HallKeys.ATT_MONTH_CHECKIN, d)
def _setDataValue(self, userId, attName, attValue): return DaoGameDataHall.HSET(userId, attName, attValue)
def setBiggestHallVersion(self, userId, version): return DaoGameDataHall.HSET(userId, HallKeys.ATT_BIGGEST_HALL5_VERSION, version)
def setLoginBeforeVersion511flag(self, userId): return DaoGameDataHall.HSET(userId, HallKeys.ATT_LOGIN_BEFORE_VERSION_TO_511, 1)
def setUpdateToVersion511flag(self, userId): return DaoGameDataHall.HSET(userId, HallKeys.ATT_UPDATE_CLIENT_VERSION_TO_511, 1)
def changeFirstGamelist5(self, userId): return DaoGameDataHall.HSET(userId, HallKeys.ATT_FIRST_GAME_LIST5, 1)
def setReliefShareDate(self, userId, timestamp): ''' ''' return DaoGameDataHall.HSET(userId, HallKeys.ATT_RELIEF_SHARE_DATE, timestamp)
def setBeneFitsInfo(self, userId, datas): ''' ''' return DaoGameDataHall.HSET(userId, HallKeys.ATT_BENEFITS, datas)
def setLastBuy(self, userId, d): return DaoGameDataHall.HSET(userId, HallKeys.ATT_LAST_BUY, d)
def userAliveTime(self, userId): # 记录活动时间 return DaoGameDataHall.HSET(userId, HallKeys.ATT_ALIVE_TIME, fttime.formatTimeMs())
def set_moduletip(self, userId, d): return DaoGameDataHall.HSET(userId, HallKeys.ATT_MODULE_TIP, d)
def set_submember(self, userId, d): return DaoGameDataHall.HSET(userId, HallKeys.ATT_SUBMEMBER, d)
def updateReadPriMsgId(self, userId, readId): return DaoGameDataHall.HSET(userId, HallKeys.ATT_MESSAGE_ID_PRIVATE, readId)
def updateReadSysMsgId(self, userId, readId): return DaoGameDataHall.HSET(userId, HallKeys.ATT_MESSAGE_ID_SYSTEM, readId)