| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 BE 通知客户端法宝精炼等级 #tagMCMagicWeaponMsg
|
| | |
|
| | | class tagMCMagicWeaponLV(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("MWID", c_int), # 法宝ID
|
| | | ("MWLV", c_ubyte), # 精炼等级
|
| | | ]
|
| | |
|
| | | 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.MWID = 0
|
| | | self.MWLV = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCMagicWeaponLV)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 BE 通知客户端法宝精炼等级 //tagMCMagicWeaponMsg:
|
| | | MWID:%d,
|
| | | MWLV:%d
|
| | | '''\
|
| | | %(
|
| | | self.MWID,
|
| | | self.MWLV
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCMagicWeaponMsg(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)// 法宝个数
|
| | | MWInfo = list() #(vector<tagMCMagicWeaponLV> MWInfo)//法宝信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xBE
|
| | | 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):
|
| | | temMWInfo = tagMCMagicWeaponLV()
|
| | | _pos = temMWInfo.ReadData(_lpData, _pos)
|
| | | self.MWInfo.append(temMWInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xBE
|
| | | self.Count = 0
|
| | | self.MWInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.MWInfo[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.MWInfo[i].GetLength(), self.MWInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | MWInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCMagicWeaponMsg=tagMCMagicWeaponMsg()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMagicWeaponMsg.Head.Cmd,m_NAtagMCMagicWeaponMsg.Head.SubCmd))] = m_NAtagMCMagicWeaponMsg
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 46 大师经验信息 #tagMCGreatMasterExp
|
| | |
|
| | | class tagMCGreatMasterExp(Structure):
|