From e4c2a1b331ef0133a010bce5ccdcf3d19db12726 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 07 十一月 2025 14:46:31 +0800
Subject: [PATCH] 237 【福利内容】每日任务/每周任务/章节奖励-服务端(增加物品效果281-给活跃度;每日任务奖励改为配置物品;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py |  234 ++++++++++++++++++++--------------------------------------
 1 files changed, 81 insertions(+), 153 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 e67af45..b474f25 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
@@ -15,15 +15,12 @@
 #"""Version = 2018-03-06 11:00"""
 #-------------------------------------------------------------------------------
 
-import ChConfig
 import GameWorld
 import ShareDefine
 import PlayerControl
-import OpenServerCampaign
 import ChPyNetSendPack
 import NetPackCommon
 import IpyGameDataPY
-import GameFuncComm
 import DBDataMgr
 
 import time
@@ -38,19 +35,13 @@
         
     billboardMgr = DBDataMgr.GetBillboardMgr()
     for billboardType in drBillboardTypeList:
-        if billboardType in [ShareDefine.Def_CBT_BossTrialSubmitBak, ShareDefine.Def_CBT_BossTrialSubmitFamilyBak, ShareDefine.Def_CBT_CrossRealmPK]:
+        if billboardType in []:
             continue
         groupList = billboardMgr.GetBillboardGroupList(billboardType)
         for billboardType, groupValue1, groupValue2 in groupList:
             billboardObj = billboardMgr.GetBillboard(billboardType, groupValue1, groupValue2)
             billboardObj.SaveDRData("OnDay")
             
-    return
-
-def DoBillboardOpen(curPlayer):
-    ## 排行榜开启时需要处理的
-    UpdatePlayerBillboardOnLeaveServer(curPlayer, True) # 主动同步一次榜单
-    OpenServerCampaign.DoBillboardOpen(curPlayer) # 同步开服活动榜单
     return
 
 def BillboardOnLogin(curPlayer):
@@ -71,170 +62,114 @@
         # 跨服服务器不用更新本服榜
         return
     
-    UpdatePlayerLVBillboard(curPlayer) # 等级榜
-    UpdatePlayerFPTotalBillboard(curPlayer, True) # 战斗力榜
-    UpdateHorseBillboard(curPlayer, True, False) # 坐骑榜
-    UpdatePyPetBillboard(curPlayer, True, False) # 灵宠榜
-    UpdateRealmBillboard(curPlayer) # 境界榜
+    return
+
+def UpdatePlayerBillboardName(curPlayer):
+    ## 更新排行榜中的玩家名字记录
     
-    if isAll:
-        UpdateRuneTowerBillboard(curPlayer)
-        
+    playerID = curPlayer.GetPlayerID()
+    updName = curPlayer.GetPlayerName()
+    billboardMgr = DBDataMgr.GetBillboardMgr()
+    for billboardType in ShareDefine.BillboardTypeList:
+        if billboardType in ShareDefine.FamilyBillboardList:
+            continue
+        groupList = billboardMgr.GetBillboardGroupList(billboardType)
+        for billboardType, groupValue1, groupValue2 in groupList:
+            billboardObj = billboardMgr.GetBillboard(billboardType, groupValue1, groupValue2)
+            billData = billboardObj.FindByID(playerID)
+            if not billData:
+                continue
+            billData.SetName1(updName)
+            
+    # 跨服榜更新, 待处理
     return
 
 def UpdatePlayerFPTotalBillboard(curPlayer, isForceUpdate=False, isCheckRule=True):
     ##更新玩家总战斗力
-    
-    playerFightPower = PlayerControl.GetFightPower(curPlayer)
-    if not __CheckFightPowerCanUpdate(curPlayer, ChConfig.Def_PDict_FightPower_Total, playerFightPower,
-                                      isForceUpdate, isCheckRule, ChConfig.Def_PDict_FightPower_TotalEx):
-        return
-    
-    fightPower = playerFightPower % ChConfig.Def_PerPointValue
-    fightPowerEx = playerFightPower / ChConfig.Def_PerPointValue
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Total, fightPower,
-                                       ChConfig.Def_PDictType_FightPower)
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_TotalEx, fightPowerEx,
-                                       ChConfig.Def_PDictType_FightPower)
-    
-    GameWorld.DebugLog("更新总战斗力:playerFightPower=%s" % (playerFightPower), curPlayer.GetPlayerID())
-    
-    UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FightPower, fightPowerEx, fightPower)
-    
-#    if bType == ShareDefine.Def_BT_FightPower:
-#        playerID = bID
-#        fightPowerTotal = cmpValue * ChConfig.Def_PerPointValue + cmpValue2
-#        familyID = exInfo[0]
-#        playerJob = bType2
-#        
-#        curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
-#        if curPlayer:
-#            PlayerControl.SetFightPower(curPlayer, fightPowerTotal)
-#            
-#        #更新战盟成员战力
-#        PlayerFamily.UpdFamilyMemberFightPower(familyID, playerID, fightPowerTotal)
-#        
-#        #职业战力榜
-#        job = playerJob % 10
-#        if job in ShareDefine.JobFightPowerBillboardDict:
-#            jobBType = ShareDefine.JobFightPowerBillboardDict[job]
-#            UpdatePlayerBillboard(bID, bName, bName2, jobBType, bType2, value1, value2, cmpValue, autoSort, cmpValue2, **kwargs)
-    return
-
-def __CheckFightPowerCanUpdate(curPlayer, key, fightPower, isForceUpdate=False, isCheckRule=True, key2=None):
-    ''' 检查玩家可否更新战斗力
-    @param curPlayer 玩家实例
-    @param key 战斗力类型对应key
-    @param fightPower 当前战斗力
-    @param isForceUpdate 是否强制更新(若设置强制更新,在某些潜规则下也不一定能强制更新,如GM等)
-    @param isCheckRule 是否检查战力范围更新差值
-    @return True-可更新 
-    '''
-    if fightPower <= 0:
-        return False
-    
-    historyFightPower = curPlayer.NomalDictGetProperty(key, 0, ChConfig.Def_PDictType_FightPower)
-    if key2 != None:
-        historyFightPower += curPlayer.NomalDictGetProperty(key2, 0, ChConfig.Def_PDictType_FightPower) * ChConfig.Def_PerPointValue
-        
-    if not __CanPlayerBillboardComm(curPlayer):
-        return False
-    
-    if isForceUpdate:
-        GameWorld.DebugLog("战斗力更新检查:强制更新 key=%s,fightPower=%s,history=%s" 
-                           % (key, fightPower, historyFightPower), curPlayer.GetPlayerID())
-        return True
-    
-    if fightPower == historyFightPower:
-        GameWorld.DebugLog("战斗力更新检查:与上次相同,默认不更新 key=%s,fightPower=%s,history=%s" 
-                           % (key, fightPower, historyFightPower), curPlayer.GetPlayerID())
-        return False
-    
-    return True
-
-def UpdateHorseBillboard(curPlayer, isForceUpdate=False, isUpdateTotal=True):
-    ##更新玩家坐骑排行榜
-    
-    HorseFightPower = PlayerControl.GetMFPFightPower(curPlayer, ShareDefine.Def_MFPType_Horse)
-    if not HorseFightPower:
-        return
-    
-    fightPower = HorseFightPower % ChConfig.Def_PerPointValue
-    fightPowerEx = HorseFightPower / ChConfig.Def_PerPointValue
-    
-    UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FightPower_Horse, fightPowerEx, fightPower)
-    
-    if isUpdateTotal:
-        UpdatePlayerFPTotalBillboard(curPlayer, isForceUpdate)
     return
 
 def UpdatePyPetBillboard(curPlayer, isForceUpdate=False, isUpdateTotal=True):
     ## 更新宠物排行榜
