PySysDB/PySysDBG.h
@@ -332,6 +332,7 @@ DWORD LimitLV; //开启等级 DWORD LimitMagicWeapon; //需要解锁法宝ID WORD LimiRealmLV; //需要境界等级 BYTE LimitVIPLV; //需要VIP等级 }; //NPC表 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossChampionship.py
@@ -758,11 +758,22 @@ return def DoChampionshipOpen(curPlayer): NotifyPlayerChampionshipInfo(curPlayer, GameWorld.GetGameWorld().GetTick()) return def OnPlayerLogin(curPlayer, tick): if GameWorld.IsCrossServer(): return if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): return NotifyPlayerChampionshipInfo(curPlayer, tick) return def NotifyPlayerChampionshipInfo(curPlayer, tick): playerID = curPlayer.GetPlayerID() champMgr = GetChampionshipMgr() pkZoneIDList = champMgr.GetChampPKZoneIDList() @@ -2853,11 +2864,13 @@ def Sync_ChampionshipPKZoneGroupInfo(zoneID, groupMarkDict=None, curPlayer=None): ## 同步排位分区分组信息 # @param groupMarkDict: {groupMark:[battleNum, ...], ...} champMgr = GetChampionshipMgr() if curPlayer: playerZoneID = champMgr.GetPlayerPKZoneID(curPlayer.GetPlayerID()) if playerZoneID != zoneID: return if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): return pkZoneMgr = champMgr.GetChampPKZoneMgr(zoneID) @@ -2932,6 +2945,8 @@ playerZoneID = champMgr.GetPlayerPKZoneID(curPlayer.GetPlayerID()) if playerZoneID != zoneID: continue if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): continue NetPackCommon.SendFakePack(curPlayer, clientPack) return @@ -2944,6 +2959,8 @@ champMgr = GetChampionshipMgr() playerZoneID = champMgr.GetPlayerPKZoneID(playerID) if not playerZoneID: return if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): return pkZoneMgr = champMgr.GetChampPKZoneMgr(playerZoneID) @@ -2990,6 +3007,8 @@ playerZoneID = champMgr.GetPlayerPKZoneID(curPlayer.GetPlayerID()) if playerZoneID != zoneID: return if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): return pkZoneMgr = champMgr.GetChampPKZoneMgr(zoneID) if not pkZoneMgr: @@ -3033,6 +3052,8 @@ playerZoneID = champMgr.GetPlayerPKZoneID(curPlayer.GetPlayerID()) if playerZoneID != zoneID: continue if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): continue NetPackCommon.SendFakePack(curPlayer, clientPack) return @@ -3044,6 +3065,8 @@ if curPlayer: playerZoneID = champMgr.GetPlayerOfficialZoneID(curPlayer.GetPlayerID()) if playerZoneID != zoneID: return if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): return clientPack = ChPyNetSendPack.tagGCChampionshipOfficialInfo() @@ -3104,6 +3127,8 @@ playerZoneID = champMgr.GetPlayerOfficialZoneID(curPlayer.GetPlayerID()) if playerZoneID != zoneID: continue if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Championship): continue NetPackCommon.SendFakePack(curPlayer, clientPack) return ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -285,6 +285,7 @@ ("DWORD", "LimitLV", 0), ("DWORD", "LimitMagicWeapon", 0), ("WORD", "LimiRealmLV", 0), ("BYTE", "LimitVIPLV", 0), ), "ChinNPC":( @@ -1379,13 +1380,15 @@ self.FuncId = 0 self.LimitLV = 0 self.LimitMagicWeapon = 0 self.LimiRealmLV = 0 self.LimiRealmLV = 0 self.LimitVIPLV = 0 return def GetFuncId(self): return self.FuncId # 功能标识 def GetLimitLV(self): return self.LimitLV # 开启等级 def GetLimitMagicWeapon(self): return self.LimitMagicWeapon # 需要解锁法宝ID def GetLimiRealmLV(self): return self.LimiRealmLV # 需要境界等级 def GetLimiRealmLV(self): return self.LimiRealmLV # 需要境界等级 def GetLimitVIPLV(self): return self.LimitVIPLV # 需要VIP等级 # NPC表 class IPY_ChinNPC(): ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
@@ -30,6 +30,7 @@ import PlayerDBOper import IPY_GameServer import PlayerDBGSEvent import CrossChampionship import IpyGameDataPY import CrossRealmMsg import ShareDefine @@ -405,3 +406,47 @@ return ipyData.GetLimitLV() # 因为MapServer玩家属性变更通知GameServer与功能开启通知触发时机有先后顺序,可能导致判断功能开启不准确,所以暂时记录该信息,临时用 g_playerOpenFuncInfo = {} # 玩家触发功能开启功能ID信息,{playerID:[funcID, ...], ...} ## 功能是否可用,该函数并不能确保百分百正确,只能大致判断,仅判断部分条件,如包含未判断的条件则不能确保百分百正确 def GetFuncCanUse(curPlayer, funcID): playerID = curPlayer.GetPlayerID() if playerID in g_playerOpenFuncInfo: if funcID in g_playerOpenFuncInfo[playerID]: return True ipyData = IpyGameDataPY.GetIpyGameData("FuncOpenLV", funcID) if not ipyData: return False if ipyData.GetLimitLV() and ipyData.GetLimitLV() > curPlayer.GetLV(): return False if ipyData.GetLimiRealmLV() and ipyData.GetLimiRealmLV() > curPlayer.GetOfficialRank(): return False if ipyData.GetLimitVIPLV() and ipyData.GetLimitVIPLV() > curPlayer.GetVIPLv(): return False return True def DoFuncOpenLogic(curPlayer, funcIDList): global g_playerOpenFuncInfo if GameWorld.IsCrossServer(): return playerID = curPlayer.GetPlayerID() FuncOpenLogicDict = { ShareDefine.GameFuncID_Championship:lambda curObj:CrossChampionship.DoChampionshipOpen(curObj), } for funcID in funcIDList: if funcID in FuncOpenLogicDict: if playerID not in g_playerOpenFuncInfo: g_playerOpenFuncInfo[playerID] = [] openFuncIDList = g_playerOpenFuncInfo[playerID] if funcID not in openFuncIDList: openFuncIDList.append(funcID) GameWorld.DebugLog("触发功能开启逻辑! funcID=%s" % funcID, playerID) FuncOpenLogicDict[funcID](curPlayer) return ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
@@ -581,6 +581,13 @@ PlayerExam.MapServer_ExitAction(srcPlayerID) return if callName == 'FuncOpen': curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID) if not curPlayer: return PlayerControl.DoFuncOpenLogic(curPlayer, eval(resultName)) return if callName == 'TeamNotify': #队伍通知 teamID = pack.GetQueryID() ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1138,6 +1138,7 @@ GameFuncID_Arena = 195 # 竞技场 GameFuncID_FaQi = 199 # 法器 GameFuncID_LianTi = 207 # 炼体 GameFuncID_Championship = 210 # 排位 # 以下为暂时无用的 GameFuncID_Truck = 33 # 运镖 GameFuncID_RunDaily = 34 # 日常跑环 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossChampionship.py
@@ -28,6 +28,10 @@ import time def DoChampionshipOpen(curPlayer): DoPlayerLogin(curPlayer) return def DoPlayerLogin(curPlayer): if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Championship_WorshipCount): Sync_ChampionshipPlayerInfo(curPlayer) ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1138,6 +1138,7 @@ GameFuncID_Arena = 195 # 竞技场 GameFuncID_FaQi = 199 # 法器 GameFuncID_LianTi = 207 # 炼体 GameFuncID_Championship = 210 # 排位 # 以下为暂时无用的 GameFuncID_Truck = 33 # 运镖 GameFuncID_RunDaily = 34 # 日常跑环