hxp
2023-12-28 8e25bc7b9ca60ea789374fa70e0ddae4a5adc79a
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -4723,6 +4723,84 @@
#------------------------------------------------------
# A1 25 代币购买充值商品编号商品 #tagCMCoinBuyOrderInfo
class  tagCMCoinBuyOrderInfo(Structure):
    Head = tagHead()
    AppIDLen = 0    #(BYTE AppIDLen)
    AppID = ""    #(String AppID)
    OrderInfoLen = 0    #(BYTE OrderInfoLen)
    OrderInfo = ""    #(String OrderInfo)//商品编号
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xA1
        self.Head.SubCmd = 0x25
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.AppIDLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        self.AppID,_pos = CommFunc.ReadString(_lpData, _pos,self.AppIDLen)
        self.OrderInfoLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        self.OrderInfo,_pos = CommFunc.ReadString(_lpData, _pos,self.OrderInfoLen)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xA1
        self.Head.SubCmd = 0x25
        self.AppIDLen = 0
        self.AppID = ""
        self.OrderInfoLen = 0
        self.OrderInfo = ""
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 1
        length += len(self.AppID)
        length += 1
        length += len(self.OrderInfo)
        return length
    def GetBuffer(self):
        data = ''
        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
        data = CommFunc.WriteBYTE(data, self.AppIDLen)
        data = CommFunc.WriteString(data, self.AppIDLen, self.AppID)
        data = CommFunc.WriteBYTE(data, self.OrderInfoLen)
        data = CommFunc.WriteString(data, self.OrderInfoLen, self.OrderInfo)
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                AppIDLen:%d,
                                AppID:%s,
                                OrderInfoLen:%d,
                                OrderInfo:%s
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.AppIDLen,
                                self.AppID,
                                self.OrderInfoLen,
                                self.OrderInfo
                                )
        return DumpString
m_NAtagCMCoinBuyOrderInfo=tagCMCoinBuyOrderInfo()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCoinBuyOrderInfo.Head.Cmd,m_NAtagCMCoinBuyOrderInfo.Head.SubCmd))] = m_NAtagCMCoinBuyOrderInfo
#------------------------------------------------------
# A1 20 货币兑换 #tagCMMoneyExchange
class  tagCMMoneyExchange(Structure):