| | |
| | | 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):
|
| | |
| | | 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):
|