| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #×÷Õß :   | 
|   | 
| import CommFunc  | 
| import binascii  | 
| import copy  | 
| from struct import *  | 
| from ctypes import *  | 
| #²å¼þÍ·  | 
| #   | 
| #  | 
| ChNetPackDict={}  | 
| class  BString:  | 
|     NameLen = 0        # (BYTE NameLen )  | 
|     Name = ""        # (String Name )     //size = NameLen  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|   | 
|         return  | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|   | 
|         self.NameLen, _pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.Name, _pos = CommFunc.ReadString(_lpData, _pos, self.NameLen)  | 
|   | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.NameLen = 0  | 
|         self.Name = ""  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += 1  | 
|         length += self.Name.Length();  | 
|         return  length;  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteBYTE(data, self.NameLen)  | 
|         data = CommFunc.WriteString(data, self.NameLen, self.Name)  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = ''':  | 
|                             NameLen:%d,  | 
|                             Name:%s  | 
|                             '''\  | 
|                             %(  | 
|                             self.NameLen,  | 
|                             self.Name  | 
|                             )  | 
|   | 
|         return  DumpString  | 
|   | 
| class  tagHead:  | 
|     Cmd = 0     # (BYTE Cmd )  | 
|     SubCmd = 0      # (BYTE SubCmd )  | 
|     def __init__(self):  | 
|         self.Clear()  | 
|   | 
|         return  | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|   | 
|         self.Cmd, _pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.SubCmd, _pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|   | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Cmd = 0  | 
|         self.SubCmd = 0  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += 1  | 
|         length += 1  | 
|         return  length;  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteBYTE(data, self.Cmd)  | 
|         data = CommFunc.WriteBYTE(data, self.SubCmd)  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = ''':  | 
|                             Cmd:%d,  | 
|                             SubCmd:%d  | 
|                             '''\  | 
|                             %(  | 
|                             self.Cmd,  | 
|                             self.SubCmd  | 
|                             )  | 
|   | 
|         return  DumpString  | 
| #------------------------------------------------------  | 
| # 05 03 Íæ¼ÒÀ뿪¶ÓÎé #tagGMPlayerLeaveTeam  | 
|   | 
| class  tagGMPlayerLeaveTeam(Structure):  | 
|     _pack_ = 1  | 
|     _fields_ = [  | 
|                   ("Cmd", c_ubyte),  | 
|                   ("SubCmd", c_ubyte),  | 
|                   ("PlayerID", c_int),      | 
|                   ("CopyMapID", c_int),      | 
|                   ("TeamID", c_int),      | 
|                   ]  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Cmd = 0x05  | 
|         self.SubCmd = 0x03  | 
|         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 = 0x05  | 
|         self.SubCmd = 0x03  | 
|         self.PlayerID = 0  | 
|         self.CopyMapID = 0  | 
|         self.TeamID = 0  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         return sizeof(tagGMPlayerLeaveTeam)  | 
|   | 
|     def GetBuffer(self):  | 
|         return string_at(addressof(self), self.GetLength())  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''// 05 03 Íæ¼ÒÀ뿪¶ÓÎé //tagGMPlayerLeaveTeam:  | 
|                                 Cmd:%s,  | 
|                                 SubCmd:%s,  | 
|                                 PlayerID:%d,  | 
|                                 CopyMapID:%d,  | 
|                                 TeamID:%d  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Cmd,  | 
|                                 self.SubCmd,  | 
|                                 self.PlayerID,  | 
|                                 self.CopyMapID,  | 
|                                 self.TeamID  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMPlayerLeaveTeam=tagGMPlayerLeaveTeam()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMPlayerLeaveTeam.Cmd,m_NAtagGMPlayerLeaveTeam.SubCmd))] = m_NAtagGMPlayerLeaveTeam  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| # 05 02 ¶ÓÎéÐÅϢˢР#tagGMTeamInfo  | 
|   | 
| class  tagGMTeamMemInfo(Structure):  | 
|     _pack_ = 1  | 
|     _fields_ = [  | 
|                   ("PlayerID", c_int),    #¶ÓÔ±ID  | 
|                   ("MapID", c_int),    #ËùÔÚµØÍ¼  | 
|                   ("VIPLV", c_ubyte),    #ÓÐЧVIPµÈ¼¶£¬0´ú±íÎÞVIP»òÒѹýÆÚ  | 
|                   ]  | 
|   | 
|     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.PlayerID = 0  | 
|         self.MapID = 0  | 
|         self.VIPLV = 0  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         return sizeof(tagGMTeamMemInfo)  | 
|   | 
|     def GetBuffer(self):  | 
|         return string_at(addressof(self), self.GetLength())  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''// 05 02 ¶ÓÎéÐÅϢˢР//tagGMTeamInfo:  | 
|                                 PlayerID:%d,  | 
|                                 MapID:%d,  | 
|                                 VIPLV:%d  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.PlayerID,  | 
|                                 self.MapID,  | 
|                                 self.VIPLV  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| class  tagGMTeamInfo(Structure):  | 
|     Head = tagHead()  | 
|     PlayerID = 0    #(DWORD PlayerID)  | 
|     TeamID = 0    #(DWORD TeamID)  | 
|     TeamLV = 0    #(BYTE TeamLV)  | 
|     MemCnt = 0    #(BYTE MemCnt)  | 
|     MemInfoList = list()    #(vector<tagGMTeamMemInfo> MemInfoList)  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Head.Cmd = 0x05  | 
|         self.Head.SubCmd = 0x02  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         _pos = self.Head.ReadData(_lpData, _pos)  | 
|         self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.TeamID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.TeamLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.MemCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         for i in range(self.MemCnt):  | 
|             temMemInfoList = tagGMTeamMemInfo()  | 
|             _pos = temMemInfoList.ReadData(_lpData, _pos)  | 
|             self.MemInfoList.append(temMemInfoList)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Head = tagHead()  | 
|         self.Head.Clear()  | 
|         self.Head.Cmd = 0x05  | 
|         self.Head.SubCmd = 0x02  | 
|         self.PlayerID = 0  | 
|         self.TeamID = 0  | 
|         self.TeamLV = 0  | 
|         self.MemCnt = 0  | 
|         self.MemInfoList = list()  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += self.Head.GetLength()  | 
|         length += 4  | 
|         length += 4  | 
|         length += 1  | 
|         length += 1  | 
|         for i in range(self.MemCnt):  | 
|             length += self.MemInfoList[i].GetLength()  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())  | 
|         data = CommFunc.WriteDWORD(data, self.PlayerID)  | 
|         data = CommFunc.WriteDWORD(data, self.TeamID)  | 
|         data = CommFunc.WriteBYTE(data, self.TeamLV)  | 
|         data = CommFunc.WriteBYTE(data, self.MemCnt)  | 
|         for i in range(self.MemCnt):  | 
|             data = CommFunc.WriteString(data, self.MemInfoList[i].GetLength(), self.MemInfoList[i].GetBuffer())  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 Head:%s,  | 
|                                 PlayerID:%d,  | 
|                                 TeamID:%d,  | 
|                                 TeamLV:%d,  | 
|                                 MemCnt:%d,  | 
|                                 MemInfoList:%s  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Head.OutputString(),  | 
|                                 self.PlayerID,  | 
|                                 self.TeamID,  | 
|                                 self.TeamLV,  | 
|                                 self.MemCnt,  | 
|                                 "..."  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMTeamInfo=tagGMTeamInfo()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMTeamInfo.Head.Cmd,m_NAtagGMTeamInfo.Head.SubCmd))] = m_NAtagGMTeamInfo  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| #05 01 ºÃÓÑÐÅÏ¢#tagGMFriendInfo  | 
|   | 
| class  tagGMPlayerFrendInfo(Structure):  | 
|     _pack_ = 1  | 
|     _fields_ = [  | 
|                   ("TagID", 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.TagID = 0  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         return sizeof(tagGMPlayerFrendInfo)  | 
|   | 
|     def GetBuffer(self):  | 
|         return string_at(addressof(self), self.GetLength())  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''//05 01 ºÃÓÑÐÅÏ¢//tagGMFriendInfo:  | 
|                                 TagID:%d  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.TagID  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| class  tagGMFriendInfo(Structure):  | 
|     Head = tagHead()  | 
|     PlayerID = 0    #(DWORD PlayerID)  | 
|     FriendCnt = 0    #(WORD FriendCnt)  | 
|     Friends = list()    #(vector<tagGMPlayerFrendInfo> Friends)//size = FriendCnt  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Head.Cmd = 0x05  | 
|         self.Head.SubCmd = 0x01  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         _pos = self.Head.ReadData(_lpData, _pos)  | 
|         self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.FriendCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)  | 
|         for i in range(self.FriendCnt):  | 
|             temFriends = tagGMPlayerFrendInfo()  | 
|             _pos = temFriends.ReadData(_lpData, _pos)  | 
|             self.Friends.append(temFriends)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Head = tagHead()  | 
|         self.Head.Clear()  | 
|         self.Head.Cmd = 0x05  | 
|         self.Head.SubCmd = 0x01  | 
|         self.PlayerID = 0  | 
|         self.FriendCnt = 0  | 
|         self.Friends = list()  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += self.Head.GetLength()  | 
|         length += 4  | 
|         length += 2  | 
|         for i in range(self.FriendCnt):  | 
|             length += self.Friends[i].GetLength()  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())  | 
|         data = CommFunc.WriteDWORD(data, self.PlayerID)  | 
|         data = CommFunc.WriteWORD(data, self.FriendCnt)  | 
|         for i in range(self.FriendCnt):  | 
|             data = CommFunc.WriteString(data, self.Friends[i].GetLength(), self.Friends[i].GetBuffer())  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 Head:%s,  | 
|                                 PlayerID:%d,  | 
|                                 FriendCnt:%d,  | 
|                                 Friends:%s  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Head.OutputString(),  | 
|                                 self.PlayerID,  | 
|                                 self.FriendCnt,  | 
|                                 "..."  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMFriendInfo=tagGMFriendInfo()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMFriendInfo.Head.Cmd,m_NAtagGMFriendInfo.Head.SubCmd))] = m_NAtagGMFriendInfo  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| # 03 03 Íæ¼Ò»º´æÐÅϢͬ²½ #tagGMPlayerCache  | 
|   | 
| class  tagGMPlayerCache(Structure):  | 
|     Head = tagHead()  | 
|     PlayerID = 0    #(DWORD PlayerID)//Íæ¼ÒID  | 
|     FindPlayerID = 0    #(DWORD FindPlayerID)//Òª²éѯµÄÍæ¼ÒID  | 
|     PropDataSize = 0    #(WORD PropDataSize)  | 
|     PropData = ""    #(String PropData)//ÊôÐԼǼ  | 
|     PlusDataSize = 0    #(WORD PlusDataSize)  | 
|     PlusData = ""    #(String PlusData)//À©Õ¹¼Ç¼  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Head.Cmd = 0x03  | 
|         self.Head.SubCmd = 0x03  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         _pos = self.Head.ReadData(_lpData, _pos)  | 
|         self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.FindPlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.PropDataSize,_pos = CommFunc.ReadWORD(_lpData, _pos)  | 
|         self.PropData,_pos = CommFunc.ReadString(_lpData, _pos,self.PropDataSize)  | 
|         self.PlusDataSize,_pos = CommFunc.ReadWORD(_lpData, _pos)  | 
|         self.PlusData,_pos = CommFunc.ReadString(_lpData, _pos,self.PlusDataSize)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Head = tagHead()  | 
|         self.Head.Clear()  | 
|         self.Head.Cmd = 0x03  | 
|         self.Head.SubCmd = 0x03  | 
|         self.PlayerID = 0  | 
|         self.FindPlayerID = 0  | 
|         self.PropDataSize = 0  | 
|         self.PropData = ""  | 
|         self.PlusDataSize = 0  | 
|         self.PlusData = ""  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += self.Head.GetLength()  | 
|         length += 4  | 
|         length += 4  | 
|         length += 2  | 
|         length += len(self.PropData)  | 
|         length += 2  | 
|         length += len(self.PlusData)  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())  | 
|         data = CommFunc.WriteDWORD(data, self.PlayerID)  | 
|         data = CommFunc.WriteDWORD(data, self.FindPlayerID)  | 
|         data = CommFunc.WriteWORD(data, self.PropDataSize)  | 
|         data = CommFunc.WriteString(data, self.PropDataSize, self.PropData)  | 
|         data = CommFunc.WriteWORD(data, self.PlusDataSize)  | 
|         data = CommFunc.WriteString(data, self.PlusDataSize, self.PlusData)  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 Head:%s,  | 
|                                 PlayerID:%d,  | 
|                                 FindPlayerID:%d,  | 
|                                 PropDataSize:%d,  | 
|                                 PropData:%s,  | 
|                                 PlusDataSize:%d,  | 
|                                 PlusData:%s  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Head.OutputString(),  | 
|                                 self.PlayerID,  | 
|                                 self.FindPlayerID,  | 
|                                 self.PropDataSize,  | 
|                                 self.PropData,  | 
|                                 self.PlusDataSize,  | 
|                                 self.PlusData  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMPlayerCache=tagGMPlayerCache()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMPlayerCache.Head.Cmd,m_NAtagGMPlayerCache.Head.SubCmd))] = m_NAtagGMPlayerCache  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| #03 02 Íæ¼ÒÁìÈ¡²¹³¥½á¹û#tagGMRequestCompensationResult  | 
|   | 
| class  tagGMCompensationItem(Structure):  | 
|     ItemID = 0    #(DWORD ItemID)//ÎïÆ·ID  | 
|     Count = 0    #(DWORD Count)//ÊýÁ¿  | 
|     IsBind = 0    #(BYTE IsBind)//ÊÇ·ñ°ó¶¨  | 
|     UserDataLen = 0    #(DWORD UserDataLen)  | 
|     UserData = ""    #(String UserData)//×Ô¶¨ÒåÊý¾Ý  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         self.ItemID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.Count,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.IsBind,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.UserDataLen,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.UserData,_pos = CommFunc.ReadString(_lpData, _pos,self.UserDataLen)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.ItemID = 0  | 
|         self.Count = 0  | 
|         self.IsBind = 0  | 
|         self.UserDataLen = 0  | 
|         self.UserData = ""  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += 4  | 
|         length += 4  | 
|         length += 1  | 
|         length += 4  | 
|         length += len(self.UserData)  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteDWORD(data, self.ItemID)  | 
|         data = CommFunc.WriteDWORD(data, self.Count)  | 
|         data = CommFunc.WriteBYTE(data, self.IsBind)  | 
|         data = CommFunc.WriteDWORD(data, self.UserDataLen)  | 
|         data = CommFunc.WriteString(data, self.UserDataLen, self.UserData)  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 ItemID:%d,  | 
|                                 Count:%d,  | 
|                                 IsBind:%d,  | 
|                                 UserDataLen:%d,  | 
|                                 UserData:%s  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.ItemID,  | 
|                                 self.Count,  | 
|                                 self.IsBind,  | 
|                                 self.UserDataLen,  | 
|                                 self.UserData  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| class  tagGMRequestCompensationResult(Structure):  | 
|     Head = tagHead()  | 
|     PlayerID = 0    #(DWORD PlayerID)//Íæ¼ÒID  | 
|     CompensationType = 0    #(BYTE CompensationType)//²¹³¥ÀàÐÍ 0 È«·þ 1 ¸öÈË  | 
|     GUID = ""    #(char GUID[40])//¶ÔÓ¦µÄ²¹³¥ID  | 
|     CreateTime = ""    #(char CreateTime[30])//Óʼþ½ÓÊÕʱ¼ä  | 
|     TextLen = 0    #(DWORD TextLen)//ÎÄ×ÖÄÚÈݳ¤¶È  | 
|     Text = ""    #(String Text)//ÎÄ×ÖÄÚÈÝ  | 
|     Count = 0    #(BYTE Count)//µ±Ç°²¹³¥ÎïÆ·Êý  | 
|     Gold = 0    #(DWORD Gold)//ÏÉÓñ  | 
|     GoldPaper = 0    #(DWORD GoldPaper)//°ó¶¨ÏÉÓñ  | 
|     Silver = 0    #(DWORD Silver)//ÍÇ®  | 
|     MoneySource = 0    #(BYTE MoneySource)//»õ±ÒÀ´Ô´  | 
|     Items = list()    #(vector<tagGMCompensationItem> Items)//²¹³¥ÎïÆ·ÐÅÏ¢  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Head.Cmd = 0x03  | 
|         self.Head.SubCmd = 0x02  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         _pos = self.Head.ReadData(_lpData, _pos)  | 
|         self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.CompensationType,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.GUID,_pos = CommFunc.ReadString(_lpData, _pos,40)  | 
|         self.CreateTime,_pos = CommFunc.ReadString(_lpData, _pos,30)  | 
|         self.TextLen,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.Text,_pos = CommFunc.ReadString(_lpData, _pos,self.TextLen)  | 
|         self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.Gold,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.GoldPaper,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.Silver,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.MoneySource,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         for i in range(self.Count):  | 
|             temItems = tagGMCompensationItem()  | 
|             _pos = temItems.ReadData(_lpData, _pos)  | 
|             self.Items.append(temItems)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Head = tagHead()  | 
|         self.Head.Clear()  | 
|         self.Head.Cmd = 0x03  | 
|         self.Head.SubCmd = 0x02  | 
|         self.PlayerID = 0  | 
|         self.CompensationType = 0  | 
|         self.GUID = ""  | 
|         self.CreateTime = ""  | 
|         self.TextLen = 0  | 
|         self.Text = ""  | 
|         self.Count = 0  | 
|         self.Gold = 0  | 
|         self.GoldPaper = 0  | 
|         self.Silver = 0  | 
|         self.MoneySource = 0  | 
|         self.Items = list()  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += self.Head.GetLength()  | 
|         length += 4  | 
|         length += 1  | 
|         length += 40  | 
|         length += 30  | 
|         length += 4  | 
|         length += len(self.Text)  | 
|         length += 1  | 
|         length += 4  | 
|         length += 4  | 
|         length += 4  | 
|         length += 1  | 
|         for i in range(self.Count):  | 
|             length += self.Items[i].GetLength()  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())  | 
|         data = CommFunc.WriteDWORD(data, self.PlayerID)  | 
|         data = CommFunc.WriteBYTE(data, self.CompensationType)  | 
|         data = CommFunc.WriteString(data, 40, self.GUID)  | 
|         data = CommFunc.WriteString(data, 30, self.CreateTime)  | 
|         data = CommFunc.WriteDWORD(data, self.TextLen)  | 
|         data = CommFunc.WriteString(data, self.TextLen, self.Text)  | 
|         data = CommFunc.WriteBYTE(data, self.Count)  | 
|         data = CommFunc.WriteDWORD(data, self.Gold)  | 
|         data = CommFunc.WriteDWORD(data, self.GoldPaper)  | 
|         data = CommFunc.WriteDWORD(data, self.Silver)  | 
|         data = CommFunc.WriteBYTE(data, self.MoneySource)  | 
|         for i in range(self.Count):  | 
|             data = CommFunc.WriteString(data, self.Items[i].GetLength(), self.Items[i].GetBuffer())  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 Head:%s,  | 
|                                 PlayerID:%d,  | 
|                                 CompensationType:%d,  | 
|                                 GUID:%s,  | 
|                                 CreateTime:%s,  | 
|                                 TextLen:%d,  | 
|                                 Text:%s,  | 
|                                 Count:%d,  | 
|                                 Gold:%d,  | 
|                                 GoldPaper:%d,  | 
|                                 Silver:%d,  | 
|                                 MoneySource:%d,  | 
|                                 Items:%s  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Head.OutputString(),  | 
|                                 self.PlayerID,  | 
|                                 self.CompensationType,  | 
|                                 self.GUID,  | 
|                                 self.CreateTime,  | 
|                                 self.TextLen,  | 
|                                 self.Text,  | 
|                                 self.Count,  | 
|                                 self.Gold,  | 
|                                 self.GoldPaper,  | 
|                                 self.Silver,  | 
|                                 self.MoneySource,  | 
|                                 "..."  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMRequestCompensationResult=tagGMRequestCompensationResult()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMRequestCompensationResult.Head.Cmd,m_NAtagGMRequestCompensationResult.Head.SubCmd))] = m_NAtagGMRequestCompensationResult  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| #02 01 ²éÑ¯Íæ¼ÒÊÇ·ñ¿ÉÒÔÌí¼Ó½»Ò×ËùÎïÆ·½á¹û#tagGMCheckAddPlayerBourseItemResult  | 
|   | 
| class  tagGMCheckAddPlayerBourseItemResult(Structure):  | 
|     Head = tagHead()  | 
|     PlayerID = 0    #(DWORD PlayerID)  | 
|     ItemIndex = 0    #(BYTE ItemIndex)//ÎïÆ·ÔÚ±³°üÖÐË÷Òý  | 
|     Count = 0    #(WORD Count)//³öÊÛÊýÁ¿  | 
|     PriceType = 0    #(BYTE PriceType)//³öÊÛ¼Û¸ñÀàÐÍ  | 
|     PriceCount = 0    #(DWORD PriceCount)//³öÊÛ¼Û¸ñ  | 
|     Result = 0    #(BYTE Result)//ÊÇ·ñ¿ÉÒÔÌí¼ÓÎïÆ·»ØÓ¦  | 
|     Pwd = ""    #(char Pwd[8])//½»Ò×ÃÜÂë  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Head.Cmd = 0x02  | 
|         self.Head.SubCmd = 0x01  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         _pos = self.Head.ReadData(_lpData, _pos)  | 
|         self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.ItemIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)  | 
|         self.PriceType,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.PriceCount,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.Result,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.Pwd,_pos = CommFunc.ReadString(_lpData, _pos,8)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Head = tagHead()  | 
|         self.Head.Clear()  | 
|         self.Head.Cmd = 0x02  | 
|         self.Head.SubCmd = 0x01  | 
|         self.PlayerID = 0  | 
|         self.ItemIndex = 0  | 
|         self.Count = 0  | 
|         self.PriceType = 0  | 
|         self.PriceCount = 0  | 
|         self.Result = 0  | 
|         self.Pwd = ""  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += self.Head.GetLength()  | 
|         length += 4  | 
|         length += 1  | 
|         length += 2  | 
|         length += 1  | 
|         length += 4  | 
|         length += 1  | 
|         length += 8  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())  | 
|         data = CommFunc.WriteDWORD(data, self.PlayerID)  | 
|         data = CommFunc.WriteBYTE(data, self.ItemIndex)  | 
|         data = CommFunc.WriteWORD(data, self.Count)  | 
|         data = CommFunc.WriteBYTE(data, self.PriceType)  | 
|         data = CommFunc.WriteDWORD(data, self.PriceCount)  | 
|         data = CommFunc.WriteBYTE(data, self.Result)  | 
|         data = CommFunc.WriteString(data, 8, self.Pwd)  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 Head:%s,  | 
|                                 PlayerID:%d,  | 
|                                 ItemIndex:%d,  | 
|                                 Count:%d,  | 
|                                 PriceType:%d,  | 
|                                 PriceCount:%d,  | 
|                                 Result:%d,  | 
|                                 Pwd:%s  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Head.OutputString(),  | 
|                                 self.PlayerID,  | 
|                                 self.ItemIndex,  | 
|                                 self.Count,  | 
|                                 self.PriceType,  | 
|                                 self.PriceCount,  | 
|                                 self.Result,  | 
|                                 self.Pwd  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMCheckAddPlayerBourseItemResult=tagGMCheckAddPlayerBourseItemResult()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMCheckAddPlayerBourseItemResult.Head.Cmd,m_NAtagGMCheckAddPlayerBourseItemResult.Head.SubCmd))] = m_NAtagGMCheckAddPlayerBourseItemResult  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| #02 02 Íæ¼Ò¹ºÂò½»Ò×ËùÎïÆ·²éѯ½á¹û#tagGMCheckBuyBourseItemResult  | 
|   | 
| class  tagGMCheckBuyBourseItemResult(Structure):  | 
|     Head = tagHead()  | 
|     PlayerID = 0    #(DWORD PlayerID)  | 
|     ItemGUID = ""    #(char ItemGUID[40])  | 
|     PriceType = 0    #(BYTE PriceType)//³öÊÛ¼Û¸ñÀàÐÍ  | 
|     PriceCount = 0    #(DWORD PriceCount)//³öÊÛ¼Û¸ñ  | 
|     ItemName = ""    #(char ItemName[33])//ÎïÆ·Ãû  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Head.Cmd = 0x02  | 
|         self.Head.SubCmd = 0x02  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         _pos = self.Head.ReadData(_lpData, _pos)  | 
|         self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)  | 
|         self.PriceType,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.PriceCount,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.ItemName,_pos = CommFunc.ReadString(_lpData, _pos,33)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Head = tagHead()  | 
|         self.Head.Clear()  | 
|         self.Head.Cmd = 0x02  | 
|         self.Head.SubCmd = 0x02  | 
|         self.PlayerID = 0  | 
|         self.ItemGUID = ""  | 
|         self.PriceType = 0  | 
|         self.PriceCount = 0  | 
|         self.ItemName = ""  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += self.Head.GetLength()  | 
|         length += 4  | 
|         length += 40  | 
|         length += 1  | 
|         length += 4  | 
|         length += 33  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())  | 
|         data = CommFunc.WriteDWORD(data, self.PlayerID)  | 
|         data = CommFunc.WriteString(data, 40, self.ItemGUID)  | 
|         data = CommFunc.WriteBYTE(data, self.PriceType)  | 
|         data = CommFunc.WriteDWORD(data, self.PriceCount)  | 
|         data = CommFunc.WriteString(data, 33, self.ItemName)  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 Head:%s,  | 
|                                 PlayerID:%d,  | 
|                                 ItemGUID:%s,  | 
|                                 PriceType:%d,  | 
|                                 PriceCount:%d,  | 
|                                 ItemName:%s  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Head.OutputString(),  | 
|                                 self.PlayerID,  | 
|                                 self.ItemGUID,  | 
|                                 self.PriceType,  | 
|                                 self.PriceCount,  | 
|                                 self.ItemName  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMCheckBuyBourseItemResult=tagGMCheckBuyBourseItemResult()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMCheckBuyBourseItemResult.Head.Cmd,m_NAtagGMCheckBuyBourseItemResult.Head.SubCmd))] = m_NAtagGMCheckBuyBourseItemResult  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| #02 03 Íæ¼Ò»ñÈ¡½»Ò×ËùÎïÆ·½á¹û#tagGMGiveBourseItem  | 
|   | 
| class  tagGMGiveBourseItem(Structure):  | 
|     Head = tagHead()  | 
|     PlayerID = 0    #(DWORD PlayerID)//µÃµ½ÎïÆ·µÄÍæ¼Ò  | 
|     ItemGUID = ""    #(char ItemGUID[40])  | 
|     ItemID = 0    #(DWORD ItemID)//ÎïÆ·ID  | 
|     PriceType = 0    #(BYTE PriceType)//¼Û¸ñÀàÐÍ   | 
|     PriceCount = 0    #(DWORD PriceCount)//¼Û¸ñ£¬µØÍ¼·þÎñÆ÷¿ÛÈ¡ÏàÓ¦½ðÇ®ºó¸øÓèÎïÆ·£¬ÈçΪ0ÔòΪ³öÊÛÍæ¼ÒÈ¡»ØÎ´ÊÛ³öÎïÆ·  | 
|     Count = 0    #(WORD Count)//µ¥×éÊýÁ¿  | 
|     UserDataLen = 0    #(DWORD UserDataLen)  | 
|     UserData = ""    #(String UserData)//×Ô¶¨ÒåÊý¾Ý  | 
|     EquipGS = 0    #(DWORD EquipGS)//×°±¸ÆÀ·Ö  | 
|     data = None  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Head.Cmd = 0x02  | 
|         self.Head.SubCmd = 0x03  | 
|         return  | 
|   | 
|     def ReadData(self, _lpData, _pos=0, _Len=0):  | 
|         self.Clear()  | 
|         _pos = self.Head.ReadData(_lpData, _pos)  | 
|         self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)  | 
|         self.ItemID,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.PriceType,_pos = CommFunc.ReadBYTE(_lpData, _pos)  | 
|         self.PriceCount,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)  | 
|         self.UserDataLen,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         self.UserData,_pos = CommFunc.ReadString(_lpData, _pos,self.UserDataLen)  | 
|         self.EquipGS,_pos = CommFunc.ReadDWORD(_lpData, _pos)  | 
|         return _pos  | 
|   | 
|     def Clear(self):  | 
|         self.Head = tagHead()  | 
|         self.Head.Clear()  | 
|         self.Head.Cmd = 0x02  | 
|         self.Head.SubCmd = 0x03  | 
|         self.PlayerID = 0  | 
|         self.ItemGUID = ""  | 
|         self.ItemID = 0  | 
|         self.PriceType = 0  | 
|         self.PriceCount = 0  | 
|         self.Count = 0  | 
|         self.UserDataLen = 0  | 
|         self.UserData = ""  | 
|         self.EquipGS = 0  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         length = 0  | 
|         length += self.Head.GetLength()  | 
|         length += 4  | 
|         length += 40  | 
|         length += 4  | 
|         length += 1  | 
|         length += 4  | 
|         length += 2  | 
|         length += 4  | 
|         length += len(self.UserData)  | 
|         length += 4  | 
|   | 
|         return length  | 
|   | 
|     def GetBuffer(self):  | 
|         data = ''  | 
|         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())  | 
|         data = CommFunc.WriteDWORD(data, self.PlayerID)  | 
|         data = CommFunc.WriteString(data, 40, self.ItemGUID)  | 
|         data = CommFunc.WriteDWORD(data, self.ItemID)  | 
|         data = CommFunc.WriteBYTE(data, self.PriceType)  | 
|         data = CommFunc.WriteDWORD(data, self.PriceCount)  | 
|         data = CommFunc.WriteWORD(data, self.Count)  | 
|         data = CommFunc.WriteDWORD(data, self.UserDataLen)  | 
|         data = CommFunc.WriteString(data, self.UserDataLen, self.UserData)  | 
|         data = CommFunc.WriteDWORD(data, self.EquipGS)  | 
|         return data  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''  | 
|                                 Head:%s,  | 
|                                 PlayerID:%d,  | 
|                                 ItemGUID:%s,  | 
|                                 ItemID:%d,  | 
|                                 PriceType:%d,  | 
|                                 PriceCount:%d,  | 
|                                 Count:%d,  | 
|                                 UserDataLen:%d,  | 
|                                 UserData:%s,  | 
|                                 EquipGS:%d  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Head.OutputString(),  | 
|                                 self.PlayerID,  | 
|                                 self.ItemGUID,  | 
|                                 self.ItemID,  | 
|                                 self.PriceType,  | 
|                                 self.PriceCount,  | 
|                                 self.Count,  | 
|                                 self.UserDataLen,  | 
|                                 self.UserData,  | 
|                                 self.EquipGS  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMGiveBourseItem=tagGMGiveBourseItem()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMGiveBourseItem.Head.Cmd,m_NAtagGMGiveBourseItem.Head.SubCmd))] = m_NAtagGMGiveBourseItem  | 
|   | 
|   | 
| #------------------------------------------------------  | 
| #02 04 Íæ¼Ò»ñµÃ½»Ò×ËùÊÕÒæ#tagGMGivePlayerBourseGains  | 
|   | 
| class  tagGMGivePlayerBourseGains(Structure):  | 
|     _pack_ = 1  | 
|     _fields_ = [  | 
|                   ("Cmd", c_ubyte),  | 
|                   ("SubCmd", c_ubyte),  | 
|                   ("PlayerID", c_int),      | 
|                   ("MoneyType", c_ubyte),    #ÊÕÒæ½ðÇ®ÀàÐÍ  | 
|                   ("MoneyCount", c_int),    #ÊÕÒæÊýÁ¿  | 
|                   ]  | 
|   | 
|     def __init__(self):  | 
|         self.Clear()  | 
|         self.Cmd = 0x02  | 
|         self.SubCmd = 0x04  | 
|         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 = 0x02  | 
|         self.SubCmd = 0x04  | 
|         self.PlayerID = 0  | 
|         self.MoneyType = 0  | 
|         self.MoneyCount = 0  | 
|         return  | 
|   | 
|     def GetLength(self):  | 
|         return sizeof(tagGMGivePlayerBourseGains)  | 
|   | 
|     def GetBuffer(self):  | 
|         return string_at(addressof(self), self.GetLength())  | 
|   | 
|     def OutputString(self):  | 
|         DumpString = '''//02 04 Íæ¼Ò»ñµÃ½»Ò×ËùÊÕÒæ//tagGMGivePlayerBourseGains:  | 
|                                 Cmd:%s,  | 
|                                 SubCmd:%s,  | 
|                                 PlayerID:%d,  | 
|                                 MoneyType:%d,  | 
|                                 MoneyCount:%d  | 
|                                 '''\  | 
|                                 %(  | 
|                                 self.Cmd,  | 
|                                 self.SubCmd,  | 
|                                 self.PlayerID,  | 
|                                 self.MoneyType,  | 
|                                 self.MoneyCount  | 
|                                 )  | 
|         return DumpString  | 
|   | 
|   | 
| m_NAtagGMGivePlayerBourseGains=tagGMGivePlayerBourseGains()  | 
| ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGMGivePlayerBourseGains.Cmd,m_NAtagGMGivePlayerBourseGains.SubCmd))] = m_NAtagGMGivePlayerBourseGains |