| | |
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import GameWorldProcess
|
| | | import CrossRealmPlayer
|
| | | import PlayerSuccess
|
| | | import ReadChConfig
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import FBCommon
|
| | | import GameMap
|
| | | import GameObj
|
| | |
| | | def DoEnterFBLogic(curPlayer, tick):
|
| | | curPlayerID = curPlayer.GetID()
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = FBCommon.GetRecordMapID(mapID)
|
| | | if mapID in ChConfig.Def_CrossDynamicLineMap:
|
| | | fbZoneID = FBCommon.GetCrossDynamicLineMapZoneID()
|
| | | fbFuncLineID = FBCommon.GetCrossDynamicLineMapFuncLineID()
|
| | | playerZoneID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBZoneID)
|
| | | playerFuncLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBFuncLine)
|
| | | if fbZoneID != playerZoneID or fbFuncLineID != playerFuncLineID:
|
| | | GameWorld.ErrLog("DoEnterFB 玩家与当前副本线路所属分区或功能分线不同,踢出玩家!fbZoneID=%s,playerZoneID=%s,fbFuncLineID=%s,playerFuncLineID=%s" |
| | | % (fbZoneID, playerZoneID, fbFuncLineID, playerFuncLineID), curPlayerID)
|
| | | CrossRealmPlayer.PlayerExitCrossServer(curPlayer)
|
| | | return
|
| | | GameWorld.Log("玩家进入跨服副本动态分配的线路: fbZoneID=%s,playerZoneID=%s,fbFuncLineID=%s,playerFuncLineID=%s" |
| | | % (fbZoneID, playerZoneID, fbFuncLineID, playerFuncLineID), curPlayerID)
|
| | | |
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | copyMapID = gameWorld.GetCopyMapID()
|
| | | if copyMapID not in PyGameData.g_crossPlayerServerGroupIDInfo:
|
| | | PyGameData.g_crossPlayerServerGroupIDInfo[copyMapID] = {}
|
| | | playerServerGroupIDDict = PyGameData.g_crossPlayerServerGroupIDInfo[copyMapID]
|
| | | playerServerGroupIDDict[curPlayerID] = PlayerControl.GetPlayerServerGroupID(curPlayer)
|
| | | |
| | | # 自伸缩副本根据玩家进入开启,主动调用一次,避免间隔调用时机未触发导致逻辑错乱
|
| | | GameWorldProcess.EnterOpenFB(tick)
|
| | |
|
| | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnGetFBEnterPos"))
|
| | |
|
| | | if callFunc == None:
|
| | | return
|
| | | |
| | | posInfo = callFunc(curPlayer, mapID, lineId, ipyEnterPosInfo, tick)
|
| | | posInfo = ipyEnterPosInfo
|
| | | else:
|
| | | posInfo = callFunc(curPlayer, mapID, lineId, ipyEnterPosInfo, tick)
|
| | | |
| | | if not posInfo:
|
| | | return
|
| | | enterX, enterY = posInfo[:2]
|
| | |
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | ## 给自定义副本奖励后续处理
|
| | | ## @return: 返回结算副本over信息字典,不含jsonItem信息
|
| | | def OnGiveCustomFBPrizeOK(curPlayer, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnGiveCustomFBPrizeOK"))
|
| | |
|
| | | if callFunc == None:
|
| | | return
|
| | | return {}
|
| | |
|
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | ## 进入跨服副本注册数据前逻辑
|
| | | ## @return: 是否可以注册前往跨服副本,次函数中可以写一些扣除消耗逻辑等
|
| | | def OnRegEnterCrossFB(curPlayer, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnRegEnterCrossFB"))
|
| | | |
| | | if callFunc == None:
|
| | | return True
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | ## 结束跨服副本
|
| | | def OnEndCrossFB(curPlayer, mapID, lineID, exData):
|
| | |
| | |
|
| | | return callFunc(curPlayer, mapID, lineID, exData)
|
| | |
|
| | | ## 跨服功能线路数据缓存,下次开启同样功能线路时会用该数据进行还原之前的副本状态
|
| | | def OnGetCrossFuncLineDataCache():
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnGetCrossFuncLineDataCache"))
|
| | | if callFunc == None:
|
| | | return
|
| | | return callFunc()
|
| | |
|
| | | ## 是否需要做进入副本通用检查条件逻辑,默认需要检查
|
| | | def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnNeedCheckCanEnterFBComm"))
|
| | | |
| | | if callFunc == None:
|
| | | return True
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | def OnPlayerLVUp(curPlayer):
|
| | | ## 玩家升级
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|