hxp
2022-07-22 0018357c8b680025d3c0fa5509cbc2ed06dc8603
5422 【Bug】【后端】转盘活动重置可能导致额外增加登录次数的bug
2个文件已修改
18 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTurntable.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
@@ -1738,6 +1738,15 @@
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值与当天时间对比是否为游戏内的同一天;特殊时间点过天后才算不同天
    该函数一般用于判断某个功能记录的版本天是否与当天时间是同一天的逻辑
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTurntable.py
@@ -59,7 +59,6 @@
            continue
        
        # 过天重置
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TurntableLoginState % actNum, 0)
        AddTurntableUseCountByLogin(curPlayer, actNum)
        Sync_TurntablePlayerInfo(curPlayer, actNum)
        
@@ -132,9 +131,13 @@
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