From 6641154f22dbfafdd14f047f7a2491a9bbeae723 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 27 十月 2025 14:10:43 +0800
Subject: [PATCH] 16 卡牌服务端(优化榜单,增加更新时间字段;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py |   26 ++++++--------------------
 1 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
index f674bed..dfb9762 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
@@ -220,19 +220,12 @@
     cmpValueChange = isNewData or billboardData.GetCmpValue() != cmpValue or billboardData.GetCmpValue2() != cmpValue2 \
         or (cmpValue3 and billboardData.GetCmpValue3() != cmpValue3)
         
-    # 没设置值默认为时间time,先上榜的排前面
-    if cmpValue3 == 0:
-        # 时间权值仅在比较值变更的情况下才更新, 防止其他附属值更新时导致比较值相同的玩家名次间会变动的问题
-        if cmpValueChange:
-            calcTime = GameWorld.ChangeTimeStrToNum("2090-01-01 00:00:00")
-            cmpValue3 = max(0, calcTime - int(time.time())) # 比较值3如果没指定值则默认存当前更新的time
-        else:
-            cmpValue3 = billboardData.GetCmpValue3()
-            
     billboardData.SetCmpValue(cmpValue)
     billboardData.SetCmpValue2(cmpValue2)
     billboardData.SetCmpValue3(cmpValue3)
-    
+    if cmpValueChange or not billboardData.GetTime():
+        billboardData.SetTime(int(time.time()))
+        
     GameWorld.DebugLog("更新排行榜值: billboardType=%s,groupValue1=%s,groupValue2=%s,dataID=%s,cmpValueChange=%s,cmpValue=%s,cmpValue2=%s,cmpValue3=%s" 
                        % (billboardType, groupValue1, groupValue2, dataID, cmpValueChange,
                           cmpValue, cmpValue2, cmpValue3), dataID)
@@ -294,15 +287,6 @@
     cmpValueChange = isNewData or billboardData.GetCmpValue() != cmpValue or billboardData.GetCmpValue2() != cmpValue2 \
         or (cmpValue3 and billboardData.GetCmpValue3() != cmpValue3)
         
-    # 没设置值默认为时间time,先上榜的排前面
-    if cmpValue3 == 0:
-        # 时间权值仅在比较值变更的情况下才更新, 防止其他附属值更新时导致比较值相同的玩家名次间会变动的问题
-        if cmpValueChange:
-            calcTime = GameWorld.ChangeTimeStrToNum("2090-01-01 00:00:00")
-            cmpValue3 = max(0, calcTime - int(time.time())) # 比较值3如果没指定值则默认存当前更新的time
-        else:
-            cmpValue3 = billboardData.GetCmpValue3()
-            
     # 更新所有值
     billboardData.SetType(billboardType)
     billboardData.SetGroupValue1(groupValue1)
@@ -324,7 +308,9 @@
     billboardData.SetCmpValue(cmpValue)
     billboardData.SetCmpValue2(cmpValue2)
     billboardData.SetCmpValue3(cmpValue3)
-    
+    if cmpValueChange or not billboardData.GetTime():
+        billboardData.SetTime(int(time.time()))
+        
     GameWorld.DebugLog("更新排行榜值: billboardType=%s,groupValue1=%s,groupValue2=%s,dataID=%s,isNewData=%s,cmpValueChange=%s,type2=%s,value1=%s,value2=%s,cmpValue=%s,cmpValue2=%s,cmpValue3=%s,%s" 
                        % (billboardType, groupValue1, groupValue2, dataID, isNewData, cmpValueChange,
                           type2, value1, value2, cmpValue, cmpValue2, cmpValue3, kwargs), dataID)

--
Gitblit v1.8.0