ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py
@@ -34,8 +34,10 @@
import CrossBattlefield
import CrossRealmPlayer
import CrossChampionship
import PlayerPackData
import DataRecordPack
import CrossRealmMsg
import PyDataManager
import ShareDefine
import CrossBoss
import time
@@ -64,8 +66,9 @@
## 跨服地图动态分配的虚拟线路信息 {(mapID, copyMapID):CrossCopyMapInfo, ...}
class CrossCopyMapInfo():
    
    def __init__(self, zoneID, funcLineID):
    def __init__(self, zoneID, funcMapID, funcLineID):
        self.zoneID = zoneID
        self.funcMapID = funcMapID
        self.funcLineID = funcLineID
        self.newFuncLineNum = 0
        self.realMapID = 0
@@ -95,9 +98,28 @@
            
        return totalPlayerCount
    
    def IsMustCopyMapPlayer(self, playerID):
    def IsMustCopyMapPlayer(self, playerID, checkTeam=True):
        ## 是否必定在此分线的玩家, 在请求队列里 或 曾经进入到该分线的,都强制认为属于该分线的玩家
        return playerID in self.waitPlayerDict or playerID in self.enterPlayerIDList
        if playerID in self.waitPlayerDict or playerID in self.enterPlayerIDList:
            return True
        if self.openState != IPY_PlayerDefine.fbosOpen:
            return False
        if not checkTeam:
            return False
        # 队友强制在一起
        funcTeamMgr = PyDataManager.GetDBPyFuncTeamManager()
        teamID = funcTeamMgr.GetPlayerTeamID(playerID, self.funcMapID)
        if not teamID:
            return False
        funcTeam = funcTeamMgr.GetFuncTeam(teamID)
        if not funcTeam:
            return False
        for memID in funcTeam.GetMemberIDList():
            if memID in self.waitPlayerDict or memID in self.enterPlayerIDList:
                GameWorld.DebugLog("强制和队友在一条线路!  funcMapID=%s,memID=%s,realMapID=%s,copyMapID=%s"
                                   % (self.funcMapID, memID, self.realMapID, self.copyMapID), playerID)
                return True
        return False
        
    def OnRequestEnterCrossCopyMap(self, playerID, tick, copyMapPlayerMax, includeOffline):
        if not copyMapPlayerMax or self.IsMustCopyMapPlayer(playerID):
@@ -150,7 +172,7 @@
    playerLV = msgData["LV"]
    
    if mapID == ChConfig.Def_FBMapID_CrossChampionship:
        CrossChampionship.OnRequestChampionshipVSRoom(playerID, serverGroupID)
        #CrossChampionship.OnRequestChampionshipVSRoom(playerID, serverGroupID)
        return
    
    zoneIpyData = CrossRealmPlayer.GetCrossZoneIpyDataByServerGroupID(mapID, serverGroupID)
@@ -256,7 +278,7 @@
        
    realMapID, copyMapID, openState = tagCopyMapObj.realMapID, tagCopyMapObj.copyMapID, tagCopyMapObj.openState
    
    if openState == IPY_PlayerDefine.fbosWaitForClose:
    if openState >= IPY_PlayerDefine.fbosWaitForClose:
        PlayerControl.NotifyCodeCross(serverGroupID, playerID, "CrossFBClose")
        GameWorld.ErrLog("分流的副本线路关闭中! mapID=%s,funcLineID=%s,zoneID=%s,realMapID=%s,copyMapID=%s,openState=%s" 
                         % (mapID, funcLineID, zoneID, realMapID, copyMapID, openState), playerID)
@@ -343,7 +365,7 @@
        
        copyMapObj = PyGameData.g_crossDynamicLineCopyMapInfo[key]
        openState = copyMapObj.openState
        if openState == IPY_PlayerDefine.fbosWaitForClose:
        if openState >= IPY_PlayerDefine.fbosWaitForClose:
            # 没有限制分流人数的情况,代表都在同一场,这种情况下当副本已经在关闭的状态下,则代表已经结束了,不可再进入
            if not shuntPlayerMax:
                PlayerControl.NotifyCodeCross(serverGroupID, playerID, "CrossFBClose")
@@ -456,7 +478,7 @@
    newFuncLineObj.copyMapID = copyMapID
    newFuncLineObj.newFuncLineNum = newFuncLineNum
    
    copyMapObj = CrossCopyMapInfo(zoneID, funcLineID)
    copyMapObj = CrossCopyMapInfo(zoneID, mapID, funcLineID)
    copyMapObj.realMapID = realMapID
    copyMapObj.copyMapID = copyMapID
    copyMapObj.newFuncLineNum = newFuncLineNum
@@ -529,7 +551,11 @@
        OnCrossDynamicLineClose(realMapID, copyMapID)
    elif state == IPY_PlayerDefine.fbosOpen:
        OnCrossDynamicLineOpen(mapID, realMapID, copyMapID)
    else:
        key = (realMapID, copyMapID)
        if key in PyGameData.g_crossDynamicLineCopyMapInfo:
            copyMapObj = PyGameData.g_crossDynamicLineCopyMapInfo[key]
            copyMapObj.openState = state
    return
def OnCrossDynamicLineOpen(mapID, realMapID, copyMapID):
@@ -729,7 +755,7 @@
#  @return None
def EnterFBLine(curPlayer, queryCallName, sendCMD, tick):
    playerID = curPlayer.GetPlayerID()
    GameWorld.Log("EnterFBLine()...queryCallName=%s,sendCMD=%s" % (queryCallName, sendCMD), curPlayer.GetPlayerID())
    GameWorld.Log("EnterFBLine()...queryCallName=%s,sendCMD=%s" % (queryCallName, sendCMD), playerID)
    playerManager = GameWorld.GetPlayerManager()
    try:
        mapInfo = eval(sendCMD)
@@ -744,6 +770,7 @@
    #if mapInfo and len(mapInfo) == 2:
    tagMapID = mapInfo[0]
    tagLineID = mapInfo[1]
    extendValue1 = mapInfo[2] if len(mapInfo) > 2 else None
    
    fbLineIpyData = GetFBLineIpyData(tagMapID, tagLineID)
    sceneMapID = tagMapID if not fbLineIpyData else fbLineIpyData.GetMapID()
@@ -752,6 +779,13 @@
        GameWorld.ErrLog("目标副本地图不存在!tagMapID=%s,sceneMapID=%s" % (tagMapID, sceneMapID), curPlayer.GetPlayerID())
        return
    
    if isinstance(extendValue1, dict):
        if extendValue1.get("msgType", "") == "MirrorBattle":
            PlayerPackData.OnMGReuestPlayerPackData(extendValue1)
            playerManager.MapServer_QueryPlayer(curPlayer.GetPlayerID(), ChConfig.queryType_EnterFB, 0, sceneMapID,
                                                queryCallName, sendCMD, len(sendCMD), curPlayer.GetRouteServerIndex())
        return
    # 组队副本, 有队伍的情况才验证其他队员可否进入,否则代表单人进入
    if gameMap.GetMapFBType() == ChConfig.fbtTeam:
        if tagMapID == ChConfig.Def_FBMapID_Love: