From 9533849c079ffd9c3f1d8deea86620c1fcae40a3 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 15 一月 2025 14:56:55 +0800
Subject: [PATCH] 10371 【越南】【英文】【BT】【砍树】所有寻宝类型都加上每日寻宝次数上限

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py |  107 ++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 85 insertions(+), 22 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
index 375371e..c3e7baa 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
@@ -24,6 +24,7 @@
 import CrossRealmPlayer
 import PlayerCompensation
 import PlayerViewCache
+import PlayerFuncTeam
 import CrossBillboard
 import IpyGameDataPY
 import NetPackCommon
@@ -252,6 +253,8 @@
                 
             billboardObj.ClearData()
             
+    # 清空队伍
+    PlayerFuncTeam.DelTeamByFunc(ChConfig.Def_FBMapID_CrossBattlefield)
     return
 
 def GetCrossBattlefieldState():
@@ -329,6 +332,7 @@
 def OnMapServerInitOK():
     # 通知地图服务器状态
     SyncMapServerCrossBattlefieldBuyInfo()
+    SyncMapServerCrossBattlefieldSysCallBuyInfo()
     return
 
 def SyncMapServerCrossBattlefieldBuyInfo():
@@ -343,6 +347,11 @@
                 buyInfo[playerID] = {"callPlayerIDList":buyRec.callPlayerIDList, "factionID":buyRec.factionID}
             syncMapBuyInfo[zoneID][hmNum] = buyInfo
     GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_CrossBattlefieldCallTeamInfo, syncMapBuyInfo)
+    return
+
+def SyncMapServerCrossBattlefieldSysCallBuyInfo():
+    syncMapBuyInfo = PyGameData.g_crossBattlefieldSysCallBuyList
+    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_CrossBattlefieldSysCallBuyInfo, syncMapBuyInfo)
     return
 
 def OnMinuteProcess():
@@ -435,7 +444,8 @@
         PyGameData.g_crossDynamicLineInfo.pop(ChConfig.Def_FBMapID_CrossBattlefield, None)
         
         PyGameData.g_overPlayerIDList = []
-            
+        PyGameData.g_crossBattlefieldSysCallBuyList = []
+        
         hmNum = battlefieldState
         openHour, openMinute = GetHMByNum(hmNum)
         sysOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 1)
@@ -462,7 +472,12 @@
                     PlayerFB.OpenCrossDynamicLineBySys(zoneID, ChConfig.Def_FBMapID_CrossBattlefield, funcLineIDList, True)
                 else:
                     GameWorld.Log("    无召集的场次不开分区战场! zoneID=%s" % (zoneID))
-                    
+                 
+    # 关闭
+    #if not battlefieldState and beforeState != battlefieldState:
+    #    # 活动结束清空队伍
+    #    PlayerFuncTeam.DelTeamByFunc(ChConfig.Def_FBMapID_CrossBattlefield)
+        
     # 同步子服务器
     dataMsg = {"battlefieldState":battlefieldState}
     CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_BattlefieldState, dataMsg)
@@ -548,8 +563,9 @@
         if passSeconds > closeSeconds:
             GameWorld.DebugLog("迟到了! passSeconds=%s > %s" % (passSeconds, closeSeconds), playerID)
             isBelate = True
+            #去除新队员进入不受时间限制设定
             for _, copyMapObj in PyGameData.g_crossDynamicLineCopyMapInfo.items():
-                if copyMapObj.IsMustCopyMapPlayer(playerID):
+                if copyMapObj.IsMustCopyMapPlayer(playerID, False):
                     isBelate = False
                     GameWorld.DebugLog("已进入的重复进入不限制时间!  playerID=%s" % playerID)
                     break
@@ -639,8 +655,53 @@
     openMinute = msgData["openMinute"]
     faction = msgData["faction"]
     serverOnly = msgData.get("serverOnly", 0)
+    face = msgData.get("face", 0)
+    facePic = msgData.get("facePic", 0)
     
     hmNum = GetHMNum(openHour, openMinute)
