| | |
| | | import PlayerDBOper
|
| | | import IPY_GameServer
|
| | | import PlayerDBGSEvent
|
| | | import CrossChampionship
|
| | | import IpyGameDataPY
|
| | | import CrossRealmMsg
|
| | | import ShareDefine
|
| | |
| | |
|
| | | 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
|
| | |
|
| | |
|