From a7bd2045e99da9faa23aa2296e5b161cffc2194f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 23 五月 2022 17:00:19 +0800
Subject: [PATCH] 9415 【BT】【后端】古神战场(击杀守卫增加个人积分)
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py | 42 +++++++++++++++++++++++++++++++++---------
1 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
index 86b653f..b98a550 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
@@ -628,16 +628,16 @@
return
curFactionCount, othFactionCount = 0, 0
- for callPlayerID, buyRec in buyPlayerInfo.items():
+ for _, buyRec in buyPlayerInfo.items():
if buyRec.factionID == faction:
curFactionCount += 1
else:
othFactionCount += 1
- if playerID in buyRec.callPlayerIDList:
- GameWorld.Log("玩家已经在该召集场次阵营里! zoneID=%s,openHour=%s,openMinute=%s,callPlayerID=%s,callPlayerIDList=%s"
- % (zoneID, openHour, openMinute, callPlayerID, buyRec.callPlayerIDList), playerID)
- return
+# if playerID in buyRec.callPlayerIDList:
+# GameWorld.Log("玩家已经在该召集场次阵营里! zoneID=%s,openHour=%s,openMinute=%s,callPlayerID=%s,callPlayerIDList=%s"
+# % (zoneID, openHour, openMinute, callPlayerID, buyRec.callPlayerIDList), playerID)
+# return
if curFactionCount > othFactionCount:
GameWorld.Log("阵营平衡限制,不可再购买该跨服战场阵营! zoneID=%s,openHour=%s,openMinute=%s,faction=%s,curFactionCount(%s) > othFactionCount(%s)"
@@ -667,6 +667,8 @@
buyRec.callPlayerIDList = [playerID]
buyPlayerInfo[playerID] = buyRec
+ GameWorld.DebugLog("玩家购买开启召集场次! zoneID=%s,openHour=%s,openMinute=%s" % (zoneID, openHour, openMinute), playerID)
+
# 上榜
billboardCallCountLimit = IpyGameDataPY.GetFuncCfg("CrossBattlefieldBillboard", 1) # 周召集榜上榜至少次数
groupValue1, dataID, name1, name2 = zoneID, playerID, playerName, ""
@@ -675,6 +677,13 @@
if cmpValue >= billboardCallCountLimit:
CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_BattlefieldWCall, groupValue1, dataID, name1, name2, type2, value1, value2, cmpValue)
+ for otherBuyPlayerID, otherRec in buyPlayerInfo.items():
+ if otherBuyPlayerID == playerID:
+ continue
+ if playerID in otherRec.callPlayerIDList:
+ otherRec.callPlayerIDList.remove(playerID)
+ GameWorld.DebugLog(" 从已加入的其他召集队伍移除: otherBuyPlayerID=%s,playerID=%s" % (otherBuyPlayerID, playerID), playerID)
+
SyncMapServerCrossBattlefieldBuyInfo()
# 通知子服
@@ -699,6 +708,9 @@
hmNum = GetHMNum(openHour, openMinute)
buyPlayerInfo = GetBuyPlayerInfo(zoneID, hmNum)
+ if tagPlayerID in buyPlayerInfo:
+ GameWorld.ErrLog("玩家已购买该场次召集队伍,无法加入其他召集队伍! hmNum=%s,tagPlayerID=%s in %s" % (hmNum, tagPlayerID, buyPlayerInfo.keys()), playerID)
+ return
if buyPlayerID not in buyPlayerInfo:
GameWorld.ErrLog("跨服战场不存在该玩家的召集队伍! hmNum=%s,buyPlayerID=%s" % (hmNum, buyPlayerID), playerID)
return
@@ -709,9 +721,19 @@
GameWorld.ErrLog("跨服战场召集人数已满! hmNum=%s,buyPlayerID=%s,callPlayerIDList=%s" % (hmNum, buyPlayerID, buyRec.callPlayerIDList), playerID)
return
+ GameWorld.DebugLog("玩家加入召集队伍! zoneID=%s,openHour=%s,openMinute=%s,buyPlayerID=%s,tagPlayerID=%s"
+ % (zoneID, openHour, openMinute, buyPlayerID, tagPlayerID), playerID)
+
if tagPlayerID not in buyRec.callPlayerIDList:
buyRec.callPlayerIDList.append(tagPlayerID)
+ for otherBuyPlayerID, otherRec in buyPlayerInfo.items():
+ if otherBuyPlayerID == buyPlayerID:
+ continue
+ if tagPlayerID in otherRec.callPlayerIDList:
+ otherRec.callPlayerIDList.remove(tagPlayerID)
+ GameWorld.DebugLog(" 从已加入的其他召集队伍移除: otherBuyPlayerID=%s,tagPlayerID=%s" % (otherBuyPlayerID, tagPlayerID), playerID)
+
SyncMapServerCrossBattlefieldBuyInfo()
serverGroupIDList = zoneIpyData.GetServerGroupIDList()
@@ -746,6 +768,9 @@
return
buyRec.callPlayerIDList.remove(tagPlayerID)
+ GameWorld.DebugLog("玩家召集队伍踢人! zoneID=%s,openHour=%s,openMinute=%s,buyPlayerID=%s,tagPlayerID=%s"
+ % (zoneID, openHour, openMinute, buyPlayerID, tagPlayerID), playerID)
+
SyncMapServerCrossBattlefieldBuyInfo()
serverGroupIDList = zoneIpyData.GetServerGroupIDList()
@@ -756,8 +781,7 @@
def MapServer_CrossBattlefieldOver(msgList):
## 跨服战场地图结算
overTime = int(time.time())
- hmNum = GetCrossBattlefieldState()
- fbPropertyID, zoneID, funcLineID, winnerFaction, superItemInfo, finalSuperItemPlayerID, finalSuperItemPlayerName, superItemPlayerIDList, scoreKingID, scoreKingName, battlePlayerList = msgList
+ hmNum, fbPropertyID, zoneID, funcLineID, winnerFaction, superItemInfo, finalSuperItemPlayerID, finalSuperItemPlayerName, superItemPlayerIDList, scoreKingID, scoreKingName, battlePlayerList = msgList
GameWorld.Log("跨服战场地图同步结果: hmNum=%s,zoneID=%s,funcLineID=%s,winnerFaction=%s,superItemInfo=%s,finalSuperItemPlayerID=%s,superItemPlayerIDList=%s,scoreKingID=%s,battlePlayerCount=%s"
% (hmNum, zoneID, funcLineID, winnerFaction, superItemInfo, finalSuperItemPlayerID, superItemPlayerIDList, scoreKingID, len(battlePlayerList)), fbPropertyID)
@@ -851,7 +875,7 @@
nextBattleTimeStr = "%02d:%02d" % (nextOpenHour, nextOpenMinute)
# 本分区全服:XX阵营胜利,xxx为本场积分王,xxx获得了古神大奖XXX,下个场次预计将在XX点开放。
- if battlePlayerList:
+ if finalSuperItemPlayerName:
msgParamList = [winnerFaction, scoreKingName, finalSuperItemPlayerName, superItemID, superItemCount, nextBattleTimeStr]
PlayerControl.WorldNotifyCross(serverGroupIDList, 0, "CrossBattlefieldOver", msgParamList)
return
@@ -1082,7 +1106,7 @@
openMinute = clientData.Minute
tagPlayerID = clientData.TagPlayerID
buyPlayerID = playerID
-
+ GameWorld.DebugLog("召集场次踢人: tagPlayerID=%s,openHour=%s,openMinute=%s" % (tagPlayerID, openHour, openMinute), playerID)
if buyPlayerID == tagPlayerID:
return
--
Gitblit v1.8.0