-    petMaxAtk = PlayerControl.GetPetMaxAtk(curPlayer)
-    if not petMaxAtk:
-        return
-    UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FightPower_Pet, petMaxAtk) 
-       
-    if isUpdateTotal:
-        UpdatePlayerFPTotalBillboard(curPlayer, isForceUpdate)
-    return
-
-def UpdatePlayerLVBillboard(curPlayer, isForceUpdate=True):
-    ##更新玩家等级排行榜
-    UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_LV, curPlayer.GetLV())
-    return
-
-def UpdateRuneTowerBillboard(curPlayer):
-    ##更新玩家符印塔排行榜
-    passLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV)
-    if not passLV:
-        return
-    UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_TrialTower, passLV) 
     return
 
 def UpdateRealmBillboard(curPlayer):
     ##境界榜
-    if not curPlayer.GetOfficialRank():
-        return
-    UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_Realm, curPlayer.GetOfficialRank())
     return
 
-def __CanPlayerBillboardComm(curPlayer):
-    ## 玩家可否上榜通用检查
-    if not GameWorld.IsNormalPlayer(curPlayer):
-        return False
-    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Billboard):
-        GameWorld.DebugLog("排行榜未开启,无法上榜!curLV=%s" % (curPlayer.GetLV()), curPlayer.GetPlayerID())
-        return False
-    
-    return True
+#def __CanPlayerBillboardComm(curPlayer):
+#    ## 玩家可否上榜通用检查
+#    if not GameWorld.IsNormalPlayer(curPlayer):
+#        return False
+#    #if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Billboard):
+#    #    GameWorld.DebugLog("排行榜未开启,无法上榜!curLV=%s" % (curPlayer.GetLV()), curPlayer.GetPlayerID())
+#    #    return False
+#    
+#    return True
 
