def on_user_logout(self, event): # 记录下线时间 ct = fttime.formatTimeMs() DaoGameDataHall.HMSET(event.userId, { HallKeys.ATT_ALIVE_TIME: ct, HallKeys.ATT_OFFLINE_TIME: ct })
def onHallUserEventLogin(self, event): # 记录上线时间 ct = fttime.formatTimeMs() DaoGameDataHall.HMSET(event.userId, { HallKeys.ATT_ALIVE_TIME: ct, HallKeys.ATT_AUTHOR_TIME: ct }) # 登录天数加1 if event.isDayfirst: DaoGameDataHall.HINCRBY(event.userId, HallKeys.ATT_LOGIN_DAYS, 1) # 登录次数加1 DaoGameDataHall.HINCRBY(event.userId, HallKeys.ATT_LOGIN_SUM, 1)