| | |
| | | from ctypes import (Structure, memset, memmove, sizeof, addressof, create_string_buffer, string_at)
|
| | | import CommFunc
|
| | |
|
| | | # 跨服竞技场PK排行榜 #tagDBCrossPKBillboard
|
| | | class tagDBCrossPKBillboard(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ('ZoneID', ctypes.c_ubyte),
|
| | | ('SeasonID', ctypes.c_ubyte),
|
| | | ('PlayerID', ctypes.c_ulong),
|
| | | ('PlayerName', ctypes.c_char * 33),
|
| | | ('Job', ctypes.c_ubyte),
|
| | | ('FightPower', ctypes.c_ulong),
|
| | | ('RealmLV', ctypes.c_ushort),
|
| | | ('PKScore', ctypes.c_ulong),
|
| | | ('DanLV', ctypes.c_ubyte),
|
| | | ('Time', ctypes.c_ulong),
|
| | | ('ADOResult', ctypes.c_ulong),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | Structure.__init__(self)
|
| | | self.clear()
|
| | |
|
| | |
|
| | | def clear(self):
|
| | | memset(addressof(self), 0, self.getLength())
|
| | |
|
| | |
|
| | | def readData(self, buf, pos = 0, length = 0):
|
| | | if not pos <= length:
|
| | | return -1
|
| | | if len(buf) < pos + self.getLength():
|
| | | return -1
|
| | | self.clear()
|
| | | memmove(addressof(self), buf[pos:], self.getLength())
|
| | | return self.getLength()
|
| | |
|
| | |
|
| | | def getBuffer(self):
|
| | | buf = create_string_buffer(self.getLength())
|
| | | memmove(addressof(buf), addressof(self), self.getLength())
|
| | | return string_at(addressof(buf), self.getLength())
|
| | |
|
| | | def getLength(self):
|
| | | return sizeof(tagDBCrossPKBillboard)
|
| | |
|
| | | def outputString(self):
|
| | | output = '''// 跨服竞技场PK排行榜 #tagDBCrossPKBillboard:
|
| | | ZoneID = %s,
|
| | | SeasonID = %s,
|
| | | PlayerID = %s,
|
| | | PlayerName = %s,
|
| | | Job = %s,
|
| | | FightPower = %s,
|
| | | RealmLV = %s,
|
| | | PKScore = %s,
|
| | | DanLV = %s,
|
| | | Time = %s,
|
| | | ADOResult = %s,
|
| | | '''%(
|
| | | self.ZoneID,
|
| | | self.SeasonID,
|
| | | self.PlayerID,
|
| | | self.PlayerName,
|
| | | self.Job,
|
| | | self.FightPower,
|
| | | self.RealmLV,
|
| | | self.PKScore,
|
| | | self.DanLV,
|
| | | self.Time,
|
| | | self.ADOResult,
|
| | | )
|
| | | return output
|
| | |
|
| | | #Char数组类型Set接口,使用该接口对此类型数据赋值,防止赋值的数据过长报错
|
| | | def SetPlayerName(self,Str):
|
| | | if len(Str)<=33:
|
| | | self.PlayerName = Str
|
| | | else:
|
| | | self.PlayerName = Str[:33]
|
| | | |
| | |
|
| | | #仙魔之争记录表#tagDBPyXMZZ
|
| | | class tagDBPyXMZZ(Structure):
|
| | | _pack_ = 1
|