+    
+    # 更新缓存
+    curCache = PlayerViewCache.FindViewCache(playerID, True)
+    if curCache:
+        cacheDict = PlayerViewCache.GetCachePropDataDict(curCache)
+        cacheDict["Name"] = playerName
+        cacheDict["Job"] = job
+        cacheDict["LV"] = playerLV
+        cacheDict["RealmLV"] = realmLV
+        cacheDict["FightPower"] = fightPower    
+        
+    sysOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 1)
+    if [openHour, openMinute] in sysOpenHMList:
+        if playerID in PyGameData.g_crossBattlefieldSysCallBuyList:
+            GameWorld.Log("玩家已经购买过该系统场次! zoneID=%s,openHour=%s,openMinute=%s" % (zoneID, openHour, openMinute), playerID)
+            return
+        PyGameData.g_crossBattlefieldSysCallBuyList.append(playerID)
+        
+        buyTime = int(time.time())
+        GameWorld.DebugLog("玩家购买系统召集场次! zoneID=%s,openHour=%s,openMinute=%s" % (zoneID, openHour, openMinute), playerID)
+        
+        # 上榜
+        billboardCallCountLimit = IpyGameDataPY.GetFuncCfg("CrossBattlefieldBillboard", 1) # 周召集榜上榜至少次数
+        groupValue1, dataID, name1, name2 = zoneID, playerID, playerName, ""
+        type2, value1, value2 = job, realmLV, 0
+        cmpValue = buyOpenCountWeek + 1
+        if cmpValue >= billboardCallCountLimit:
+            CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWCall, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue, value3=face, value4=facePic)            
+        
+        # 通知子服
+        serverGroupIDList = [serverGroupID]
+        msgData.update({"opType":"SysCallBuy", "buyTime":buyTime})
+        sendMsg = {"zoneID":zoneID, "SysCallBuyPlayerID":playerID, "opData":msgData}
+        CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_BattlefieldBuy, sendMsg, serverGroupIDList)
+        
+        SyncMapServerCrossBattlefieldSysCallBuyInfo()
+        
+        buyPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
+        if buyPlayer:
+            sendCMD = str(["SysCallBuy", PyGameData.g_crossBattlefieldSysCallBuyList])
+            GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, buyPlayer.GetPlayerID(), buyPlayer.GetRealMapID(), 
+                                                               "CrossBattlefield", sendCMD, len(sendCMD), buyPlayer.GetRouteServerIndex())
+        return
     
     if zoneID not in PyGameData.g_crossBattlefieldBuyInfo:
         PyGameData.g_crossBattlefieldBuyInfo[zoneID] = {}
@@ -672,16 +733,6 @@
     
     # ================ 可以购买,以下执行添加购买场次阵营逻辑  ================
     
-    # 更新缓存
-    curCache = PlayerViewCache.FindViewCache(playerID, True)
-    if curCache:
-        cacheDict = PlayerViewCache.GetCachePropDataDict(curCache)
-        cacheDict["Name"] = playerName
-        cacheDict["Job"] = job
-        cacheDict["LV"] = playerLV
-        cacheDict["RealmLV"] = realmLV
-        cacheDict["FightPower"] = fightPower        
-    
     # 新增场次购买记录
     buyTime = int(time.time())
     buyRec = CrossBattlefieldBuy()
@@ -703,7 +754,7 @@
     type2, value1, value2 = job, realmLV, 0
     cmpValue = buyOpenCountWeek + 1
     if cmpValue >= billboardCallCountLimit:
-        CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWCall, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue)
+        CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWCall, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue, value3=face, value4=facePic)
         
     for otherBuyPlayerID, otherRec in buyPlayerInfo.items():
         if otherBuyPlayerID == playerID:
@@ -856,8 +907,8 @@
     syncPlayerDataInfo = {}
     winnerPlayerIDList, loserPlayerIDList = [], []
     for playerInfo in battlePlayerList:
