| | |
| | | import IPY_PlayerDefine
|
| | | import CrossBattlefield
|
| | | import CrossRealmPlayer
|
| | | import CrossChampionship
|
| | | import DataRecordPack
|
| | | import CrossRealmMsg
|
| | | import ShareDefine
|
| | |
| | | mapID = msgData["MapID"]
|
| | | funcLineID = msgData["FuncLineID"]
|
| | | playerLV = msgData["LV"]
|
| | | |
| | | if mapID == ChConfig.Def_FBMapID_CrossChampionship:
|
| | | CrossChampionship.OnRequestChampionshipVSRoom(playerID, serverGroupID)
|
| | | return
|
| | |
|
| | | zoneIpyData = CrossRealmPlayer.GetCrossZoneIpyDataByServerGroupID(mapID, serverGroupID)
|
| | | if not zoneIpyData:
|
| | |
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, 0, realMapID, "OpenFB", msgInfo, len(msgInfo))
|
| | | return copyMapObj
|
| | |
|
| | | def SendMapOpenFBEx(realMapID, copyPropertyList):
|
| | | ## 通知地图开启副本线路
|
| | | # @param realMapID: 地图ID
|
| | | # @param copyPropertyList: [[copyMapID, propertyID], ...]
|
| | | msgInfo = str(copyPropertyList)
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, 0, realMapID, "OpenFBEx", msgInfo, len(msgInfo))
|
| | | GameWorld.Log("SendMapOpenFBEx: realMapID=%s,msgInfo=%s" % (realMapID, msgInfo))
|
| | | return
|
| | |
|
| | | def OpenCrossDynamicLineBySys(zoneID, mapID, funcLineIDList, checkExist):
|
| | | ## 系统开启跨服动态线路
|
| | |
|
| | |
| | | # @param sendCMD: 请求的命令 根据请求类型和请求命令来决定最终操作
|
| | | # @return None
|
| | | def EnterFBLine(curPlayer, queryCallName, sendCMD, tick):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.Log("EnterFBLine()...queryCallName=%s,sendCMD=%s" % (queryCallName, sendCMD), curPlayer.GetPlayerID())
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | try:
|
| | |
| | | playerManager.MapServer_QueryPlayer(curPlayer.GetPlayerID(), ChConfig.queryType_EnterFB, 0, tagMapID,
|
| | | queryCallName, sendCMD, len(sendCMD), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | | def Send_CrossServerMsg_EnterVSRoomRet(vsRoomDict, serverGroupIDList=None):
|
| | | ## 发送子服跨服对战房间请求进入结果
|
| | | # @param vsRoomDict: {roomID:{playerID:playerInfo, ...}, }
|
| | | # playerInfo key
|
| | | # serverGroupID 所属服务器分组ID
|
| | | # regMapInfo 传送跨服注册信息 [registerMap, mapID, dataMapID, copyMapID, posX, posY]
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_EnterVSRoomRet, vsRoomDict, serverGroupIDList)
|
| | | return
|
| | |
|
| | | def CrossServerMsg_EnterVSRoomRet(msgData, tick):
|
| | | ## 跨服对战房间请求进入结果
|
| | | |
| | | curServerGroupID = GameWorld.GetServerGroupID()
|
| | | GameWorld.DebugLog("=== 跨服PK对战房间请求进入结果 === curServerGroupID=%s" % curServerGroupID)
|
| | | vsRoomDict = msgData
|
| | | for roomID, playerDict in vsRoomDict.items():
|
| | | GameWorld.DebugLog(" roomID=%s,playerDict=%s" % (roomID, playerDict))
|
| | | for playerID, playerInfo in playerDict.items():
|
| | | if "serverGroupID" in playerInfo:
|
| | | serverGroupID = playerInfo["serverGroupID"]
|
| | | if serverGroupID != curServerGroupID:
|
| | | GameWorld.DebugLog(" 不是本服玩家,不处理!playerID=%s,serverGroupID=%s" % (playerID, serverGroupID))
|
| | | continue
|
| | | |
| | | player = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if not player:
|
| | | GameWorld.DebugLog(" 玩家不在线, playerID=%s" % (playerID))
|
| | | continue
|
| | | if PlayerControl.GetIsTJG(player):
|
| | | GameWorld.DebugLog(" 玩家脱机中, playerID=%s" % (playerID))
|
| | | continue
|
| | | |
| | | if "regMapInfo" not in playerInfo:
|
| | | continue
|
| | | regMapInfo = playerInfo["regMapInfo"]
|
| | | if len(regMapInfo) != 6:
|
| | | continue
|
| | | registerMap, mapID, dataMapID, copyMapID, posX, posY = regMapInfo
|
| | | |
| | | PlayerControl.SetVsRoomId(player, roomID, True)
|
| | | # 通知地图玩家匹配成功, 上传数据, 准备进入跨服服务器
|
| | | CrossRealmPlayer.SendCrossRealmReg(player, registerMap, mapID, dataMapID, copyMapID, posX, posY)
|
| | | |
| | | return
|
| | |
|