| | |
| | | import CrossBattlefield
|
| | | import CrossRealmPlayer
|
| | | import CrossChampionship
|
| | | import PlayerPackData
|
| | | import DataRecordPack
|
| | | import CrossRealmMsg
|
| | | import PyDataManager
|
| | | import ShareDefine
|
| | | import CrossBoss
|
| | | import time
|
| | |
| | | ## 跨服地图动态分配的虚拟线路信息 {(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
|
| | |
| | |
|
| | | 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):
|
| | |
| | | playerLV = msgData["LV"]
|
| | |
|
| | | if mapID == ChConfig.Def_FBMapID_CrossChampionship:
|
| | | CrossChampionship.OnRequestChampionshipVSRoom(playerID, serverGroupID)
|
| | | #CrossChampionship.OnRequestChampionshipVSRoom(playerID, serverGroupID)
|
| | | return
|
| | |
|
| | | zoneIpyData = CrossRealmPlayer.GetCrossZoneIpyDataByServerGroupID(mapID, serverGroupID)
|
| | |
| | |
|
| | | 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)
|
| | |
| | |
|
| | | 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")
|
| | |
| | | newFuncLineObj.copyMapID = copyMapID
|
| | | newFuncLineObj.newFuncLineNum = newFuncLineNum
|
| | |
|
| | | copyMapObj = CrossCopyMapInfo(zoneID, funcLineID)
|
| | | copyMapObj = CrossCopyMapInfo(zoneID, mapID, funcLineID)
|
| | | copyMapObj.realMapID = realMapID
|
| | | copyMapObj.copyMapID = copyMapID
|
| | | copyMapObj.newFuncLineNum = newFuncLineNum
|
| | |
| | | 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):
|
| | |
| | | # @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)
|
| | |
| | | #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()
|
| | |
| | | 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:
|