xdh
2019-02-22 c04a87b2679e8561dcbe3fad845e169a27f1ec46
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -20127,6 +20127,117 @@
#------------------------------------------------------
# A8 16 神秘商店商品信息 #tagMCMysticalShopInfo
class  tagMCMysticalShopGoods(Structure):
    _pack_ = 1
    _fields_ = [
                  ("GoodsID", c_int),    # 商品ID
                  ]
    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.GoodsID = 0
        return
    def GetLength(self):
        return sizeof(tagMCMysticalShopGoods)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A8 16 神秘商店商品信息 //tagMCMysticalShopInfo:
                                GoodsID:%d
                                '''\
                                %(
                                self.GoodsID
                                )
        return DumpString
class  tagMCMysticalShopInfo(Structure):
    Head = tagHead()
    RefreshCnt = 0    #(WORD RefreshCnt)// 刷新次数
    Count = 0    #(BYTE Count)// 商品数
    GoodsList = list()    #(vector<tagMCMysticalShopGoods> GoodsList)// 商品信息
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xA8
        self.Head.SubCmd = 0x16
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.RefreshCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Count):
            temGoodsList = tagMCMysticalShopGoods()
            _pos = temGoodsList.ReadData(_lpData, _pos)
            self.GoodsList.append(temGoodsList)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xA8
        self.Head.SubCmd = 0x16
        self.RefreshCnt = 0
        self.Count = 0
        self.GoodsList = list()
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 2
        length += 1
        for i in range(self.Count):
            length += self.GoodsList[i].GetLength()
        return length
    def GetBuffer(self):
        data = ''
        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
        data = CommFunc.WriteWORD(data, self.RefreshCnt)
        data = CommFunc.WriteBYTE(data, self.Count)
        for i in range(self.Count):
            data = CommFunc.WriteString(data, self.GoodsList[i].GetLength(), self.GoodsList[i].GetBuffer())
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                RefreshCnt:%d,
                                Count:%d,
                                GoodsList:%s
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.RefreshCnt,
                                self.Count,
                                "..."
                                )
        return DumpString
m_NAtagMCMysticalShopInfo=tagMCMysticalShopInfo()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMysticalShopInfo.Head.Cmd,m_NAtagMCMysticalShopInfo.Head.SubCmd))] = m_NAtagMCMysticalShopInfo
#------------------------------------------------------
# A8 06 通知神秘限购商品时间 #tagMCMysticalShopTimeInfo
class  tagMCMysticalShopTime(Structure):