From d8fac1acbf1659c5d2ff67d95f98520d557fd9cf Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 02 十二月 2024 11:34:54 +0800
Subject: [PATCH] 5416 【工具】兑换码优化(兑换码邮件内容文件json支持不同的appID独立文件配置;)

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossChampionship.py |   72 +++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossChampionship.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossChampionship.py
index 3537914..1dc3178 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossChampionship.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossChampionship.py
@@ -29,6 +29,7 @@
 import PlayerControl
 import PyDataManager
 import NetPackCommon
+import GameXiangong
 import GameWorship
 import PyGameData
 import ChConfig
@@ -70,10 +71,11 @@
 跨服排位争霸赛最终排名官职信息
 ShareDefine.Def_UniversalGameRecType_CrossChampionshipOfficial
 time:time                上一次辞退下级仙官时间
-value1:zoneID官职ID      官职ID*10 + 分区ID
+value1:官职ID            官职ID
 value2:playerID          玩家ID,可能为0
 value3:worshipValue      被膜拜次数*10 + 是否双倍
 value4:rank              排名
+value5:zoneID            分区ID
 StrValue3:               [申请该官职玩家ID,...]
 '''
 
@@ -81,7 +83,8 @@
 '''
 跨服排位争霸赛官职挑战信息
 ShareDefine.Def_UniversalGameRecType_CrossChampionshipOffChallenge