-        playerID, job, realmLV, name, \
-            isWinner, faction, rank, score, highScoreToday, highScoreWeekTotal, enterCountWeek, \
+        playerID, job, face, facePic, realmLV, name, \
+            isWinner, faction, rank, score, highScoreToday, highScoreWeekTotal, enterCountWeek, teamID, \
             isCallOpen, isCalled, killCnt, ckillCntInfo, killBossCnt, killScoreKing, killGuardCnt, auraScore, superItemAwardCnt, \
             factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt \
                 = playerInfo
@@ -886,19 +937,19 @@
         enterCountWeek += 1
         cmpValue = enterCountWeek
         if cmpValue >= billboardEnterCountLimit:
-            CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWJoin, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue)
+            CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWJoin, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue, value3=face, value4=facePic)
             
         # 更新周高分榜单
         if score > highScoreToday:
             highScoreWeekTotal += (score - highScoreToday)
             highScoreToday = score
             cmpValue = highScoreWeekTotal
-            CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWScore, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue)
+            CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWScore, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue, value3=face, value4=facePic)
             
-        GameWorld.Log("    战场阵营玩家: faction=%s,isWinner=%s,rank=%s,playerID=%s,score=%s,highScoreToday=%s,highScoreWeekTotal=%s,enterCountWeek=%s,isCallOpen=%s,isCalled=%s" 
-                      % (faction, isWinner, rank, playerID, score, highScoreToday, highScoreWeekTotal, enterCountWeek, isCallOpen, isCalled), fbPropertyID)
+        GameWorld.Log("    战场阵营玩家: faction=%s,isWinner=%s,rank=%s,playerID=%s,score=%s,highScoreToday=%s,highScoreWeekTotal=%s,enterCountWeek=%s,teamID=%s,isCallOpen=%s,isCalled=%s" 
+                      % (faction, isWinner, rank, playerID, score, highScoreToday, highScoreWeekTotal, enterCountWeek, teamID, isCallOpen, isCalled), fbPropertyID)
         
-        syncPlayerDataInfo[playerID] = [isWinner, faction, rank, score, highScoreToday, highScoreWeekTotal, enterCountWeek,
+        syncPlayerDataInfo[playerID] = [isWinner, faction, rank, score, highScoreToday, highScoreWeekTotal, enterCountWeek, teamID,
                                         isCallOpen, isCalled, killCnt, ckillCntInfo, killBossCnt, killScoreKing, killGuardCnt, auraScore, superItemAwardCnt, 
                                         factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt]
         
@@ -979,7 +1030,6 @@
     GameWorld.DebugLog("收到跨服服务器同步的战场购买信息: %s" % msgData)
     
     zoneID = msgData["zoneID"]
-    syncBuyHMInfo = msgData["syncBuyHMInfo"]
     opData = msgData.get("opData", {})
     
     curZoneID = GetCrossBattlefieldZoneID(GameWorld.GetServerGroupID())
@@ -987,6 +1037,19 @@
         GameWorld.ErrLog("非本服所属分区的跨服战场购买信息! curZoneID(%s) != zoneID(%s) %s" % (curZoneID, zoneID, str(msgData)))
         return
     
+    if "SysCallBuyPlayerID" in msgData:
+        playerID = msgData["SysCallBuyPlayerID"]
+        if PlayerControl.GetDBPlayerAccIDByID(playerID):
+            openHour = opData["openHour"]
+            openMinute = opData["openMinute"]
+            faction = opData["faction"]
+            buyTime = opData["buyTime"]
+            todayBuyOpenCount = opData["todayBuyOpenCount"]
+            msgInfo = ["BattlefieldBuy", [openHour, openMinute, faction, todayBuyOpenCount, buyTime]]
+            CrossRealmPlayer.MapServer_QueryCrossPlayerResult(playerID, "CrossBattlefield", msgInfo)
+        return
+    
+    syncBuyHMInfo = msgData["syncBuyHMInfo"]
     if not syncBuyHMInfo:
         PyGameData.g_crossBattlefieldBuyInfo.pop(zoneID, None)
         

--
Gitblit v1.8.0