| | |
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import GameWorldProcess
|
| | | import PlayerMergeEvent
|
| | | import PlayerSuccess
|
| | | import ReadChConfig
|
| | | import ShareDefine
|
| | | import FBCommon
|
| | |
| | | gameMapID = gameMap.GetMapID()
|
| | |
|
| | | #如果已经设置过副本功能线路属性,则进入时同步玩家,一般下线重登或者非第一个进入该副本的玩家(如队友)会收到该包
|
| | | if FBCommon.GetHadSetFBPropertyMark():
|
| | | if FBCommon.GetHadSetFBPropertyMark() and gameMap.GetMapFBType() != IPY_GameWorld.fbtSingle:
|
| | | PlayerControl.SetFBFuncLineID(curPlayer, FBCommon.GetFBPropertyMark())
|
| | |
|
| | | #成长NPC所需数据初始化
|
| | |
| | | #注册玩家离开副本时间
|
| | | gameFBMgr.SetPlayerLogoffTick(0)
|
| | |
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_EnterMap, 1, [gameMapID])
|
| | | |
| | | if gameFBMgr.HaveFBPlayer(curPlayerID):
|
| | | #已经注册了这个玩家, 不清除已注册的玩家的字典信息
|
| | | return
|
| | |
|
| | | #注册进入这个副本的玩家
|
| | | gameFBMgr.AddFBPlayer(curPlayerID)
|
| | | |
| | | return
|
| | |
|
| | | def DoEnterFB(curPlayer, tick):
|
| | |
| | | if callFunc:
|
| | | #GameWorld.Log("副本逻辑不可使用 GameLogic_%d"%(mapID))
|
| | | callFunc(curPlayer , tick)
|
| | | |
| | | #有玩家离开副本广播一次
|
| | | PlayerMergeEvent.BroadcastMergePlayerEvent()
|
| | |
|
| | | #如果是最后一个人离开副本, 那么设置副本的离开时间, 5分钟后副本关闭
|
| | | __PlayerLeaveSetPlayerLogoffTick(curPlayer, tick)
|
| | |
| | | def PlayerLoginInFBCheck(curPlayer, tick):
|
| | | gameMap = GameWorld.GetMap()
|
| | | #如果此地图是自动释放的, 需要检查这个玩家
|
| | | if gameMap.GetMapFBType() == 0:
|
| | | if gameMap.GetMapFBType() in [IPY_GameWorld.fbtNull]:
|
| | | return False
|
| | | |
| | | #跨服服务器是直接注册的地图ID数据,地图肯定没有该玩家,所以不判断
|
| | | if GameWorld.IsCrossServer():
|
| | | return False
|
| | |
|
| | | #玩家 在副本中,并且副本不踢出玩家下线
|
| | |
| | | # @return mapID
|
| | | # @remarks 函数详细说明.
|
| | | def __GetFBLogic_MapID(mapID):
|
| | | #ManorWarMapIDList = ReadChConfig.GetEvalChConfig("ManorWarMapID") |
| | | #if mapID in ManorWarMapIDList:
|
| | | # return 'ManorWar'
|
| | | mapID = FBCommon.GetRecordMapID(mapID)
|
| | | for key, value in ChConfig.Def_FB_MapID.items():
|
| | | if mapID in value:
|
| | |
| | | return False
|
| | |
|
| | | return callFunc(curPlayer, mapID, lineID, cnt, isFinish, dataEx)
|
| | |
|
| | | ## 副本助战扫荡结果
|
| | | def OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, lineID, helpBattlePlayerDict, addXianyuanCoin, reason):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnPlayerFBHelpBattleSweepResult"))
|
| | | |
| | | if callFunc == None:
|
| | | return False
|
| | |
|
| | | return callFunc(curPlayer, mapID, lineID, helpBattlePlayerDict, addXianyuanCoin, reason)
|
| | |
|
| | | ## 开始公共CD副本扫荡
|
| | | def OnStartPubCDFBSweep(curPlayer, mapID, lineID, cnt, dataEx):
|
| | |
| | |
|
| | | return callFunc(curPlayer, tick)
|
| | |
|
| | | ## 客户端进入自定义场景
|
| | | def OnEnterCustomScene(curPlayer, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnEnterCustomScene"))
|
| | | |
| | | if callFunc == None:
|
| | | return
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | ## 客户端发送刷新自定义副本奖励
|
| | | def OnRefreshCustomFBPrize(curPlayer, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnRefreshCustomFBPrize"))
|
| | | |
| | | if callFunc == None:
|
| | | return []
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | ## 给自定义副本奖励后续处理
|
| | | 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 callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | |
|
| | | ## 结束跨服副本
|
| | | def OnEndCrossFB(curPlayer, mapID, lineID, exData):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnEndCrossFB"))
|
| | | |
| | | if callFunc == None:
|
| | | return
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID, exData)
|
| | |
|
| | | def OnPlayerLVUp(curPlayer):
|
| | | ## 玩家升级
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|