-value1:zoneID官职ID      官职ID*10 + 分区ID
+value1:官职ID             官职ID
+value2:zoneID            分区ID
 StrValue3:               {挑战玩家信息key:value, ...}
 '''
 
@@ -111,6 +114,8 @@
         self.lv = 0
         self.fightPower = 0
         self.realmLV = 0
+        self.face = 0
+        self.facePic = 0
         return
     
     def GetString(self):
@@ -125,9 +130,11 @@
                 playerShortInfo["LV"] = cacheDict.get("LV", 1)
                 playerShortInfo["FightPower"] = cacheDict.get("FightPower", 0)
                 playerShortInfo["RealmLV"] = cacheDict.get("RealmLV", 0)
+                playerShortInfo["Face"] = cacheDict.get("Face", 0)
+                playerShortInfo["FacePic"] = cacheDict.get("FacePic", 0)
                 self.applyPlayerInfo[applyPlayerID] = playerShortInfo
         return {"zoneID":self.zoneID, "officialID":self.officialID, "lastDismissJuniorTime":self.lastDismissJuniorTime,
-                "accID":self.accID, "playerID":self.playerID, "playerName":self.playerName,
+                "accID":self.accID, "playerID":self.playerID, "playerName":self.playerName, "face":self.face, "facePic":self.facePic,
                 "job":self.job, "lv":self.lv, "fightPower":self.fightPower, "realmLV":self.realmLV, "rank":self.rank,
                 "worshipCount":self.worshipCount, "applyPlayerInfo":self.applyPlayerInfo, "challengeList":self.challengeList,
                 "worshipDouble":self.worshipDouble
@@ -207,11 +214,13 @@
         self.lv = 0
         self.fightPower = 0
         self.realmLV = 0
+        self.face = 0
+        self.facePic = 0
         return
     
     def GetString(self):
         return {"zoneID":self.zoneID, "accID":self.accID, "playerID":self.playerID, "playerName":self.playerName,
-                "job":self.job, "lv":self.lv, "fightPower":self.fightPower, "realmLV":self.realmLV}
+                "job":self.job, "lv":self.lv, "fightPower":self.fightPower, "realmLV":self.realmLV, "face":self.face, "facePic":self.facePic}
     
     def SetAttr(self, attrDict):
         for k, v in attrDict.items():
@@ -343,6 +352,8 @@
         obj.lv = cacheDict.get("LV", obj.lv)
         obj.fightPower = cacheDict.get("FightPower", obj.fightPower)
         obj.realmLV = cacheDict.get("RealmLV", obj.realmLV)
+        obj.face = cacheDict.get("Face", obj.face)
+        obj.facePic = cacheDict.get("FacePic", obj.facePic)
         
     return
 
@@ -505,9 +516,8 @@
     for index in xrange(officialRecDataList.Count()):
         recData = officialRecDataList.At(index)
         lastDismissJuniorTime = recData.GetTime()
-        value1 = recData.GetValue1()
-        officialID = value1 / 10
-        zoneID = value1 % 10
+        officialID = recData.GetValue1()
+        zoneID = recData.GetValue5()
         playerID = recData.GetValue2()
         worshipValue = recData.GetValue3()
         worshipCount = worshipValue / 10
@@ -538,9 +548,8 @@
     GameWorld.Log("加载跨服排位官职挑战记录信息! %s" % challengeRecDataList.Count())
     for index in xrange(challengeRecDataList.Count()):
         recData = challengeRecDataList.At(index)
-        value1 = recData.GetValue1()
-        officialID = value1 / 10
-        zoneID = value1 % 10
+        officialID = recData.GetValue1()
+        zoneID = recData.GetValue2()
         strValue3 = recData.GetStrValue3()
         if not strValue3:
             continue
@@ -632,22 +641,23 @@
             offObj = offZoneMgr.GetOfficialObj(officialID)
             if not offObj:
                 continue
-            value1 = offObj.officialID * 10 + zoneID
             recData = officialRecDataList.AddRec()
             recData.SetTime(offObj.lastDismissJuniorTime)
-            recData.SetValue1(value1)
+            recData.SetValue1(officialID)
             recData.SetValue2(offObj.playerID)
             recData.SetValue3(offObj.worshipCount * 10 + offObj.worshipDouble)
             recData.SetValue4(offObj.rank)
+            recData.SetValue5(zoneID)
             strValue3 = "%s" % offObj.applyPlayerInfo.keys()
             strValue3 = strValue3.replace(" ", "")
             recData.SetStrValue3(strValue3)
             
-            #GameWorld.Log("        zoneID=%s,officialID=%s,playerID=%s,rank=%s,challengeCount=%s" 
-            #              % (zoneID, officialID, offObj.playerID, offObj.rank, len(offObj.challengeList)))
+            GameWorld.Log("        zoneID=%s,officialID=%s,playerID=%s,rank=%s,challengeCount=%s" 
+                          % (zoneID, officialID, offObj.playerID, offObj.rank, len(offObj.challengeList)))
             for challengeDict in offObj.challengeList:
                 challRecData = challengeRecDataList.AddRec()
-                challRecData.SetValue1(value1)
+                challRecData.SetValue1(officialID)
+                challRecData.SetValue2(zoneID)
                 strValue3 = str(challengeDict)
                 strValue3 = strValue3.replace(" ", "")
                 challRecData.SetStrValue3(strValue3)
@@ -1394,7 +1404,7 @@
             
             # 添加开启分线数据
             realMapID = mapID
-            copyMapObj = PlayerFB.CrossCopyMapInfo(zoneID, 0)
+            copyMapObj = PlayerFB.CrossCopyMapInfo(zoneID, ChConfig.Def_FBMapID_CrossChampionship, 0)
             copyMapObj.realMapID = realMapID
             copyMapObj.copyMapID = copyMapID
             key = (realMapID, copyMapID)
@@ -1953,9 +1963,14 @@
     pkZoneIDList = champMgr.GetChampPKZoneIDList()
     GameWorld.Log("pkZoneIDList=%s" % pkZoneIDList)
     
-    worshipList = []
+    syncNewWorshipList = []
+    syncNewXiangongDict = {}
+    crossZoneName = GameWorld.GetCrossZoneName()
     for zoneID in pkZoneIDList:
         GameWorld.Log("=== 结算排位分区: zoneID=%s ===" % zoneID, zoneID)
+        zoneIpyData = IpyGameDataPY.GetIpyGameData("CrossZonePK", crossZoneName, zoneID)
+        serverIDRangeList = zoneIpyData.GetServerGroupIDList() if zoneIpyData else []
+        
         finalPlayerIDList = []
         pkZoneMgr = champMgr.GetChampPKZoneMgr(zoneID)
         if not pkZoneMgr:
@@ -1985,8 +2000,9 @@
             rankIpyData = IpyGameDataPY.GetIpyGameData("ChampionshipRank", rank)
             officialID = rankIpyData.GetMainOfficialID() if rankIpyData else 0
             rankAwardItemList = rankIpyData.GetRankAwardItemList() if rankIpyData else []
-            GameWorld.Log("    最终排名: zoneID=%s,rank=%s,playerID=%s,officialID=%s,rankAwardItemList=%s,accID=%s,fightPower=%s" 
-                          % (zoneID, rank, playerID, officialID, rankAwardItemList, accID, fightPower), zoneID)
+            xiangongID = rankIpyData.GetXiangongID() if rankIpyData else 0
+            GameWorld.Log("    最终排名: zoneID=%s,rank=%s,playerID=%s,officialID=%s,xiangongID=%s,rankAwardItemList=%s,accID=%s,fightPower=%s" 
+                          % (zoneID, rank, playerID, officialID, xiangongID, rankAwardItemList, accID, fightPower), zoneID)
             
             if officialID:
                 offObj = ChampionshipOfficial()
@@ -1997,14 +2013,13 @@
                 
                 offZoneMgr.officialInfo[officialID] = offObj
                 
-                worshipValue = rank
-                if GameWorship.GetWorshipIpyData(worshipType, worshipValue):
-                    worshipData = GameWorship.AddWorshipPlayer(playerID, worshipType, worshipValue, zoneID=zoneID, isNotify=False)
-                    worshipList.append(worshipData)
-                    
+                
             # 名次奖励
             paramList = [rank]
             PlayerCompensation.SendMailByKey("CrossChampionshipPKRank", [playerID], rankAwardItemList, paramList, crossMail=True)
+            
+            GameXiangong.AddXiangongPlayer(xiangongID, playerID, serverIDRangeList, rank, syncNewXiangongDict)
+            GameWorship.AddWorshipPlayer(worshipType, rank, playerID, serverIDRangeList, syncNewWorshipList)
             
         # 处理4强竞猜发奖励
         guessType = 4
@@ -2046,7 +2061,8 @@
     PlayerControl.WorldNotifyCross(serverGroupIDList, 0, "ChampionshipOver")
     
     # 通知新添加的膜拜
-    GameWorship.SyncAddCrossWorship(worshipList)
+    GameWorship.SendNewWorshipPlayer(syncNewWorshipList)
+    GameXiangong.SendNewXiangongPlayerToClientServer(syncNewXiangongDict)
     GameWorld.Log("===================================================================")
     return
 
@@ -2955,6 +2971,8 @@
         playerPack.FightPower = batPlayer.fightPower % ShareDefine.Def_PerPointValue
         playerPack.FightPowerEx = batPlayer.fightPower / ShareDefine.Def_PerPointValue
         playerPack.RealmLV = batPlayer.realmLV
+        playerPack.Face = batPlayer.face
+        playerPack.FacePic = batPlayer.facePic
         clientPack.PlayerList.append(playerPack)
     clientPack.PlayerCount = len(clientPack.PlayerList)
     
@@ -3114,6 +3132,8 @@
         offPlayer.FightPower = offObj.fightPower % ShareDefine.Def_PerPointValue
         offPlayer.FightPowerEx = offObj.fightPower / ShareDefine.Def_PerPointValue
         offPlayer.RealmLV = offObj.realmLV
+        offPlayer.Face = offObj.face
+        offPlayer.FacePic = offObj.facePic
         
         offPack = ChPyNetSendPack.tagGCChampionshipOfficial()
         offPack.OfficialID = officialID
@@ -3133,6 +3153,8 @@
             applyPlayer.FightPower = fightPower % ShareDefine.Def_PerPointValue
             applyPlayer.FightPowerEx = fightPower / ShareDefine.Def_PerPointValue
             applyPlayer.RealmLV = playerInfo.get("RealmLV", 1)
+            applyPlayer.Face = playerInfo.get("Face", 0)
+            applyPlayer.FacePic = playerInfo.get("FacePic", 0)
             
             offPack.ApplyPlayerList.append(applyPlayer)
         offPack.ApplyPlayerCount = len(offPack.ApplyPlayerList)

--
Gitblit v1.8.0