6459 【后端】【2.0】缥缈仙域开发单(查询副本功能线路人数信息逻辑修改,支持查询妖王地图)
| | |
| | | #需要动态分配线路的跨服地图
|
| | | Def_CrossDynamicLineMap = [Def_FBMapID_CrossDemonKing, Def_FBMapID_CrossGrasslandLing, Def_FBMapID_CrossGrasslandXian]
|
| | |
|
| | | #需要统计副本功能线路ID人数的跨服地图
|
| | | Def_NeedCountFBFuncLinePlayerCrossMap = [Def_FBMapID_CrossDemonKing]
|
| | |
|
| | | #同系职业枚举
|
| | | JOB_TYPY_COUNT = 5
|
| | | (
|
| | |
| | | # A0 04 查询副本功能线路人数 #tagCGGetFBLinePlayerCnt
|
| | |
|
| | | class tagCGGetFBLinePlayerCnt(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FBLineID", c_ubyte), |
| | | ("IsAllLine", c_ubyte), |
| | | ]
|
| | | Head = tagHead()
|
| | | MapID = 0 #(DWORD MapID)
|
| | | LineCount = 0 #(BYTE LineCount)
|
| | | LineIDList = list() #(vector<BYTE> LineIDList)//个数为0时代表查全部
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA0
|
| | | self.SubCmd = 0x04
|
| | | self.Head.Cmd = 0xA0
|
| | | self.Head.SubCmd = 0x04
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.LineCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.LineCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.LineIDList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA0
|
| | | self.SubCmd = 0x04
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA0
|
| | | self.Head.SubCmd = 0x04
|
| | | self.MapID = 0
|
| | | self.FBLineID = 0
|
| | | self.IsAllLine = 0
|
| | | self.LineCount = 0
|
| | | self.LineIDList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGGetFBLinePlayerCnt)
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 1
|
| | | length += 1 * self.LineCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.MapID)
|
| | | data = CommFunc.WriteBYTE(data, self.LineCount)
|
| | | for i in range(self.LineCount):
|
| | | data = CommFunc.WriteBYTE(data, self.LineIDList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A0 04 查询副本功能线路人数 //tagCGGetFBLinePlayerCnt:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | MapID:%d,
|
| | | FBLineID:%d,
|
| | | IsAllLine:%d
|
| | | LineCount:%d,
|
| | | LineIDList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.Head.OutputString(),
|
| | | self.MapID,
|
| | | self.FBLineID,
|
| | | self.IsAllLine
|
| | | self.LineCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGGetFBLinePlayerCnt=tagCGGetFBLinePlayerCnt()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGGetFBLinePlayerCnt.Cmd,m_NAtagCGGetFBLinePlayerCnt.SubCmd))] = m_NAtagCGGetFBLinePlayerCnt
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGGetFBLinePlayerCnt.Head.Cmd,m_NAtagCGGetFBLinePlayerCnt.Head.SubCmd))] = m_NAtagCGGetFBLinePlayerCnt
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | | m_NAtagCGQueryCompensation=tagCGQueryCompensation()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryCompensation.Cmd,m_NAtagCGQueryCompensation.SubCmd))] = m_NAtagCGQueryCompensation
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A9 05 查询副本功能线路当前玩家数 #tagCGQueryFBFuncLinePlayerCount
|
| | |
|
| | | class tagCGQueryFBFuncLinePlayerCount(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FuncLineID", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | self.MapID = 0
|
| | | self.FuncLineID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGQueryFBFuncLinePlayerCount)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A9 05 查询副本功能线路当前玩家数 //tagCGQueryFBFuncLinePlayerCount:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | FuncLineID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.FuncLineID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGQueryFBFuncLinePlayerCount=tagCGQueryFBFuncLinePlayerCount()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryFBFuncLinePlayerCount.Cmd,m_NAtagCGQueryFBFuncLinePlayerCount.SubCmd))] = m_NAtagCGQueryFBFuncLinePlayerCount
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A9 05 副本功能线路当前玩家数 #tagGCFBFuncLinePlayerCountInfo
|
| | |
|
| | | class tagGCFBFuncLinePlayerCountInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FuncLineID", c_ubyte), |
| | | ("PlayerCount", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | self.MapID = 0
|
| | | self.FuncLineID = 0
|
| | | self.PlayerCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagGCFBFuncLinePlayerCountInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A9 05 副本功能线路当前玩家数 //tagGCFBFuncLinePlayerCountInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | FuncLineID:%d,
|
| | | PlayerCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.FuncLineID,
|
| | | self.PlayerCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagGCFBFuncLinePlayerCountInfo=tagGCFBFuncLinePlayerCountInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCFBFuncLinePlayerCountInfo.Cmd,m_NAtagGCFBFuncLinePlayerCountInfo.SubCmd))] = m_NAtagGCFBFuncLinePlayerCountInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A9 A9 通知好友互赠精力信息 #tagGCFriendSendEnergyInfo
|
| | |
|
| | | class tagGCFriendSendEnergyInfo(Structure):
|
| | |
| | | elif msgType == ShareDefine.CrossServerMsg_SendMail:
|
| | | PlayerCompensation.CrossServerMsg_SendMail(msgData)
|
| | |
|
| | | elif msgType == ShareDefine.CrossServerMsg_FBPlayerCount:
|
| | | PlayerFB.CrossServerMsg_FBPlayerCount(msgData)
|
| | | |
| | | # 需要发送到地图服务器处理的
|
| | | elif msgType in [ShareDefine.CrossServerMsg_RebornRet, ShareDefine.CrossServerMsg_CollectNPCOK, ShareDefine.CrossServerMsg_FBEnd,
|
| | | ShareDefine.CrossServerMsg_NPCAttackCount]:
|
| | |
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MapID;
|
| | | # BYTE FBLineID;
|
| | | # BYTE IsAllLine;
|
| | | # BYTE LineCount;
|
| | | # BYTE LineIDList[LineCount]; //个数为0时代表查全部
|
| | | #};
|
| | | def ClinetQueryFBLinePlayerCnt(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | queryMapID = clientData.MapID
|
| | | fbLineID = clientData.FBLineID
|
| | | isAllLine = clientData.IsAllLine
|
| | | queryFBLineIDList = clientData.LineIDList
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | |
|
| | | sendCMD = str([queryMapID, fbLineID, isAllLine])
|
| | | if queryMapID in ChConfig.Def_CrossMapIDList:
|
| | | fbLinePlayerInfoDict = PyGameData.g_crossFBFuncLinePlayerCountInfo.get(queryMapID, {})
|
| | | if not queryFBLineIDList:
|
| | | resultInfo = [queryMapID, fbLinePlayerInfoDict]
|
| | | else:
|
| | | defaultInfo = [0] # 与本服结构相同,默认0人
|
| | | queryFBLineInfo = {}
|
| | | for lineID in queryFBLineIDList:
|
| | | queryFBLineInfo[lineID] = fbLinePlayerInfoDict.get(lineID, defaultInfo)
|
| | | resultInfo = [queryMapID, queryFBLineInfo]
|
| | | QueryFBLinePlayerCntResult(curPlayer, resultInfo)
|
| | | return
|
| | | |
| | | sendCMD = str([queryMapID, queryFBLineIDList])
|
| | | playerManager.MapServer_QueryPlayer(curPlayer.GetPlayerID(), 0, 0, queryMapID,
|
| | | 'FBLinePlayerCnt', sendCMD, len(sendCMD), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
| | | import IPY_PlayerDefine
|
| | | import CrossRealmPlayer
|
| | | import CrossRealmMsg
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import ShareDefine
|
| | | import CrossBoss
|
| | |
|
| | |
| | | break
|
| | |
|
| | | key = (mapID, copyMapID)
|
| | | PyGameData.g_crossDynamicLineCopyMapInfo.pop(key, {})
|
| | | copyMapObj = PyGameData.g_crossDynamicLineCopyMapInfo.pop(key, {})
|
| | |
|
| | | #GameWorld.DebugLog(" PyGameData.g_crossDynamicLineInfo=%s" % PyGameData.g_crossDynamicLineInfo)
|
| | | #GameWorld.DebugLog(" PyGameData.g_crossDynamicLineCopyMapInfo=%s" % PyGameData.g_crossDynamicLineCopyMapInfo)
|
| | | |
| | | playerCount = 0
|
| | | zoneID = copyMapObj.zoneID
|
| | | funcLineID = copyMapObj.funcLineID
|
| | | playerCountInfo = [playerCount]
|
| | | SyncClientServerCrossFBFuncLinePlayerCount(zoneID, mapID, funcLineID, playerCountInfo)
|
| | | return
|
| | |
|
| | | def OnCrossDynamicMapReset(msgList):
|
| | |
| | | # % (curPlayer.GetMapID(), mapID, copyMapID, serverGroupID), playerID)
|
| | | #GameWorld.DebugLog(" 副本中的玩家ID: %s" % copyMapObj.fbPlayerDict)
|
| | | #GameWorld.DebugLog(" 等待中的玩家ID: %s" % copyMapObj.waitPlayerDict)
|
| | | |
| | | playerCount = len(copyMapObj.fbPlayerDict) # 等待进入的暂时不算
|
| | | zoneID = copyMapObj.zoneID
|
| | | funcLineID = copyMapObj.funcLineID
|
| | | playerCountInfo = [playerCount]
|
| | | SyncClientServerCrossFBFuncLinePlayerCount(zoneID, mapID, funcLineID, playerCountInfo)
|
| | | return
|
| | |
|
| | | def SyncClientServerCrossFBFuncLinePlayerCount(zoneID, mapID, funcLineID, playerCountInfo):
|
| | | ## 同步子服跨服副本功能线路人数
|
| | | ## 注意: 此人数不是一个精确人数值,只是一个大概人数值,不用很精确,暂时只玩家进入时同步人数信息,玩家退出暂不处理 |
| | | mapID = GetRecordMapID(mapID)
|
| | | if mapID not in ChConfig.Def_NeedCountFBFuncLinePlayerCrossMap:
|
| | | return
|
| | | zoneIpyData = CrossRealmPlayer.GetCrossZoneIpyDataByZoneID(mapID, zoneID)
|
| | | if not zoneIpyData:
|
| | | return
|
| | | serverGroupIDList = zoneIpyData.GetServerGroupIDList()
|
| | | playerCountInfo = [mapID, funcLineID, playerCountInfo]
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_FBPlayerCount, playerCountInfo, serverGroupIDList)
|
| | | return
|
| | |
|
| | | def OnPlayerDisconnectCrossServer(curPlayer):
|
| | |
| | | #GameWorld.DebugLog(" 等待中的玩家ID: %s" % copyMapObj.waitPlayerDict)
|
| | | return
|
| | |
|
| | | def CrossServerMsg_FBPlayerCount(msgData):
|
| | | ## 收到跨服服务器同步的副本功能线路人数信息
|
| | | |
| | | mapID, funcLineID, playerCountInfo = msgData
|
| | | if mapID not in PyGameData.g_crossFBFuncLinePlayerCountInfo:
|
| | | PyGameData.g_crossFBFuncLinePlayerCountInfo[mapID] = {}
|
| | | fbLinePlayerInfoDict = PyGameData.g_crossFBFuncLinePlayerCountInfo[mapID]
|
| | | fbLinePlayerInfoDict[funcLineID] = playerCountInfo
|
| | | return
|
| | |
|
| | | ##--------------------------------------------------------------------------------------------------
|
| | |
|
| | | ## 请求进入副本分线
|
| | |
| | | g_crossDynamicLineInfo = {} # 跨服动态线路信息 {dataMapID:{(zoneID, funcLineID):[CrossFuncLineInfo, CrossFuncLineInfo, ...], ...}, ...}
|
| | | g_crossDynamicLineCopyMapInfo = {} # 跨服动态线路虚拟线路信息 {(mapID, copyMapID):CrossCopyMapInfo, ...}
|
| | |
|
| | | g_crossFBFuncLinePlayerCountInfo = {} # 跨服副本功能线路人数信息,本服缓存 {mapID:{funcLineID:[playerCount], ...}, ...}
|
| | |
|
| | |
| | | CrossServerMsg_FBEnd = "FBEnd" # 完成跨服副本
|
| | | CrossServerMsg_NPCAttackCount = "NPCAttackCount" # 攻击NPC次数记录
|
| | | CrossServerMsg_SendMail = "SendMail" # 发送邮件
|
| | | CrossServerMsg_FBPlayerCount = "FBPlayerCount" # 副本功能线路人数同步
|
| | |
|
| | | # 子服发送跨服信息定义
|
| | | ClientServerMsg_ServerInitOK = "ServerInitOK" # 子服启动成功
|
| | |
| | | # A0 04 查询副本功能线路人数 #tagCGGetFBLinePlayerCnt
|
| | |
|
| | | class tagCGGetFBLinePlayerCnt(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FBLineID", c_ubyte), |
| | | ("IsAllLine", c_ubyte), |
| | | ]
|
| | | Head = tagHead()
|
| | | MapID = 0 #(DWORD MapID)
|
| | | LineCount = 0 #(BYTE LineCount)
|
| | | LineIDList = list() #(vector<BYTE> LineIDList)//个数为0时代表查全部
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA0
|
| | | self.SubCmd = 0x04
|
| | | self.Head.Cmd = 0xA0
|
| | | self.Head.SubCmd = 0x04
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.LineCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.LineCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.LineIDList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA0
|
| | | self.SubCmd = 0x04
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA0
|
| | | self.Head.SubCmd = 0x04
|
| | | self.MapID = 0
|
| | | self.FBLineID = 0
|
| | | self.IsAllLine = 0
|
| | | self.LineCount = 0
|
| | | self.LineIDList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGGetFBLinePlayerCnt)
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 1
|
| | | length += 1 * self.LineCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.MapID)
|
| | | data = CommFunc.WriteBYTE(data, self.LineCount)
|
| | | for i in range(self.LineCount):
|
| | | data = CommFunc.WriteBYTE(data, self.LineIDList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A0 04 查询副本功能线路人数 //tagCGGetFBLinePlayerCnt:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | MapID:%d,
|
| | | FBLineID:%d,
|
| | | IsAllLine:%d
|
| | | LineCount:%d,
|
| | | LineIDList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.Head.OutputString(),
|
| | | self.MapID,
|
| | | self.FBLineID,
|
| | | self.IsAllLine
|
| | | self.LineCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGGetFBLinePlayerCnt=tagCGGetFBLinePlayerCnt()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGGetFBLinePlayerCnt.Cmd,m_NAtagCGGetFBLinePlayerCnt.SubCmd))] = m_NAtagCGGetFBLinePlayerCnt
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGGetFBLinePlayerCnt.Head.Cmd,m_NAtagCGGetFBLinePlayerCnt.Head.SubCmd))] = m_NAtagCGGetFBLinePlayerCnt
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | | m_NAtagCGQueryCompensation=tagCGQueryCompensation()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryCompensation.Cmd,m_NAtagCGQueryCompensation.SubCmd))] = m_NAtagCGQueryCompensation
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A9 05 查询副本功能线路当前玩家数 #tagCGQueryFBFuncLinePlayerCount
|
| | |
|
| | | class tagCGQueryFBFuncLinePlayerCount(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FuncLineID", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | self.MapID = 0
|
| | | self.FuncLineID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGQueryFBFuncLinePlayerCount)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A9 05 查询副本功能线路当前玩家数 //tagCGQueryFBFuncLinePlayerCount:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | FuncLineID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.FuncLineID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGQueryFBFuncLinePlayerCount=tagCGQueryFBFuncLinePlayerCount()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryFBFuncLinePlayerCount.Cmd,m_NAtagCGQueryFBFuncLinePlayerCount.SubCmd))] = m_NAtagCGQueryFBFuncLinePlayerCount
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A9 05 副本功能线路当前玩家数 #tagGCFBFuncLinePlayerCountInfo
|
| | |
|
| | | class tagGCFBFuncLinePlayerCountInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FuncLineID", c_ubyte), |
| | | ("PlayerCount", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA9
|
| | | self.SubCmd = 0x05
|
| | | self.MapID = 0
|
| | | self.FuncLineID = 0
|
| | | self.PlayerCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagGCFBFuncLinePlayerCountInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A9 05 副本功能线路当前玩家数 //tagGCFBFuncLinePlayerCountInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | FuncLineID:%d,
|
| | | PlayerCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.FuncLineID,
|
| | | self.PlayerCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagGCFBFuncLinePlayerCountInfo=tagGCFBFuncLinePlayerCountInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCFBFuncLinePlayerCountInfo.Cmd,m_NAtagGCFBFuncLinePlayerCountInfo.SubCmd))] = m_NAtagGCFBFuncLinePlayerCountInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A9 A9 通知好友互赠精力信息 #tagGCFriendSendEnergyInfo
|
| | |
|
| | | class tagGCFriendSendEnergyInfo(Structure):
|
| | |
| | | GameWorld.DebugLog("GY_Query_FBLinePlayerCnt DoLogic() query_Type=%s,query_ID=%s,packCMDList=%s,tick=%s" % \
|
| | | (query_Type, query_ID, packCMDList, tick))
|
| | |
|
| | | if not packCMDList or len(packCMDList) < 3:
|
| | | if not packCMDList or len(packCMDList) < 2:
|
| | | GameWorld.DebugLog(" DoLogic() return []")
|
| | | return []
|
| | |
|
| | | tagMapID = packCMDList[0] # 目标地图id
|
| | | tagFBLineID = packCMDList[1] # 线路id
|
| | | isAllLine = packCMDList[2] # 查询的NPCID列表
|
| | | tagMapID, queryFBLineIDList = packCMDList
|
| | | tagFBLineID = 0 if not queryFBLineIDList else queryFBLineIDList[0] # 线路id
|
| | | isAllLine = not queryFBLineIDList # 查询的NPCID列表
|
| | | gameWorldManager = GameWorld.GetGameWorld()
|
| | | fbLinePlayerCntDict = {}
|
| | | if tagMapID == ChConfig.Def_FBMapID_SealDemon:
|
| | |
| | | continue
|
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | fbLinePlayerCntDict[fblineID] = [playerCnt]
|
| | | if not isAllLine:
|
| | | break
|
| | | |
| | | elif tagMapID == ChConfig.Def_FBMapID_DemonKing:
|
| | | for index in xrange(gameWorldManager.GetGameWorldCount()):
|
| | | gameWorld = IPY_GameWorld.IPY_GameWorld(index)
|
| | | playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
|
| | | fblineID = gameWorld.GetPropertyID() - 1
|
| | | if fblineID < 0:
|
| | | continue
|
| | | if queryFBLineIDList and fblineID not in queryFBLineIDList:
|
| | | continue
|
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | fbLinePlayerCntDict[fblineID] = [playerCnt]
|
| | | if len(queryFBLineIDList) == len(fbLinePlayerCntDict):
|
| | | break
|
| | |
|
| | | elif tagMapID == ChConfig.Def_FBMapID_ZhuXianBoss:
|
| | | for index in xrange(gameWorldManager.GetGameWorldCount()):
|
| | |
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | ownerName = GameLogic_ZhuXianBoss.GetFirstOwnerName(fblineID)
|
| | | fbLinePlayerCntDict[fblineID] = [playerCnt, ownerName]
|
| | | if not isAllLine:
|
| | | break
|
| | |
|
| | | elif tagMapID == ChConfig.Def_FBMapID_HorsePetBoss:
|
| | | for index in xrange(gameWorldManager.GetGameWorldCount()):
|
| | |
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | hpPer = GameLogic_HorsePetBoss.GetBossRemainHPPer(fblineID, tick)
|
| | | fbLinePlayerCntDict[fblineID] = [playerCnt, str(hpPer)]
|
| | | if not isAllLine:
|
| | | break
|
| | | |
| | | elif tagMapID == ChConfig.Def_FBMapID_AllFamilyBoss:
|
| | | for index in xrange(gameWorldManager.GetGameWorldCount()):
|
| | | gameWorld = IPY_GameWorld.IPY_GameWorld(index)
|
| | |
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | hpPer = GameLogic_AllFamilyBoss.GetBossRemainHPPer(tick)
|
| | | fbLinePlayerCntDict[fblineID] = [playerCnt, str(hpPer)]
|
| | | if not isAllLine:
|
| | | break
|
| | | |
| | | else:
|
| | | return
|
| | | return [tagMapID, fbLinePlayerCntDict]
|
| | |
| | | CrossServerMsg_FBEnd = "FBEnd" # 完成跨服副本
|
| | | CrossServerMsg_NPCAttackCount = "NPCAttackCount" # 攻击NPC次数记录
|
| | | CrossServerMsg_SendMail = "SendMail" # 发送邮件
|
| | | CrossServerMsg_FBPlayerCount = "FBPlayerCount" # 副本功能线路人数同步
|
| | |
|
| | | # 子服发送跨服信息定义
|
| | | ClientServerMsg_ServerInitOK = "ServerInitOK" # 子服启动成功
|