From 7cda738936cee0049a343ff13279a94fa7816c16 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 23 五月 2022 17:00:22 +0800
Subject: [PATCH] 9415 【BT】【后端】古神战场(同场次提前结算的玩家无法再进入;优化无法进入系统提示;增加开启X分钟后无法进入;优化复活坐标)
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py | 58 +++++++++++++++++++++++++++--
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py | 2 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py | 8 ++--
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py | 5 +-
4 files changed, 62 insertions(+), 11 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
index b10f6c7..92885cf 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py
@@ -396,6 +396,7 @@
if openDateTime <= curDateTime < closeDateTime:
battlefieldState = openHour * 100 + openMinute
+ PyGameData.g_openDateTime = openDateTime
stateKey = ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_CrossBattlefield
gameWorld = GameWorld.GetGameWorld()
@@ -413,6 +414,8 @@
if battlefieldState and beforeState != battlefieldState:
# 移除已经存在的副本线路
PyGameData.g_crossDynamicLineInfo.pop(ChConfig.Def_FBMapID_CrossBattlefield, None)
+
+ PyGameData.g_overPlayerIDList = []
crossZoneName = GameWorld.GetCrossZoneName()
crossZoneList = IpyGameDataPY.GetIpyGameDataByCondition("CrossZonePK", {"CrossZoneName":crossZoneName}, True)
@@ -511,18 +514,27 @@
return
-def GetCrossBattlefieldOpenTime(zoneID):
+def GetCrossBattlefieldOpenTime(serverGroupID, zoneID, playerID):
## 获取跨服战场副本当前是否开放的时间点
# @return: None-当前未开放;
- # @return: hour, minute - 当前开放中的时间时分,可进入
+ # @return: isCallBattle, openHour, openMinute - 当前开放中的时间时分,可进入
gameWorld = GameWorld.GetGameWorld()
hmNum = GetCrossBattlefieldState()
if not hmNum:
+ GameWorld.Log("当前时间战场未开启!", playerID)
+ PlayerControl.NotifyCodeCross(serverGroupID, playerID, "FBIsNotOpen")
return
seasonState = gameWorld.GetDictByKey(ChConfig.Def_WorldKey_CrossPKZoneSeasonState % zoneID)
if seasonState != 1:
+ GameWorld.Log("赛季未开启!", playerID)
+ PlayerControl.NotifyCodeCross(serverGroupID, playerID, "NotifySeasonOver")
+ return
+
+ if playerID in PyGameData.g_overPlayerIDList:
+ # 您已经参加过该场次,无法再进入!
+ PlayerControl.NotifyCodeCross(serverGroupID, playerID, "CrossBattlefieldAlreadyJoin")
return
openHour, openMinute = GetHMByNum(hmNum)
@@ -530,12 +542,48 @@
isCallBattle = [openHour, openMinute] not in sysOpenHMList
if isCallBattle:
if zoneID not in PyGameData.g_crossBattlefieldBuyInfo:
- GameWorld.DebugLog("该分区没有使用召集令! zoneID=%s" % zoneID)
+ GameWorld.Log("该分区没有使用召集令! zoneID=%s" % zoneID, playerID)
+ PlayerControl.NotifyCodeCross(serverGroupID, playerID, "FBIsNotOpen")
return
buyHMInfo = PyGameData.g_crossBattlefieldBuyInfo[zoneID]
if hmNum not in buyHMInfo:
- GameWorld.DebugLog("该时段还未使用召集令! zoneID=%s,hmNum=%s" % (zoneID, hmNum))
+ GameWorld.Log("该时段还未使用召集令! zoneID=%s,hmNum=%s" % (zoneID, hmNum), playerID)
+ PlayerControl.NotifyCodeCross(serverGroupID, playerID, "FBIsNotOpen")
return
+
+ # 召集场只有一条线,如果有人结算则代表已经结束了
+ if PyGameData.g_overPlayerIDList:
+ # 该召集场次已结算,无法进入!
+ PlayerControl.NotifyCodeCross(serverGroupID, playerID, "CrossBattlefieldCallOver")
+ return
+
+ if PyGameData.g_openDateTime:
+ serverTime = GameWorld.GetServerTime()
+ passSeconds = (serverTime - PyGameData.g_openDateTime).seconds
+ closeEnterMinutes = IpyGameDataPY.GetFuncCfg("CrossBattlefieldOpen", 5) # 开启X分钟后不可进入,不包含已进入玩家及召集队伍中的玩家
+ closeSeconds = closeEnterMinutes * 60
+ if passSeconds > closeSeconds:
+ GameWorld.DebugLog("迟到了! passSeconds=%s > %s" % (passSeconds, closeSeconds), playerID)
+ isBelate = True
+ for _, copyMapObj in PyGameData.g_crossDynamicLineCopyMapInfo.items():
+ if copyMapObj.IsMustCopyMapPlayer(playerID):
+ isBelate = False
+ GameWorld.DebugLog("已进入的重复进入不限制时间! playerID=%s" % playerID)
+ break
+
+ if isCallBattle:
+ buyPlayerInfo = buyHMInfo[hmNum]
+ for buyRec in buyPlayerInfo.values():
+ if playerID in buyRec.callPlayerIDList:
+ isBelate = False
+ GameWorld.DebugLog("召集令成员不受人时间限制! playerID=%s" % playerID)
+ break
+
+ if isBelate:
+ PlayerControl.NotifyCodeCross(serverGroupID, playerID, "CrossBattlefieldBelate", [closeEnterMinutes])
+ return
+ #else:
+ # GameWorld.DebugLog("没有迟到!passSeconds=%s <= %s" % (passSeconds, closeSeconds), playerID)
return isCallBattle, openHour, openMinute
@@ -804,6 +852,8 @@
factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt \
= playerInfo
+ PyGameData.g_overPlayerIDList.append(playerID)
+
paramList = [rank]
if faction == winnerFaction:
winnerPlayerIDList.append(playerID)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py
index 48853d9..927e896 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py
@@ -168,10 +168,9 @@
pass
elif mapID == ChConfig.Def_FBMapID_CrossBattlefield:
- openTimeInfo = CrossBattlefield.GetCrossBattlefieldOpenTime(zoneID)
+ openTimeInfo = CrossBattlefield.GetCrossBattlefieldOpenTime(serverGroupID, zoneID, playerID)
if not openTimeInfo:
- PlayerControl.NotifyCodeCross(serverGroupID, playerID, "FBIsNotOpen")
- GameWorld.ErrLog("非活动时间或未开启! funcLineID=%s,zoneID=%s" % (funcLineID, zoneID), playerID)
+ #GameWorld.ErrLog("非活动时间或未开启! funcLineID=%s,zoneID=%s" % (funcLineID, zoneID), playerID)
return
dynamicShuntType = DynamicShuntType_Equally
isCallBattle, openHour, openMinute = openTimeInfo
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
index 3e9c217..2338f7c 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
@@ -142,6 +142,8 @@
g_unNotifyPlayerCrossMsgDict = {} # 未通知玩家的跨服命令 {playerID:{msgType:[msgInfo], ...}, ...}
g_crossBattlefieldBuyInfo = {} # 跨服战场购买记录 {zoneID:{hmNum:{playerID:CrossBattlefieldBuy, ...}, ...}, ...}
+g_openDateTime = None # 本场次开启的时间
+g_overPlayerIDList = [] # 本场次已经结算的玩家ID列表
g_familyTalkCache = {} #{familyID:[[time,content,extras],..]}
g_worldTalkCache = [] #[[time,name, playerID, content,extras],..]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
index 4562c7b..e24fc73 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
@@ -966,7 +966,7 @@
factionSafeAreaRandPosList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldFB", 3)
if faction and faction <= len(factionSafeAreaRandPosList):
safePosX, safePosY, _ = factionSafeAreaRandPosList[faction - 1]
- rebornPosList.append([safePosX, safePosY, 3])
+ rebornPosList.append([safePosX, safePosY, 0, 3])
# 包含占领的水晶
if includeCrystal:
@@ -978,12 +978,12 @@
if str(npcID) not in crystalNPCIDPosDict:
continue
posInfo = crystalNPCIDPosDict[str(npcID)]
- rebornPosList.append([posInfo[0], posInfo[1], 3])
+ rebornPosList.append([posInfo[0], posInfo[1], 3, 6])
if not rebornPosList:
return
- randPosX, randPosY, radius = random.choice(rebornPosList)
- posPoint = GameMap.GetEmptyPlaceInArea(randPosX, randPosY, radius)
+ randPosX, randPosY, minDist, maxDist = random.choice(rebornPosList)
+ posPoint = GameMap.GetEmptyPlaceInAreaEx(randPosX, randPosY, minDist, maxDist)
return posPoint.GetPosX(), posPoint.GetPosY()
#def GetFBRobotRandomMovePos(curNPC):
--
Gitblit v1.8.0