| | |
| | | ("GubaoID", c_ushort),
|
| | | ("GubaoStar", c_ubyte),
|
| | | ("GubaoLV", c_ubyte),
|
| | | ("EffLayer", c_ubyte), # 该特殊效果累加层值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.GubaoID = 0
|
| | | self.GubaoStar = 0
|
| | | self.GubaoLV = 0
|
| | | self.EffLayer = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | DumpString = '''// A3 C7 古宝信息 //tagMCGubaoInfo:
|
| | | GubaoID:%d,
|
| | | GubaoStar:%d,
|
| | | GubaoLV:%d
|
| | | GubaoLV:%d,
|
| | | EffLayer:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.GubaoStar,
|
| | | self.GubaoLV
|
| | | self.GubaoLV,
|
| | | self.EffLayer
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | Count = 0 #(WORD Count)
|
| | | GubaoInfoList = list() #(vector<tagMCGubao> GubaoInfoList)
|
| | | data = None
|
| | |
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temGubaoInfoList = tagMCGubao()
|
| | | _pos = temGubaoInfoList.ReadData(_lpData, _pos)
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.GubaoInfoList[i].GetLength()
|
| | |
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.GubaoInfoList[i].GetLength(), self.GubaoInfoList[i].GetBuffer())
|
| | | return data
|
| | |
| | |
|
| | | m_NAtagMCGubaoInfo=tagMCGubaoInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoInfo.Head.Cmd,m_NAtagMCGubaoInfo.Head.SubCmd))] = m_NAtagMCGubaoInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 CA 古宝物品特殊效果信息 #tagMCGubaoItemEffInfo
|
| | |
|
| | | class tagMCGubaoItemEff(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GubaoID", c_ushort), |
| | | ("EffType", c_ubyte), # 不同古宝ID允许拥有相同效果类型,进度值每个古宝ID单独统计
|
| | | ("EffValue", c_int), # 该效果目前累加值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.GubaoID = 0
|
| | | self.EffType = 0
|
| | | self.EffValue = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCGubaoItemEff)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 CA 古宝物品特殊效果信息 //tagMCGubaoItemEffInfo:
|
| | | GubaoID:%d,
|
| | | EffType:%d,
|
| | | EffValue:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.EffType,
|
| | | self.EffValue
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoItemEffInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(WORD Count)
|
| | | ItemEffInfoList = list() #(vector<tagMCGubaoItemEff> ItemEffInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCA
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temItemEffInfoList = tagMCGubaoItemEff()
|
| | | _pos = temItemEffInfoList.ReadData(_lpData, _pos)
|
| | | self.ItemEffInfoList.append(temItemEffInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCA
|
| | | self.Count = 0
|
| | | self.ItemEffInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.ItemEffInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.ItemEffInfoList[i].GetLength(), self.ItemEffInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | ItemEffInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCGubaoItemEffInfo=tagMCGubaoItemEffInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoItemEffInfo.Head.Cmd,m_NAtagMCGubaoItemEffInfo.Head.SubCmd))] = m_NAtagMCGubaoItemEffInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 CB 古宝碎片信息 #tagMCGubaoPieceInfo
|
| | |
|
| | | class tagMCGubaoPiece(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GubaoID", c_ushort), |
| | | ("PieceCount", c_int), # 当前碎片个数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.GubaoID = 0
|
| | | self.PieceCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCGubaoPiece)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 CB 古宝碎片信息 //tagMCGubaoPieceInfo:
|
| | | GubaoID:%d,
|
| | | PieceCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.PieceCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoPieceInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | PieceInfoList = list() #(vector<tagMCGubaoPiece> PieceInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temPieceInfoList = tagMCGubaoPiece()
|
| | | _pos = temPieceInfoList.ReadData(_lpData, _pos)
|
| | | self.PieceInfoList.append(temPieceInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | self.Count = 0
|
| | | self.PieceInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.PieceInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.PieceInfoList[i].GetLength(), self.PieceInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | PieceInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCGubaoPieceInfo=tagMCGubaoPieceInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoPieceInfo.Head.Cmd,m_NAtagMCGubaoPieceInfo.Head.SubCmd))] = m_NAtagMCGubaoPieceInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|