| | |
| | |
|
| | | class tagMCTreasureResult(Structure):
|
| | | Head = tagHead()
|
| | | TreasureType = 0 #(BYTE TreasureType)//寻宝类型
|
| | | TreasureIndex = 0 #(BYTE TreasureIndex)//寻宝索引
|
| | | CostType = 0 #(BYTE CostType)//消耗类型:0-默认仙玉;1-免费次数;2-寻宝道具
|
| | | AddMoneyType = 0 #(BYTE AddMoneyType)// 本次寻宝增加的积分货币类型,可能为0
|
| | | AddMoneyValue = 0 #(WORD AddMoneyValue)// 本次寻宝增加的积分货币值,可能为0
|
| | | AddTreasureLuck = 0 #(WORD AddTreasureLuck)// 本次寻宝增加的幸运值
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.TreasureType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.TreasureIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.CostType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.AddMoneyType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.AddMoneyValue,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.AddTreasureLuck,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x50
|
| | | self.TreasureType = 0
|
| | | self.TreasureIndex = 0
|
| | | self.CostType = 0
|
| | | self.AddMoneyType = 0
|
| | | self.AddMoneyValue = 0
|
| | | self.AddTreasureLuck = 0
|
| | |
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | length += 1
|
| | | length += 1
|
| | | length += 2
|
| | | length += 2
|
| | | length += 2
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.TreasureType)
|
| | | data = CommFunc.WriteBYTE(data, self.TreasureIndex)
|
| | | data = CommFunc.WriteBYTE(data, self.CostType)
|
| | | data = CommFunc.WriteBYTE(data, self.AddMoneyType)
|
| | | data = CommFunc.WriteWORD(data, self.AddMoneyValue)
|
| | | data = CommFunc.WriteWORD(data, self.AddTreasureLuck)
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | TreasureType:%d,
|
| | | TreasureIndex:%d,
|
| | | CostType:%d,
|
| | | AddMoneyType:%d,
|
| | | AddMoneyValue:%d,
|
| | | AddTreasureLuck:%d,
|
| | |
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.TreasureType,
|
| | | self.TreasureIndex,
|
| | | self.CostType,
|
| | | self.AddMoneyType,
|
| | | self.AddMoneyValue,
|
| | | self.AddTreasureLuck,
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 32 命格信息 #tagSCMinggeInfo
|
| | |
|
| | | class tagSCMinggeInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GanwuLV", c_ushort), #感悟等级,从1开始
|
| | | ("GanwuExp", c_int), #当前感悟等级经验,每级从0开始
|
| | | ("Lingying", c_int), #当前灵应值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x32
|
| | | 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 = 0xB1
|
| | | self.SubCmd = 0x32
|
| | | self.GanwuLV = 0
|
| | | self.GanwuExp = 0
|
| | | self.Lingying = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagSCMinggeInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 32 命格信息 //tagSCMinggeInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | GanwuLV:%d,
|
| | | GanwuExp:%d,
|
| | | Lingying:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.GanwuLV,
|
| | | self.GanwuExp,
|
| | | self.Lingying
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagSCMinggeInfo=tagSCMinggeInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCMinggeInfo.Cmd,m_NAtagSCMinggeInfo.SubCmd))] = m_NAtagSCMinggeInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 19 形象信息 #tagSCModelInfo
|
| | |
|
| | | class tagSCModel(Structure):
|