5422 【Bug】【后端】转盘活动重置可能导致额外增加登录次数的bug
| | |
| | | def ChangeStrToDatetime(timeStr, timeFormat=ChConfig.TYPE_Time_Format):
|
| | | return datetime.datetime.strptime(timeStr, timeFormat)
|
| | |
|
| | | ## 时间格式转换成数值时间
|
| | | # @param dateT: datetime.datetime
|
| | | # @return: timeNum
|
| | | def ChangeDatetimeToNum(dateT): return int(time.mktime(dateT.timetuple()))
|
| | |
|
| | | def GetTodayTime():
|
| | | ## 获取当天0点时间戳
|
| | | return ChangeTimeStrToNum(str(GetCurrentTime())[:10], ChConfig.TYPE_Time_Format_Day)
|
| | |
|
| | | def CheckTimeIsSameServerDayEx(checkTime):
|
| | | '''判断指定time值与当天时间对比是否为游戏内的同一天;特殊时间点过天后才算不同天
|
| | | 该函数一般用于判断某个功能记录的版本天是否与当天时间是同一天的逻辑
|
| | |
| | | continue
|
| | |
|
| | | # 过天重置
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TurntableLoginState % actNum, 0)
|
| | | AddTurntableUseCountByLogin(curPlayer, actNum)
|
| | | Sync_TurntablePlayerInfo(curPlayer, actNum)
|
| | |
|
| | |
| | |
|
| | | def AddTurntableUseCountByLogin(curPlayer, actNum):
|
| | | ## 登录增加转盘次数
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TurntableLoginState % actNum):
|
| | | todayTime = GameWorld.GetTodayTime()
|
| | | loginState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TurntableLoginState % actNum)
|
| | | if loginState == todayTime:
|
| | | GameWorld.DebugLog("登录增加转盘次数,已经增加过: actNum=%s,todayTime=%s" % (actNum, todayTime))
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TurntableLoginState % actNum, 1)
|
| | | GameWorld.DebugLog("登录增加转盘次数: actNum=%s,todayTime=%s" % (actNum, todayTime))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TurntableLoginState % actNum, todayTime)
|
| | | AddTurntableUseCount(curPlayer, actNum, 1)
|
| | | return
|
| | |
|