-def UpdatePlayerBillboard(curPlayer, bType, cmpValue, cmpValue2=0, cmpValue3=0, value1=0, value2=0, autoSort=False, **kwargs):
+def UpdatePlayerBillboard(curPlayer, bType, cmpValue, cmpValue2=0, cmpValue3=0, autoSort=False, **kwargs):
     ## 更新玩家排行榜
     
     #if not cmpValue and not cmpValue2 and not cmpValue3:
     #    return
     
-    if not __CanPlayerBillboardComm(curPlayer):
-        return
-    
     playerJob = GetBillboardJob(curPlayer)
     playerID = curPlayer.GetID()
-    playerName = curPlayer.GetName()
+    playerName = curPlayer.GetPlayerName()
     playerOpInfo = GetBillboardOperateInfo(curPlayer)
+    value1 = curPlayer.GetOfficialRank()
+    value2 = PlayerControl.GetTitleID(curPlayer)
     kwargs["value3"] = curPlayer.GetFace()
     kwargs["value4"] = curPlayer.GetFacePic()
-    if bType in ShareDefine.BTValue1_OfficialRankList:
-        value1 = curPlayer.GetOfficialRank()
-        
+    kwargs["value5"] = curPlayer.GetModelMark()
+    kwargs["value6"] = curPlayer.GetEquipShowSwitch()
+    
     groupValue1 = 0
     UpdateBillboard(bType, groupValue1, playerID, playerName, playerOpInfo, playerJob, value1, value2, 
                     cmpValue, cmpValue2, cmpValue3, autoSort=autoSort, **kwargs)
     return
 
+def UpdateBillboardByID(dataID, billboardType, cmpValue, cmpValue2=0, cmpValue3=0, autoSort=False):
+    ## 直接根据榜单ID修改榜单排行相关值,其他值不修改
+    if GameWorld.IsCrossServer():
+        if billboardType not in ShareDefine.CrossBillboardTypeList:
+            return
+    else:
+        if billboardType not in ShareDefine.BillboardTypeList:
+            return
+        
+    if not dataID:
+        return
+    
+    groupValue1, groupValue2 = 0, 0
+    billboardMgr = DBDataMgr.GetBillboardMgr()
+    billboardObj = billboardMgr.GetBillboard(billboardType, groupValue1, groupValue2)
+    billboardData = billboardObj.FindByID(dataID)
+    if not billboardData:
+        return
+    
+    isNewData = False
+    cmpValueChange = isNewData or billboardData.GetCmpValue() != cmpValue or billboardData.GetCmpValue2() != cmpValue2 \
+        or (cmpValue3 and billboardData.GetCmpValue3() != cmpValue3)
+        
+    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)
+    if not autoSort:
+        if isNewData or cmpValueChange:
+            billboardObj.SetSortDelay()
+    else:
+        billboardObj.SortData()
+    return True
+
 def UpdateBillboard(billboardType, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue,
                     cmpValue2=0, cmpValue3=0, groupValue2=0, id2=0, autoSort=True, **kwargs):
-    ''' 更新跨服排行榜
+    ''' 更新排行榜
     @param billboardType: 排行榜索引类型,同个榜单类型可以有多个分组榜单数据,独立排序
     @param groupValue1: 榜单分组1
     @param dataID: 榜单唯一数据ID,如玩家ID等
@@ -276,22 +211,13 @@
             billboardData = lastBillBoardData
             billboardData.Clear()
         else:
-            billboardData = billboardObj.AddNewBillboardData()
+            billboardData = billboardObj.AddNewBillboardData(dataID)
             if not billboardData:
                 return
             
     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)
@@ -313,8 +239,10 @@
     billboardData.SetCmpValue(cmpValue)
     billboardData.SetCmpValue2(cmpValue2)
     billboardData.SetCmpValue3(cmpValue3)
-    
-    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" 
+    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)
     if not autoSort:

--
Gitblit v1.8.0