|  |  | 
 |  |  | import IPY_PlayerDefine
 | 
 |  |  | import CrossRealmPlayer
 | 
 |  |  | import CrossRealmMsg
 | 
 |  |  | import ChPyNetSendPack
 | 
 |  |  | import NetPackCommon
 | 
 |  |  | import ShareDefine
 | 
 |  |  | import CrossBoss
 | 
 |  |  | 
 | 
 |  |  | import random
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | 
 | 
 |  |  | ## 跨服地图动态分配的功能线路,如果有人数上限的,则同分区同地图玩法的可能同时存在多个相同功能线路的数据
 | 
 |  |  | 
 |  |  |         self.openState = IPY_PlayerDefine.fbosClosed
 | 
 |  |  |         self.fbPlayerDict = {} # 副本中的玩家信息 {playerID:serverGroupID, ...}
 | 
 |  |  |         self.waitPlayerDict = {} # 等待进入的玩家信息 {playerID:[serverGroupID, tick], ...}
 | 
 |  |  |         self.offlinePlayerDict = {} # 掉线的玩家信息,非主动退出的 {playerID:serverGroupID, ...}
 | 
 |  |  |         return
 | 
 |  |  |     
 | 
 |  |  |     def OnRequestEnterCrossCopyMap(self, playerID, serverGroupID, tick, copyMapPlayerMax):
 | 
 |  |  | 
 |  |  |                 break
 | 
 |  |  |     
 | 
 |  |  |     key = (mapID, copyMapID)
 | 
 |  |  |     copyMapObj = PyGameData.g_crossDynamicLineCopyMapInfo.pop(key, {})
 | 
 |  |  |      | 
 |  |  |     copyMapObj = PyGameData.g_crossDynamicLineCopyMapInfo.pop(key, None)
 | 
 |  |  |     if not copyMapObj:
 | 
 |  |  |         return
 | 
 |  |  |     #GameWorld.DebugLog("    PyGameData.g_crossDynamicLineInfo=%s" % PyGameData.g_crossDynamicLineInfo)
 | 
 |  |  |     #GameWorld.DebugLog("    PyGameData.g_crossDynamicLineCopyMapInfo=%s" % PyGameData.g_crossDynamicLineCopyMapInfo)
 | 
 |  |  |     
 | 
 |  |  | 
 |  |  |     funcLineID = copyMapObj.funcLineID
 | 
 |  |  |     playerCountInfo = [playerCount]
 | 
 |  |  |     SyncClientServerCrossFBFuncLinePlayerCount(zoneID, mapID, funcLineID, playerCountInfo)
 | 
 |  |  |      | 
 |  |  |     #如果虚拟分线关闭时,有掉线的玩家,则通知子服重置这些玩家的跨服状态
 | 
 |  |  |     for playerID, serverGroupID in copyMapObj.offlinePlayerDict.items():
 | 
 |  |  |         CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_ExitCrossServer, playerID, [serverGroupID])
 | 
 |  |  |          | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def OnCrossDynamicMapReset(msgList):
 | 
 |  |  | 
 |  |  |     playerID = curPlayer.GetPlayerID()
 | 
 |  |  |     serverGroupID = PlayerControl.GetPlayerServerGroupID(curPlayer)
 | 
 |  |  |     copyMapObj.waitPlayerDict.pop(playerID, None)
 | 
 |  |  |     copyMapObj.offlinePlayerDict.pop(playerID, None)
 | 
 |  |  |     copyMapObj.fbPlayerDict[playerID] = serverGroupID
 | 
 |  |  |     
 | 
 |  |  |     #GameWorld.DebugLog("玩家登录动态分配的跨服地图: GetMapID=%s,GetRealMapID=%s,GetFBID()=%s,serverGroupID=%s" 
 | 
 |  |  |     #                   % (curPlayer.GetMapID(), mapID, copyMapID, serverGroupID), playerID)
 | 
 |  |  |     #GameWorld.DebugLog("    副本中的玩家ID: %s" % copyMapObj.fbPlayerDict)
 | 
 |  |  |     #GameWorld.DebugLog("    等待中的玩家ID: %s" % copyMapObj.waitPlayerDict)
 | 
 |  |  |     #GameWorld.DebugLog("    离线中的玩家ID: %s" % copyMapObj.offlinePlayerDict)
 | 
 |  |  |     
 | 
 |  |  |     playerCount = len(copyMapObj.fbPlayerDict) # 等待进入的暂时不算
 | 
 |  |  |     zoneID = copyMapObj.zoneID
 | 
 |  |  | 
 |  |  |     copyMapObj.waitPlayerDict.pop(playerID, None)
 | 
 |  |  |     copyMapObj.fbPlayerDict.pop(playerID, None)
 | 
 |  |  |     
 | 
 |  |  |     #GameWorld.DebugLog("玩家退出动态分配的跨服地图: GetMapID=%s,GetRealMapID=%s,GetFBID()=%s"  | 
 |  |  |     #                   % (curPlayer.GetMapID(), mapID, copyMapID), playerID)
 | 
 |  |  |     crossMapID = PlayerControl.GetCrossMapID(curPlayer)
 | 
 |  |  |     # 不是主动退出的
 | 
 |  |  |     if crossMapID:
 | 
 |  |  |         copyMapObj.offlinePlayerDict[playerID] = PlayerControl.GetPlayerServerGroupID(curPlayer)
 | 
 |  |  |      | 
 |  |  |     #GameWorld.DebugLog("玩家退出动态分配的跨服地图: GetMapID=%s,GetRealMapID=%s,GetFBID()=%s,crossMapID=%s"  | 
 |  |  |     #                   % (curPlayer.GetMapID(), mapID, copyMapID, crossMapID), playerID)
 | 
 |  |  |     #GameWorld.DebugLog("    副本中的玩家ID: %s" % copyMapObj.fbPlayerDict)
 | 
 |  |  |     #GameWorld.DebugLog("    等待中的玩家ID: %s" % copyMapObj.waitPlayerDict)
 | 
 |  |  |     #GameWorld.DebugLog("    离线中的玩家ID: %s" % copyMapObj.offlinePlayerDict)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def CrossServerMsg_FBPlayerCount(msgData):
 | 
 |  |  | 
 |  |  |     
 | 
 |  |  |     # 组队副本, 有队伍的情况才验证其他队员可否进入,否则代表单人进入
 | 
 |  |  |     if gameMap.GetMapFBType() == ChConfig.fbtTeam:
 | 
 |  |  |         if tagMapID == ChConfig.Def_FBMapID_Love:
 | 
 |  |  |             onlyDoubleTeam = IpyGameDataPY.GetFuncCfg("LoveFB", 1)
 | 
 |  |  |             if onlyDoubleTeam:
 | 
 |  |  |                 if PlayerTeam.CheckTeamOnLineCount(curPlayer.GetTeam(), includeTJG=False) != 2:
 | 
 |  |  |                     PlayerControl.NotifyCode(curPlayer, "OnlyTwoMemTeamCanEnter", [tagMapID])
 | 
 |  |  |                     return
 | 
 |  |  |         PlayerTeam.OnEnterFBTeamAsk(curPlayer, PlayerTeam.TeamFBAskType_Enter, tagMapID, tagLineID, tick)
 | 
 |  |  |         return
 | 
 |  |  |     
 |