hxp
2024-09-04 766ab5d48e5ae032bbdcea7113abf5ac126cf8ac
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -50716,6 +50716,114 @@
#------------------------------------------------------
# B1 16 累计消耗货币信息 #tagMCUseMoneyTotalInfo
class  tagMCUseMoneyTotal(Structure):
    _pack_ = 1
    _fields_ = [
                  ("MoneyType", c_ubyte),    # 货币类型,仅同步需要记录的货币类型
                  ("UseTotal", 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.MoneyType = 0
        self.UseTotal = 0
        return
    def GetLength(self):
        return sizeof(tagMCUseMoneyTotal)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// B1 16 累计消耗货币信息 //tagMCUseMoneyTotalInfo:
                                MoneyType:%d,
                                UseTotal:%d
                                '''\
                                %(
                                self.MoneyType,
                                self.UseTotal
                                )
        return DumpString
class  tagMCUseMoneyTotalInfo(Structure):
    Head = tagHead()
    Count = 0    #(BYTE Count)
    InfoList = list()    #(vector<tagMCUseMoneyTotal> InfoList)
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xB1
        self.Head.SubCmd = 0x16
        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):
            temInfoList = tagMCUseMoneyTotal()
            _pos = temInfoList.ReadData(_lpData, _pos)
            self.InfoList.append(temInfoList)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xB1
        self.Head.SubCmd = 0x16
        self.Count = 0
        self.InfoList = list()
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 1
        for i in range(self.Count):
            length += self.InfoList[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.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                Count:%d,
                                InfoList:%s
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.Count,
                                "..."
                                )
        return DumpString
m_NAtagMCUseMoneyTotalInfo=tagMCUseMoneyTotalInfo()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCUseMoneyTotalInfo.Head.Cmd,m_NAtagMCUseMoneyTotalInfo.Head.SubCmd))] = m_NAtagMCUseMoneyTotalInfo
#------------------------------------------------------
# B1 14 仙宫信息 #tagMCXiangongInfo
class  tagMCXiangong(Structure):