From c8bc62a582c45c87f4695f18e245c15fe5fc2d21 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 12 十月 2024 14:56:30 +0800
Subject: [PATCH] 10202 【越南】【砍树】【英文】聚魂寻宝、古宝寻宝不验证背包空间;
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py | 95 ++++++++++++++++++++++++++++++++++++++---------
1 files changed, 77 insertions(+), 18 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
index 375371e..c2d5655 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
@@ -329,6 +330,7 @@
def OnMapServerInitOK():
# 通知地图服务器状态
SyncMapServerCrossBattlefieldBuyInfo()
+ SyncMapServerCrossBattlefieldSysCallBuyInfo()
return
def SyncMapServerCrossBattlefieldBuyInfo():
@@ -343,6 +345,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 +442,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 +470,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 +561,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
@@ -642,6 +656,49 @@
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)
+
+ # 通知子服
+ 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] = {}
buyHMInfo = PyGameData.g_crossBattlefieldBuyInfo[zoneID]
@@ -671,16 +728,6 @@
return
# ================ 可以购买,以下执行添加购买场次阵营逻辑 ================
-
- # 更新缓存
- 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())
@@ -857,7 +904,7 @@
winnerPlayerIDList, loserPlayerIDList = [], []
for playerInfo in battlePlayerList:
playerID, job, realmLV, name, \
- isWinner, faction, rank, score, highScoreToday, highScoreWeekTotal, enterCountWeek, \
+ isWinner, faction, rank, score, highScoreToday, highScoreWeekTotal, enterCountWeek, teamID, \
isCallOpen, isCalled, killCnt, ckillCntInfo, killBossCnt, killScoreKing, killGuardCnt, auraScore, superItemAwardCnt, \
factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt \
= playerInfo
@@ -895,10 +942,10 @@
cmpValue = highScoreWeekTotal
CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWScore, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue)
- 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 +1026,6 @@
GameWorld.DebugLog("收到跨服服务器同步的战场购买信息: %s" % msgData)
zoneID = msgData["zoneID"]
- syncBuyHMInfo = msgData["syncBuyHMInfo"]
opData = msgData.get("opData", {})
curZoneID = GetCrossBattlefieldZoneID(GameWorld.GetServerGroupID())
@@ -987,6 +1033,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