10216 【越南】【港台】【主干】【砍树】古神战场修改(系统场次战场中可购买召集,继承原召集场次效果)
| | |
| | | def OnMapServerInitOK():
|
| | | # 通知地图服务器状态
|
| | | SyncMapServerCrossBattlefieldBuyInfo()
|
| | | SyncMapServerCrossBattlefieldSysCallBuyInfo()
|
| | | return
|
| | |
|
| | | def SyncMapServerCrossBattlefieldBuyInfo():
|
| | |
| | | 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():
|
| | |
| | | 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)
|
| | |
| | |
|
| | | 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]
|
| | |
| | | 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())
|
| | |
| | | GameWorld.DebugLog("收到跨服服务器同步的战场购买信息: %s" % msgData)
|
| | |
|
| | | zoneID = msgData["zoneID"]
|
| | | syncBuyHMInfo = msgData["syncBuyHMInfo"]
|
| | | opData = msgData.get("opData", {})
|
| | |
|
| | | curZoneID = GetCrossBattlefieldZoneID(GameWorld.GetServerGroupID())
|
| | |
| | | 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)
|
| | |
|
| | |
| | | g_unNotifyPlayerCrossMsgDict = {} # 未通知玩家的跨服命令 {playerID:{msgType:[msgInfo], ...}, ...}
|
| | |
|
| | | g_crossBattlefieldBuyInfo = {} # 跨服战场购买记录 {zoneID:{hmNum:{playerID:CrossBattlefieldBuy, ...}, ...}, ...}
|
| | | g_crossBattlefieldSysCallBuyList = [] # 跨服战场系统场次购买召集玩家ID列表 [playerID, ...]
|
| | | g_openDateTime = None # 本场次开启的时间
|
| | | g_overPlayerIDList = [] # 本场次已经结算的玩家ID列表
|
| | |
|
| | |
| | | Def_Notify_WorldKey_LuckyCloudBuyInfo = "LuckyCloudBuyInfo" # 本服幸运云购最新一期信息
|
| | |
|
| | | Def_Notify_WorldKey_CrossBattlefieldCallTeamInfo = "CrossBattlefieldCallTeamInfo" # 跨服战场召集队伍信息
|
| | | Def_Notify_WorldKey_CrossBattlefieldSysCallBuyInfo = "CrossBattlefieldSysCallBuyInfo" # 跨服战场系统场次购买召集信息
|
| | |
|
| | | CrossChampionshipState_Guess8 = 80 #8强竞猜
|
| | | CrossChampionshipState_Group64 = 641 #64强分组
|
| | |
| | | factionInfo = {"faction":self.faction, "score":self.score, "superItemPlayerName":self.superItemPlayerName,
|
| | | "superItemProgress":self.superItemProgress, "factionBuffInfo":self.factionBuffInfo}
|
| | | factionInfo["hurtBossValue"] = self.hurtBossValue
|
| | | |
| | | sysCallBuyIDList = []
|
| | | for playerID in self.factionPlayerDict.keys():
|
| | | if playerID in PyGameData.g_crossBattlefieldSysCallBuyList:
|
| | | sysCallBuyIDList.append(playerID)
|
| | | factionInfo["sysCallBuyIDList"] = sysCallBuyIDList
|
| | | return factionInfo
|
| | |
|
| | | def addSuperItemProgress(self, addProgress):
|
| | |
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)
|
| | | allotPlayerFaction(playerID, fightPower, curPlayer, fbStep, tick)
|
| | |
|
| | | NotifyBattlefieldHelp(True, curPlayer)
|
| | | return
|
| | |
|
| | | def IsSysCallBuyPlayer(playerID):
|
| | | ## 是否系统场次购买召集的玩家
|
| | | return playerID in PyGameData.g_crossBattlefieldSysCallBuyList
|
| | |
|
| | | def OnPlayerSysCallBuy(curPlayer):
|
| | | PlayerControl.FBNotify("CrossBattlefieldSysCallBuy", [curPlayer.GetPlayerName()])
|
| | | NotifyBattlefieldHelp(True, curPlayer)
|
| | | return
|
| | |
|
| | |
| | | GameWorld.DebugLog("玩家击杀对手! playerID=%s,atkFaction=%s,defObjType=%s,defID=%s"
|
| | | % (playerID, atkFaction, defObjType, defID), fbPropertyID)
|
| | |
|
| | | if playerID in worldObj.callOpenPlayerInfo:
|
| | | if playerID in worldObj.callOpenPlayerInfo or IsSysCallBuyPlayer(playerID):
|
| | | callPlayerKillScoreEx = IpyGameDataPY.GetFuncCfg("CrossBattlefieldScoreBase", 4)
|
| | | playerScore += callPlayerKillScoreEx
|
| | | GameWorld.DebugLog(" 召集人额外击杀分: callPlayerKillScoreEx=%s" % callPlayerKillScoreEx, fbPropertyID)
|
| | |
| | | worldObj = GetBattleWorld()
|
| | |
|
| | | # 召集开启的玩家 对 Boss的伤害倍值
|
| | | if playerID in worldObj.callOpenPlayerInfo and npcID == IpyGameDataPY.GetFuncCfg("CrossBattlefieldBoss", 1):
|
| | | if (playerID in worldObj.callOpenPlayerInfo or IsSysCallBuyPlayer(playerID)) \
|
| | | and npcID == IpyGameDataPY.GetFuncCfg("CrossBattlefieldBoss", 1):
|
| | | return IpyGameDataPY.GetFuncCfg("CrossBattlefieldBoss", 4)
|
| | |
|
| | | return 1
|
| | |
| | | serverOnly = clientData.ServerOnly
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | | GameWorld.DebugLog("跨服服务器无法发起匹配!", playerID)
|
| | | GameWorld.DebugLog("跨服服务器无法发起!", playerID)
|
| | | return
|
| | |
|
| | | if not CrossRealmPlayer.IsCrossServerOpen():
|
| | | PlayerControl.NotifyCode(curPlayer, "CrossMatching18")
|
| | | return
|
| | |
|
| | | if faction not in [ChConfig.CampType_Justice, ChConfig.CampType_Evil]:
|
| | | GameWorld.DebugLog("没有该战场阵营选择! faction=%s" % faction, playerID)
|
| | | return
|
| | | |
| | | callOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 2)
|
| | | if [hour, minute] not in callOpenHMList:
|
| | | GameWorld.Log("非可召集的战场场次! hour=%s,minute=%s,callOpenHMList=%s" % (hour, minute, callOpenHMList), playerID)
|
| | | return
|
| | | |
| | | closeBuyMinute = IpyGameDataPY.GetFuncCfg("CrossBattlefieldOpen", 4) # 开启前X分钟后关闭购买
|
| | | crossServerTimeStr = GameWorld.GetCrossServerTimeStr()
|
| | | crossServerDateTime = GameWorld.ChangeStrToDatetime(crossServerTimeStr)
|
| | | |
| | | startTimeStr = "%s-%s-%s %s:%s:00" % (crossServerDateTime.year, crossServerDateTime.month, crossServerDateTime.day, hour, minute)
|
| | | startDateTime = GameWorld.ChangeStrToDatetime(startTimeStr)
|
| | | endBuyDateTime = startDateTime + datetime.timedelta(minutes= -closeBuyMinute)
|
| | | if crossServerDateTime >= endBuyDateTime:
|
| | | GameWorld.Log("该时间点战场已关闭召集,不能再召集! hour=%s,minute=%s,crossServerDateTime(%s) >= endBuyDateTime(%s)" |
| | | % (hour, minute, crossServerDateTime, endBuyDateTime), playerID)
|
| | | return
|
| | | |
| | | canBuyStartHour = 5
|
| | | curServerTime = GameWorld.GetCurrentTime()
|
| | | if crossServerDateTime.hour < canBuyStartHour or curServerTime.hour < canBuyStartHour:
|
| | | PlayerControl.NotifyCode(curPlayer, "CrossBattlefieldBuyLimit")
|
| | | GameWorld.Log("跨服服务器及本服服务器需超过%s点后可购买! crossServerHour=%s,curServerHour=%s" |
| | | % (canBuyStartHour, crossServerDateTime.hour, curServerTime.hour), playerID)
|
| | | return
|
| | | |
| | | sysOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 1)
|
| | | if [hour, minute] in sysOpenHMList:
|
| | | if PlayerControl.GetCrossMapID(curPlayer) != ChConfig.Def_FBMapID_CrossBattlefield:
|
| | | GameWorld.DebugLog("系统场次召集只能在跨服战场地图时可召集! CrossMapID=%s" % PlayerControl.GetCrossMapID(curPlayer), playerID)
|
| | | return
|
| | | else:
|
| | | if faction not in [ChConfig.CampType_Justice, ChConfig.CampType_Evil]:
|
| | | GameWorld.DebugLog("没有该战场阵营选择! faction=%s" % faction, playerID)
|
| | | return
|
| | | |
| | | callOpenHMList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldOpen", 2)
|
| | | if [hour, minute] not in callOpenHMList:
|
| | | GameWorld.Log("非可召集的战场场次! hour=%s,minute=%s,callOpenHMList=%s" % (hour, minute, callOpenHMList), playerID)
|
| | | return
|
| | | |
| | | closeBuyMinute = IpyGameDataPY.GetFuncCfg("CrossBattlefieldOpen", 4) # 开启前X分钟后关闭购买
|
| | | crossServerTimeStr = GameWorld.GetCrossServerTimeStr()
|
| | | crossServerDateTime = GameWorld.ChangeStrToDatetime(crossServerTimeStr)
|
| | | |
| | | startTimeStr = "%s-%s-%s %s:%s:00" % (crossServerDateTime.year, crossServerDateTime.month, crossServerDateTime.day, hour, minute)
|
| | | startDateTime = GameWorld.ChangeStrToDatetime(startTimeStr)
|
| | | endBuyDateTime = startDateTime + datetime.timedelta(minutes= -closeBuyMinute)
|
| | | if crossServerDateTime >= endBuyDateTime:
|
| | | GameWorld.Log("该时间点战场已关闭召集,不能再召集! hour=%s,minute=%s,crossServerDateTime(%s) >= endBuyDateTime(%s)" |
| | | % (hour, minute, crossServerDateTime, endBuyDateTime), playerID)
|
| | | return
|
| | | |
| | | canBuyStartHour = 5
|
| | | curServerTime = GameWorld.GetCurrentTime()
|
| | | if crossServerDateTime.hour < canBuyStartHour or curServerTime.hour < canBuyStartHour:
|
| | | PlayerControl.NotifyCode(curPlayer, "CrossBattlefieldBuyLimit")
|
| | | GameWorld.Log("跨服服务器及本服服务器需超过%s点后可购买! crossServerHour=%s,curServerHour=%s" |
| | | % (canBuyStartHour, crossServerDateTime.hour, curServerTime.hour), playerID)
|
| | | return
|
| | | |
| | | moneyBuyMaxCount, moneyType, moneyCount = 0, 0, 0
|
| | | todayBuyOpenCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Battlefield_BuyOpenCountToday)
|
| | | buyOpenMoneyInfo = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldBuyOpen", 1)
|
| | |
| | | PyGameData.g_crossBattlefieldCallTeamInfo = eval(msgValue)
|
| | | return
|
| | |
|
| | | if key == ShareDefine.Def_Notify_WorldKey_CrossBattlefieldSysCallBuyInfo:
|
| | | PyGameData.g_crossBattlefieldSysCallBuyList = eval(msgValue)
|
| | | return
|
| | | |
| | | if msgValue.isdigit():
|
| | | value = int(msgValue)
|
| | | else:
|
| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import PlayerCrossBattlefield
|
| | | import GameLogic_CrossBattlefield
|
| | | import PyGameData
|
| | |
|
| | | #------------------------------------------------------------------------------
|
| | | ## 执行逻辑
|
| | |
| | | # @return "True" or "False" or ""
|
| | | # @remarks 函数详细说明.
|
| | | def DoLogic(query_Type, query_ID, packCMDList, tick):
|
| | | GameWorld.DebugLog("GY_Query_CrossBattlefield DoLogic %s" % str(packCMDList), query_ID)
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
|
| | | if not curPlayer or curPlayer.IsEmpty():
|
| | | return
|
| | | |
| | | msgType = packCMDList[0]
|
| | | if msgType == "SysCallBuy":
|
| | | PyGameData.g_crossBattlefieldSysCallBuyList = packCMDList[1]
|
| | | GameLogic_CrossBattlefield.OnPlayerSysCallBuy(curPlayer)
|
| | | return
|
| | |
|
| | | #------------------------------------------------------------------------------
|
| | |
| | | g_crossPlayerSkillsChangeInfo = {} #跨服玩家技能变化信息 {playerID:[技能ID], ...}
|
| | |
|
| | | g_crossBattlefieldCallTeamInfo = {} # 跨服战场召集队伍信息 {zoneID:{hmNum:{playerID:{"callPlayerIDList":[召集队伍玩家ID列表], "factionID":阵营ID}, ...}, ...}, ...}
|
| | | g_crossBattlefieldSysCallBuyList = [] # 跨服战场系统场次购买召集玩家ID列表 [playerID, ...]
|
| | |
|
| | | g_ZhuXianBossPlayerHurtDict = {} #诛仙BOSS玩家伤害排行信息
|
| | |
|
| | |
| | | Def_Notify_WorldKey_LuckyCloudBuyInfo = "LuckyCloudBuyInfo" # 本服幸运云购最新一期信息
|
| | |
|
| | | Def_Notify_WorldKey_CrossBattlefieldCallTeamInfo = "CrossBattlefieldCallTeamInfo" # 跨服战场召集队伍信息
|
| | | Def_Notify_WorldKey_CrossBattlefieldSysCallBuyInfo = "CrossBattlefieldSysCallBuyInfo" # 跨服战场系统场次购买召集信息
|
| | |
|
| | | CrossChampionshipState_Guess8 = 80 #8强竞猜
|
| | | CrossChampionshipState_Group64 = 641 #64强分组
|