9415 【BT】【后端】古神战场(修复分流到非32060地图时准备时间进场无法在地图中间坐标范围bug;增加跨服分流地图请求、进入、退出流向)
| | |
| | |
|
| | | def SendCrossRealmReg(curPlayer, registerMap, mapID=0, dataMapID=0, copyMapID=0, posX=0, posY=0, lineID=0):
|
| | | # 发送跨服账号注册上传数据
|
| | | # @param mapID: 真实场景地图ID
|
| | | # @param dataMapID: 真实场景地图ID对应场景数据地图ID
|
| | |
|
| | | # 设置上传数据的活动类型
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CrossRegisterMap, registerMap)
|
| | |
| | | import IPY_PlayerDefine
|
| | | import CrossBattlefield
|
| | | import CrossRealmPlayer
|
| | | import DataRecordPack
|
| | | import CrossRealmMsg
|
| | | import ShareDefine
|
| | | import CrossBoss
|
| | |
| | | if openState == IPY_PlayerDefine.fbosOpen:
|
| | | funcLineID = tagCopyMapObj.funcLineID
|
| | | playerIDList = [playerID]
|
| | | retInfo = [playerIDList, mapID, realMapID, copyMapID, funcLineID]
|
| | | # 分流地图的地图数据ID直接使用场景ID,因为分流地图实际上是两张不同的地图,所以直接使用场景ID,不然会导致上传跨服玩家数据时坐标为0
|
| | | retInfo = [playerIDList, mapID, realMapID, realMapID, copyMapID, funcLineID]
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_EnterFBRet, retInfo, [serverGroupID])
|
| | |
|
| | | dataDict = {}
|
| | | dataDict.update(msgData)
|
| | | dataDict.update({"mapID":mapID, "realMapID":realMapID, "copyMapID":copyMapID, "realFuncLineID":funcLineID, "openState":openState})
|
| | | DataRecordPack.SendEventPack("CrossFBRequest", dataDict)
|
| | | return tagCopyMapObj
|
| | |
|
| | | def CrossServerMsg_EnterFBRet(msgData, tick):
|
| | | ## 收到跨服服务器动态分配的跨服副本进入信息
|
| | | |
| | | playerIDList, dataMapID, mapID, copyMapID, funcLineID = msgData
|
| | | playerIDList, dataMapID, mapID, realMapID, copyMapID, funcLineID = msgData
|
| | |
|
| | | for playerID in playerIDList:
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if not curPlayer:
|
| | | continue
|
| | | CrossRealmPlayer.SendCrossRealmReg(curPlayer, dataMapID, mapID, dataMapID, copyMapID, lineID=funcLineID)
|
| | | CrossRealmPlayer.SendCrossRealmReg(curPlayer, dataMapID, realMapID, mapID, copyMapID, lineID=funcLineID)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | return 0
|
| | |
|
| | | def OnCrossDynamicLineStateChange(msgList):
|
| | | realMapID, copyMapID, state = msgList[:3]
|
| | | mapID, realMapID, copyMapID, state = msgList[:4]
|
| | |
|
| | | if state == IPY_PlayerDefine.fbosWaitForClose:
|
| | | funcLineDataCache = msgList[3]
|
| | |
| | | elif state == IPY_PlayerDefine.fbosClosed:
|
| | | OnCrossDynamicLineClose(realMapID, copyMapID)
|
| | | elif state == IPY_PlayerDefine.fbosOpen:
|
| | | OnCrossDynamicLineOpen(realMapID, copyMapID)
|
| | | OnCrossDynamicLineOpen(mapID, realMapID, copyMapID)
|
| | |
|
| | | return
|
| | |
|
| | | def OnCrossDynamicLineOpen(realMapID, copyMapID):
|
| | | def OnCrossDynamicLineOpen(mapID, realMapID, copyMapID):
|
| | | ## 动态分配线路的地图虚拟线路启动成功
|
| | |
|
| | | key = (realMapID, copyMapID)
|
| | |
| | | playerIDList = serverPlayerIDListDict[serverGroupID]
|
| | | playerIDList.append(playerID)
|
| | |
|
| | | mapID = GetRecordMapID(realMapID)
|
| | | GameWorld.Log("动态分配虚拟线路启动成功,通知子服等待玩家可进入: mapID=%s,realMapID=%s,copyMapID=%s,serverPlayerIDListDict=%s" |
| | | % (mapID, realMapID, copyMapID, serverPlayerIDListDict))
|
| | | recordMapID = GetRecordMapID(realMapID)
|
| | | GameWorld.Log("动态分配虚拟线路启动成功,通知子服等待玩家可进入: recordMapID=%s,mapID=%s,realMapID=%s,copyMapID=%s,serverPlayerIDListDict=%s" |
| | | % (recordMapID, mapID, realMapID, copyMapID, serverPlayerIDListDict))
|
| | | for serverGroupID, playerIDList in serverPlayerIDListDict.items():
|
| | | retInfo = [playerIDList, mapID, realMapID, copyMapID, funcLineID]
|
| | | retInfo = [playerIDList, recordMapID, mapID, realMapID, copyMapID, funcLineID]
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_EnterFBRet, retInfo, [serverGroupID])
|
| | |
|
| | | #GameWorld.DebugLog(" PyGameData.g_crossDynamicLineInfo=%s" % PyGameData.g_crossDynamicLineInfo)
|
| | |
| | | import PlayerControl
|
| | | import GameWorldProcess
|
| | | import CrossRealmPlayer
|
| | | import DataRecordPack
|
| | | import PlayerSuccess
|
| | | import ReadChConfig
|
| | | import PlayerAssist
|
| | |
| | | if GameWorld.IsCrossServer():
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = FBCommon.GetRecordMapID(mapID)
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | copyMapID = gameWorld.GetCopyMapID()
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), "AccID":curPlayer.GetAccID(), |
| | | "recordMapID":mapID, "mapID":GameWorld.GetMap().GetMapID(), "realMapID":gameWorld.GetRealMapID(), "copyMapID":copyMapID}
|
| | | if mapID in ChConfig.Def_CrossDynamicLineMap:
|
| | | fbZoneID = FBCommon.GetCrossDynamicLineMapZoneID()
|
| | | fbFuncLineID = FBCommon.GetCrossDynamicLineMapFuncLineID()
|
| | |
| | | GameWorld.ErrLog("DoEnterFB 玩家与当前副本线路所属分区或功能分线不同,踢出玩家!fbZoneID=%s,playerZoneID=%s,fbFuncLineID=%s,playerFuncLineID=%s"
|
| | | % (fbZoneID, playerZoneID, fbFuncLineID, playerFuncLineID), curPlayerID)
|
| | | CrossRealmPlayer.PlayerExitCrossServer(curPlayer)
|
| | | dataDict.update({"Error":"zoneLineIDError"})
|
| | | DataRecordPack.SendEventPack("CrossFBEnter", dataDict, curPlayer)
|
| | | return
|
| | | GameWorld.Log("玩家进入跨服副本动态分配的线路: fbZoneID=%s,playerZoneID=%s,fbFuncLineID=%s,playerFuncLineID=%s"
|
| | | % (fbZoneID, playerZoneID, fbFuncLineID, playerFuncLineID), curPlayerID)
|
| | | dataDict.update({"fbZoneID":fbZoneID, "fbFuncLineID":fbFuncLineID, "playerZoneID":playerZoneID, "playerFuncLineID":playerFuncLineID})
|
| | |
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | copyMapID = gameWorld.GetCopyMapID()
|
| | | if copyMapID not in PyGameData.g_crossPlayerServerGroupIDInfo:
|
| | | PyGameData.g_crossPlayerServerGroupIDInfo[copyMapID] = {}
|
| | | playerServerGroupIDDict = PyGameData.g_crossPlayerServerGroupIDInfo[copyMapID]
|
| | | playerServerGroupIDDict[curPlayerID] = PlayerControl.GetPlayerServerGroupID(curPlayer)
|
| | | DataRecordPack.SendEventPack("CrossFBEnter", dataDict, curPlayer)
|
| | |
|
| | | # 自伸缩副本根据玩家进入开启,主动调用一次,避免间隔调用时机未触发导致逻辑错乱
|
| | | GameWorldProcess.EnterOpenFB(tick)
|
| | |
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def DoExitFBLogic(curPlayer, tick):
|
| | | if GameWorld.IsCrossServer():
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = FBCommon.GetRecordMapID(mapID)
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | copyMapID = gameWorld.GetCopyMapID()
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), "AccID":curPlayer.GetAccID(), |
| | | "recordMapID":mapID, "mapID":GameWorld.GetMap().GetMapID(), "realMapID":gameWorld.GetRealMapID(), "copyMapID":copyMapID}
|
| | | if mapID in ChConfig.Def_CrossDynamicLineMap:
|
| | | fbZoneID = FBCommon.GetCrossDynamicLineMapZoneID()
|
| | | fbFuncLineID = FBCommon.GetCrossDynamicLineMapFuncLineID()
|
| | | playerZoneID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBZoneID)
|
| | | playerFuncLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBFuncLine)
|
| | | dataDict.update({"fbZoneID":fbZoneID, "fbFuncLineID":fbFuncLineID, "playerZoneID":playerZoneID, "playerFuncLineID":playerFuncLineID})
|
| | | if curPlayer.GetFaction():
|
| | | dataDict["Faction"] = curPlayer.GetFaction()
|
| | | DataRecordPack.SendEventPack("CrossFBExit", dataDict, curPlayer)
|
| | | |
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "DoExitFB"))
|
| | |
| | | if mapID not in ChConfig.Def_CrossDynamicLineMap:
|
| | | return
|
| | |
|
| | | mapID = gameWorld.GetMapID()
|
| | | realMapID, copyMapID = gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()
|
| | | if state == IPY_GameWorld.fbosWaitForClose:
|
| | | crossFuncLineDataCache = FBLogic.OnGetCrossFuncLineDataCache()
|
| | | msgInfo = [realMapID, copyMapID, state, crossFuncLineDataCache]
|
| | | msgInfo = [mapID, realMapID, copyMapID, state, crossFuncLineDataCache]
|
| | | else:
|
| | | msgInfo = [realMapID, copyMapID, state]
|
| | | msgInfo = [mapID, realMapID, copyMapID, state]
|
| | |
|
| | | msgInfo = str(msgInfo)
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "DynamicLineMapStateChange", msgInfo, len(msgInfo))
|
| | |
| | |
|
| | | def RegisterEnterCrossServer(curPlayer, registerMap, mapID=0, dataMapID=0, copyMapID=0, posX=0, posY=0, lineID=0):
|
| | | '''
|
| | | @param registerMap: 一般是dataMapID
|
| | | @param registerMap: 一般是功能地图ID dataMapID
|
| | | @param mapID: 真实场景地图ID
|
| | | @param dataMapID: 真实场景地图ID对应场景数据地图ID
|
| | | '''
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if GameWorld.IsCrossServer():
|