xdh
2018-08-21 80f11b590ece01d82d2af052876366bd2c1df2eb
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -2667,6 +2667,114 @@
#------------------------------------------------------
# A9 04 通知神兽副本NPC刷新时间 #tagGCDogzNPCRefreshTime
class  tagDogzTimeInfoObj(Structure):
    _pack_ = 1
    _fields_ = [
                  ("NPCID", c_int),    # npcid
                  ("RefreshSecond", 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.NPCID = 0
        self.RefreshSecond = 0
        return
    def GetLength(self):
        return sizeof(tagDogzTimeInfoObj)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A9 04 通知神兽副本NPC刷新时间 //tagGCDogzNPCRefreshTime:
                                NPCID:%d,
                                RefreshSecond:%d
                                '''\
                                %(
                                self.NPCID,
                                self.RefreshSecond
                                )
        return DumpString
class  tagGCDogzNPCRefreshTime(Structure):
    Head = tagHead()
    Cnt = 0    #(BYTE Cnt)//信息个数
    InfoList = list()    #(vector<tagDogzTimeInfoObj> InfoList)//信息列表
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xA9
        self.Head.SubCmd = 0x04
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Cnt):
            temInfoList = tagDogzTimeInfoObj()
            _pos = temInfoList.ReadData(_lpData, _pos)
            self.InfoList.append(temInfoList)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xA9
        self.Head.SubCmd = 0x04
        self.Cnt = 0
        self.InfoList = list()
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 1
        for i in range(self.Cnt):
            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.Cnt)
        for i in range(self.Cnt):
            data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                Cnt:%d,
                                InfoList:%s
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.Cnt,
                                "..."
                                )
        return DumpString
m_NAtagGCDogzNPCRefreshTime=tagGCDogzNPCRefreshTime()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCDogzNPCRefreshTime.Head.Cmd,m_NAtagGCDogzNPCRefreshTime.Head.SubCmd))] = m_NAtagGCDogzNPCRefreshTime
#------------------------------------------------------
# A9 A9 通知好友互赠精力信息 #tagGCFriendSendEnergyInfo
class  tagGCFriendSendEnergyInfo(Structure):
@@ -12856,16 +12964,12 @@
class  tagMCNPCIDCollectionCnt(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("NPCID", c_int),    #NPCID
                  ("CollectionCnt", c_ubyte),    #已采集次数
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA3
        self.SubCmd = 0x26
        return
    def ReadData(self, stringData, _pos=0, _len=0):
@@ -12874,8 +12978,6 @@
        return _pos + self.GetLength()
    def Clear(self):
        self.Cmd = 0xA3
        self.SubCmd = 0x26
        self.NPCID = 0
        self.CollectionCnt = 0
        return
@@ -12888,14 +12990,10 @@
    def OutputString(self):
        DumpString = '''// A3 26 NPCID已采集次数信息 //tagMCNPCIDCollectionCntInfo:
                                Cmd:%s,
                                SubCmd:%s,
                                NPCID:%d,
                                CollectionCnt:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.NPCID,
                                self.CollectionCnt
                                )
@@ -16426,6 +16524,121 @@
#------------------------------------------------------
# A7 14 通知查询的NPC数量 #tagMCNPCCntList
class  tagMCNPCCntInfo(Structure):
    _pack_ = 1
    _fields_ = [
                  ("NPCID", c_int),
                  ("Cnt", 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.NPCID = 0
        self.Cnt = 0
        return
    def GetLength(self):
        return sizeof(tagMCNPCCntInfo)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A7 14 通知查询的NPC数量 //tagMCNPCCntList:
                                NPCID:%d,
                                Cnt:%d
                                '''\
                                %(
                                self.NPCID,
                                self.Cnt
                                )
        return DumpString
class  tagMCNPCCntList(Structure):
    Head = tagHead()
    MapID = 0    #(DWORD MapID)
    NPCInfoCnt = 0    #(BYTE NPCInfoCnt)
    NPCInfoList = list()    #(vector<tagMCNPCCntInfo> NPCInfoList)
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xA7
        self.Head.SubCmd = 0x14
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
        self.NPCInfoCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.NPCInfoCnt):
            temNPCInfoList = tagMCNPCCntInfo()
            _pos = temNPCInfoList.ReadData(_lpData, _pos)
            self.NPCInfoList.append(temNPCInfoList)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xA7
        self.Head.SubCmd = 0x14
        self.MapID = 0
        self.NPCInfoCnt = 0
        self.NPCInfoList = list()
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 4
        length += 1
        for i in range(self.NPCInfoCnt):
            length += self.NPCInfoList[i].GetLength()
        return length
    def GetBuffer(self):
        data = ''
        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
        data = CommFunc.WriteDWORD(data, self.MapID)
        data = CommFunc.WriteBYTE(data, self.NPCInfoCnt)
        for i in range(self.NPCInfoCnt):
            data = CommFunc.WriteString(data, self.NPCInfoList[i].GetLength(), self.NPCInfoList[i].GetBuffer())
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                MapID:%d,
                                NPCInfoCnt:%d,
                                NPCInfoList:%s
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.MapID,
                                self.NPCInfoCnt,
                                "..."
                                )
        return DumpString
m_NAtagMCNPCCntList=tagMCNPCCntList()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCNPCCntList.Head.Cmd,m_NAtagMCNPCCntList.Head.SubCmd))] = m_NAtagMCNPCCntList
#------------------------------------------------------
#A7 01 通知选中对象 # tagMCNotifySelectObj
class  tagMCNotifySelectObj(Structure):
@@ -16491,8 +16704,6 @@
class  tagMCNPCInfo(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("ObjID", c_int),    
                  ("NPCID", c_int),    
                  ("NPCHP", c_int),    
@@ -16505,8 +16716,6 @@
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA7
        self.SubCmd = 0x06
        return
    def ReadData(self, stringData, _pos=0, _len=0):
@@ -16515,8 +16724,6 @@
        return _pos + self.GetLength()
    def Clear(self):
        self.Cmd = 0xA7
        self.SubCmd = 0x06
        self.ObjID = 0
        self.NPCID = 0
        self.NPCHP = 0
@@ -16535,8 +16742,6 @@
    def OutputString(self):
        DumpString = '''// A7 06 通知查询的NPC信息 //tagMCNPCInfoList:
                                Cmd:%s,
                                SubCmd:%s,
                                ObjID:%d,
                                NPCID:%d,
                                NPCHP:%d,
@@ -16547,8 +16752,6 @@
                                RefreshSecond:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.ObjID,
                                self.NPCID,
                                self.NPCHP,