9415 【BT】【后端】古神战场(同场次提前结算的玩家无法再进入;优化无法进入系统提示;增加开启X分钟后无法进入;优化复活坐标)
| | |
| | |
|
| | | if openDateTime <= curDateTime < closeDateTime:
|
| | | battlefieldState = openHour * 100 + openMinute
|
| | | PyGameData.g_openDateTime = openDateTime
|
| | |
|
| | | stateKey = ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_CrossBattlefield
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | |
| | | 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)
|
| | |
| | |
|
| | | 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)
|
| | |
| | | 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
|
| | |
|
| | |
| | | factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt \
|
| | | = playerInfo
|
| | |
|
| | | PyGameData.g_overPlayerIDList.append(playerID)
|
| | | |
| | | paramList = [rank]
|
| | | if faction == winnerFaction:
|
| | | winnerPlayerIDList.append(playerID)
|
| | |
| | | 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
|
| | |
| | | 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],..]
|
| | |
| | | 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:
|
| | |
| | | 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):
|