| | |
| | |
|
| | | 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)
|