| | |
| | | import CrossChampionship
|
| | | 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
|
| | |
| | |
|
| | | def IsMustCopyMapPlayer(self, playerID):
|
| | | ## 是否必定在此分线的玩家, 在请求队列里 或 曾经进入到该分线的,都强制认为属于该分线的玩家
|
| | | return playerID in self.waitPlayerDict or playerID in self.enterPlayerIDList
|
| | | if playerID in self.waitPlayerDict or playerID in self.enterPlayerIDList:
|
| | | return True
|
| | | # 队友强制在一起
|
| | | 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):
|
| | |
| | | newFuncLineObj.copyMapID = copyMapID
|
| | | newFuncLineObj.newFuncLineNum = newFuncLineNum
|
| | |
|
| | | copyMapObj = CrossCopyMapInfo(zoneID, funcLineID)
|
| | | copyMapObj = CrossCopyMapInfo(zoneID, mapID, funcLineID)
|
| | | copyMapObj.realMapID = realMapID
|
| | | copyMapObj.copyMapID = copyMapID
|
| | | copyMapObj.newFuncLineNum = newFuncLineNum
|