From b66c09d0b802bf7e7a8ce4593d874cc75b6d3e05 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 23 七月 2024 18:47:00 +0800 Subject: [PATCH] 10216 【越南】【港台】【主干】【砍树】古神战场修改(系统场次战场中可购买召集,继承原召集场次效果) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py | 66 +++++++++------- ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py | 76 ++++++++++++++++--- ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py | 1 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py | 20 ++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 1 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py | 1 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 1 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4 + ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossBattlefield.py | 11 ++ 9 files changed, 137 insertions(+), 44 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py index 375371e..9ac8890 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBattlefield.py @@ -329,6 +329,7 @@ def OnMapServerInitOK(): # 通知地图服务器状态 SyncMapServerCrossBattlefieldBuyInfo() + SyncMapServerCrossBattlefieldSysCallBuyInfo() return def SyncMapServerCrossBattlefieldBuyInfo(): @@ -343,6 +344,11 @@ 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(): @@ -435,7 +441,8 @@ 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) @@ -642,6 +649,49 @@ 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] @@ -671,16 +721,6 @@ 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()) @@ -979,7 +1019,6 @@ GameWorld.DebugLog("收到跨服服务器同步的战场购买信息: %s" % msgData) zoneID = msgData["zoneID"] - syncBuyHMInfo = msgData["syncBuyHMInfo"] opData = msgData.get("opData", {}) curZoneID = GetCrossBattlefieldZoneID(GameWorld.GetServerGroupID()) @@ -987,6 +1026,19 @@ 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) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py index b61d39b..5ffbf11 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py @@ -146,6 +146,7 @@ g_unNotifyPlayerCrossMsgDict = {} # 未通知玩家的跨服命令 {playerID:{msgType:[msgInfo], ...}, ...} g_crossBattlefieldBuyInfo = {} # 跨服战场购买记录 {zoneID:{hmNum:{playerID:CrossBattlefieldBuy, ...}, ...}, ...} +g_crossBattlefieldSysCallBuyList = [] # 跨服战场系统场次购买召集玩家ID列表 [playerID, ...] g_openDateTime = None # 本场次开启的时间 g_overPlayerIDList = [] # 本场次已经结算的玩家ID列表 diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py index 67fab70..6056703 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py @@ -185,6 +185,7 @@ Def_Notify_WorldKey_LuckyCloudBuyInfo = "LuckyCloudBuyInfo" # 本服幸运云购最新一期信息 Def_Notify_WorldKey_CrossBattlefieldCallTeamInfo = "CrossBattlefieldCallTeamInfo" # 跨服战场召集队伍信息 +Def_Notify_WorldKey_CrossBattlefieldSysCallBuyInfo = "CrossBattlefieldSysCallBuyInfo" # 跨服战场系统场次购买召集信息 CrossChampionshipState_Guess8 = 80 #8强竞猜 CrossChampionshipState_Group64 = 641 #64强分组 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 6da0d8b..0297b9e 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 @@ -239,6 +239,12 @@ 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): @@ -649,6 +655,15 @@ 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 @@ -1410,7 +1425,7 @@ 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) @@ -2249,7 +2264,8 @@ 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 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py index 87d092d..0e32197 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py @@ -76,42 +76,48 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py index b0115f6..9c9e317 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py @@ -1564,6 +1564,10 @@ 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: diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossBattlefield.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossBattlefield.py index b25ab78..e50f94c 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossBattlefield.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossBattlefield.py @@ -18,6 +18,8 @@ import GameWorld import ChConfig import PlayerCrossBattlefield +import GameLogic_CrossBattlefield +import PyGameData #------------------------------------------------------------------------------ ## 执行逻辑 @@ -28,6 +30,15 @@ # @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 #------------------------------------------------------------------------------ diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py index 80a5b73..58de948 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py @@ -106,6 +106,7 @@ g_crossPlayerSkillsChangeInfo = {} #跨服玩家技能变化信息 {playerID:[技能ID], ...} g_crossBattlefieldCallTeamInfo = {} # 跨服战场召集队伍信息 {zoneID:{hmNum:{playerID:{"callPlayerIDList":[召集队伍玩家ID列表], "factionID":阵营ID}, ...}, ...}, ...} +g_crossBattlefieldSysCallBuyList = [] # 跨服战场系统场次购买召集玩家ID列表 [playerID, ...] g_ZhuXianBossPlayerHurtDict = {} #诛仙BOSS玩家伤害排行信息 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py index 67fab70..6056703 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py @@ -185,6 +185,7 @@ Def_Notify_WorldKey_LuckyCloudBuyInfo = "LuckyCloudBuyInfo" # 本服幸运云购最新一期信息 Def_Notify_WorldKey_CrossBattlefieldCallTeamInfo = "CrossBattlefieldCallTeamInfo" # 跨服战场召集队伍信息 +Def_Notify_WorldKey_CrossBattlefieldSysCallBuyInfo = "CrossBattlefieldSysCallBuyInfo" # 跨服战场系统场次购买召集信息 CrossChampionshipState_Guess8 = 80 #8强竞猜 CrossChampionshipState_Group64 = 641 #64强分组 -- Gitblit v1.8.0