5424 【后端】【1.4】跨服竞技场开发(修复本服时间比跨服时间慢时,不会加当日PK次数的bug)
2个文件已修改
27 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
@@ -1603,9 +1603,9 @@
    '''
    checkDate = ChangeTimeNumToDatetime(checkTime)
    curDate = GetCurrentTime()
    if checkDate > curDate:
        #DebugLog("检查时间比当前时间大")
        return False
    #if checkDate > curDate:
    #    #DebugLog("检查时间比当前时间大")
    #    return False
    
    Def_OnEventHour = ShareDefine.Def_OnEventHour
    chkYear, chkMonth, chkDay, chkHour = checkDate.year, checkDate.month, checkDate.day, checkDate.hour
@@ -1622,6 +1622,7 @@
    checkDateEx = datetime.datetime(chkYear, chkMonth, chkDay, 0, 0, 0)
    curDateEx = datetime.datetime(curYear, curMonth, curDay, 0, 0, 0)
    diffDays = (curDateEx - checkDateEx).days
    ## 当前时间比检查的时间大1天
    if diffDays == 1:
        if chkHour < Def_OnEventHour:
            #DebugLog("日期相差天数1, 不同天! chkHour(%s) < %s" % (chkHour, Def_OnEventHour))
@@ -1634,6 +1635,19 @@
        #DebugLog("日期相差天数1, 同天! curHour(%s) < %s <= chkHour(%s)" % (curHour, Def_OnEventHour, chkHour))
        return True
    
    ## 当前时间比检查的时间小1天
    elif diffDays == -1:
        if curHour < Def_OnEventHour:
            #DebugLog("日期相差天数-1, 不同天! curHour(%s) < %s" % (curHour, Def_OnEventHour))
            return False
        if chkHour >= Def_OnEventHour:
            #DebugLog("日期相差天数-1, 不同天! chkHour(%s) >= %s" % (chkHour, Def_OnEventHour))
            return False
        #DebugLog("日期相差天数-1, 同天! chkHour(%s) < %s <= curHour(%s)" % (chkHour, Def_OnEventHour, curHour))
        return True
    #DebugLog("日期相差天数大于1,不同一天!")
    return False
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
@@ -280,20 +280,27 @@
    
    pkCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_PKCount) + 1
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_PKCount, pkCount)
    GameWorld.Log("    更新数据: danLV=%s,pkScore=%s,pkCount=%s" % (danLV, pkScore, pkCount), playerID)
    if isWinner:
        winCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_WinCount) + 1
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_WinCount, winCount)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_CWinCount, cWinCount)
        GameWorld.Log("    winner winCount=%s,cWinCount=%s" % (winCount, cWinCount), playerID)
    else:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_CWinCount, 0)
        GameWorld.Log("    loser cWinCount=0", playerID)
    
    # 同一天的话增加当日PK次数
    if GameWorld.CheckTimeIsSameServerDayEx(GameWorld.ChangeTimeStrToNum(timeStr)):
        todayPKCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayPKCount) + 1
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayPKCount, todayPKCount)
        GameWorld.Log("    同一天的PK结算增加今日PK次数: todayPKCount=%s" % todayPKCount, playerID)
        if isWinner:
            todayWinCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayWinCount) + 1
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, todayWinCount)
            GameWorld.Log("    增加今日已获胜次数: todayWinCount=%s" % todayWinCount, playerID)
    else:
        GameWorld.Log("    不同天的PK结算不增加今日PK次数! ", playerID)
            
    SyncCrossRealmPKPlayerInfo(curPlayer)