| | |
| | | import ChConfig
|
| | | import PlayerControl
|
| | | import FamilyRobBoss
|
| | | import NPCCustomRefresh
|
| | | import EventShell
|
| | | import FBLogic
|
| | | import FBCommon
|
| | | import ShareDefine
|
| | | import EventReport
|
| | | import ItemCommon
|
| | | import PyGameData
|
| | |
| | |
|
| | | #调用副本开启触发器
|
| | | FBLogic.OnOpenFB(tick)
|
| | | |
| | | GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosOpen)
|
| | | return
|
| | |
|
| | | ## 副本关闭
|
| | |
| | | gameFBMgr = gameWorld.GetGameFB()
|
| | | gameFBMgr.SetPlayerLogoffTick(0)
|
| | | gameFBMgr.SetIsSafeClose(0)
|
| | |
|
| | | |
| | | lineID = gameWorld.GetLineID()
|
| | | copyMapID = gameWorld.GetCopyMapID()
|
| | | GameWorld.Log("FB Close! lineID = %s, openState = %s"%(lineID, gameWorld.GetOpenState()))
|
| | |
|
| | | gameWorld.SetOpenState(IPY_GameWorld.fbosClosed)
|
| | |
| | |
|
| | | #发送未拾取的物品给玩家
|
| | | if mapID in ChConfig.Def_SendUnPickItemMailMapIDList and unPickItemDict:
|
| | | isCrossServer = GameWorld.IsCrossServer()
|
| | | playerServerGroupIDDict = PyGameData.g_crossPlayerServerGroupIDInfo.get(copyMapID, {})
|
| | | for ownerID, mailItemList in unPickItemDict.items():
|
| | | GameWorld.Log("发送未拾取的物品给玩家: %s" % mailItemList, ownerID)
|
| | | PlayerControl.SendMailByKey("ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
|
| | | if isCrossServer:
|
| | | serverGroupID = playerServerGroupIDDict.get(ownerID, 0)
|
| | | PlayerControl.SendCrossMail(serverGroupID, "ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
|
| | | else:
|
| | | PlayerControl.SendMailByKey("ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
|
| | |
|
| | | playerManager = gameWorld.GetMapCopyPlayerManager()
|
| | |
|
| | |
| | | #根据是否收缩型FB处理
|
| | | FreeOrClearFBByAutoSize(gameWorld)
|
| | |
|
| | | GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosClosed)
|
| | | |
| | | gameWorld.SetPropertyID(0)
|
| | | PyGameData.g_crossPlayerServerGroupIDInfo.pop(copyMapID, None)
|
| | | return
|
| | |
|
| | | def GameServer_DynamicLineMapStateChange(gameWorld, state):
|
| | | if gameWorld.GetMapID() not in ChConfig.Def_CrossDynamicLineMap:
|
| | | return
|
| | | |
| | | realMapID, copyMapID = gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()
|
| | | if state == IPY_GameWorld.fbosWaitForClose:
|
| | | crossFuncLineDataCache = FBLogic.OnGetCrossFuncLineDataCache()
|
| | | msgInfo = [realMapID, copyMapID, state, crossFuncLineDataCache]
|
| | | else:
|
| | | msgInfo = [realMapID, copyMapID, state]
|
| | | |
| | | msgInfo = str(msgInfo)
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "DynamicLineMapStateChange", msgInfo, len(msgInfo))
|
| | | GameWorld.Log("DynamicLineMapStateChange realMapID=%s, copyMapID=%s, PropertyID=%s, state=%s" % (realMapID, copyMapID, gameWorld.GetPropertyID(), state))
|
| | | return
|
| | |
|
| | | ##根据表中的收缩类型释放或者清空副本状态
|
| | |
| | |
|
| | | ##踢人
|
| | | __KickAllPlayerAndCloseFB(gameWorld, tick)
|
| | | GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosClosed)
|
| | | return
|
| | |
|
| | | ## 副本踢出玩家逻辑
|
| | |
| | |
|
| | | #仙盟归属boss定时处理
|
| | | FamilyRobBoss.OnFamilyOwnerBossProcess(tick)
|
| | | |
| | | #地图自定义随机刷怪
|
| | | NPCCustomRefresh.ProcessMapRandomRefreshNPC(gameWorld, tick)
|
| | | return
|
| | |
|
| | | ## 通知RouteServer 消息
|
| | |
| | | if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull:
|
| | | msgInfo = str([gameWorld.GetMapID(), gameWorld.GetLineID(), gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "CommMapServerInitOK", msgInfo, len(msgInfo))
|
| | | |
| | | if gameWorld.GetMapID() in ChConfig.Def_CrossDynamicLineMap and gameWorld.GetCopyMapID() == gameWorld.GetGameWorldCount() - 1:
|
| | | msgInfo = str([gameWorld.GetRealMapID(), gameWorld.GetGameWorldCount()])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "DynamicLineMapInitOK", msgInfo, len(msgInfo))
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def CloseFB(tick):
|
| | | GameWorld.GetGameWorld().SetCloseFBTick(tick)
|
| | | |
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosWaitForClose)
|
| | | return
|
| | |
|
| | | ## 玩家离开地图时,尝试关闭副本
|
| | |
| | |
|
| | | def IsNoPlayerNeedCloseFB():
|
| | | ## 副本中无玩家是否需要自动关闭的副本
|
| | | return GameWorld.GetMap().GetAutoSize() and GameWorld.GetMap().GetMapID() not in ChConfig.Def_NoPlayerNotCloseAutoSizeMap
|
| | |
|
| | | if GameWorld.GetMap().GetAutoSize():
|
| | | if GameWorld.GetMap().GetMapID() in ChConfig.Def_NoPlayerNotCloseAutoSizeMap:
|
| | | return False
|
| | | return True
|
| | | else:
|
| | | if GameWorld.GetMap().GetMapID() in ChConfig.Def_NoPlayerCloseNotAutoSizeMap:
|
| | | return True
|
| | | return False
|
| | | |
| | | #//08 06 根据国家统计的玩家数目#tagMPlayerCountByCountry
|
| | | #tagMPlayerCountByCountry * GettagMPlayerCountByCountry();
|
| | | #
|