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,6 +441,7 @@ PyGameData.g_crossDynamicLineInfo.pop(ChConfig.Def_FBMapID_CrossBattlefield, None) PyGameData.g_overPlayerIDList = [] PyGameData.g_crossBattlefieldSysCallBuyList = [] hmNum = battlefieldState openHour, openMinute = GetHMByNum(hmNum) @@ -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) 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列表 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强分组 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 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossBattlefield.py
@@ -76,13 +76,19 @@ serverOnly = clientData.ServerOnly if GameWorld.IsCrossServer(): GameWorld.DebugLog("跨服服务器无法发起匹配!", playerID) GameWorld.DebugLog("跨服服务器无法发起!", playerID) return if not CrossRealmPlayer.IsCrossServerOpen(): PlayerControl.NotifyCode(curPlayer, "CrossMatching18") 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 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: 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 #------------------------------------------------------------------------------ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
@@ -109,6 +109,7 @@ g_crossPlayerSkillsChangeInfo = {} #跨服玩家技能变化信息 {playerID:[技能ID], ...} g_crossBattlefieldCallTeamInfo = {} # 跨服战场召集队伍信息 {zoneID:{hmNum:{playerID:{"callPlayerIDList":[召集队伍玩家ID列表], "factionID":阵营ID}, ...}, ...}, ...} g_crossBattlefieldSysCallBuyList = [] # 跨服战场系统场次购买召集玩家ID列表 [playerID, ...] g_ZhuXianBossPlayerHurtDict = {} #诛仙BOSS玩家伤害排行信息 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强分组