#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#
|
##@package E:/GameSVN/U3DGame/ProjectSServer/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
|
# @todo:
|
#
|
# @author: Alee
|
# @date 2017-8-21 ÏÂÎç04:21:36
|
# @version 1.0
|
#
|
# @note: CodeMaker PyGameServerSaveData.pyÉú³É
|
#
|
#---------------------------------------------------------------------
|
import ctypes
|
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
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('Name', ctypes.c_char * 33),
|
('Faction', ctypes.c_ubyte),
|
('Score', ctypes.c_ushort),
|
('WinCnt', ctypes.c_ubyte),
|
('LoseCnt', ctypes.c_ubyte),
|
('ConWinCnt', ctypes.c_ubyte),
|
('WinAwardRecord', ctypes.c_ulong),
|
('Len', ctypes.c_ushort),
|
('BetRecord', ctypes.c_char_p),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.PlayerID = 0
|
self.Name = ''
|
self.Faction = 0
|
self.Score = 0
|
self.WinCnt = 0
|
self.LoseCnt = 0
|
self.ConWinCnt = 0
|
self.WinAwardRecord = 0
|
self.Len = 0
|
self.BetRecord = ''
|
|
def readData(self, buf, pos = 0, length = 0):
|
if not pos <= length:
|
return -1
|
if len(buf) < pos + self.getLength():
|
return -1
|
self.clear()
|
self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Name, pos = CommFunc.ReadString(buf, pos, 33)
|
self.Faction, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Score, pos = CommFunc.ReadWORD(buf, pos)
|
self.WinCnt, pos = CommFunc.ReadBYTE(buf, pos)
|
self.LoseCnt, pos = CommFunc.ReadBYTE(buf, pos)
|
self.ConWinCnt, pos = CommFunc.ReadBYTE(buf, pos)
|
self.WinAwardRecord, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Len, pos = CommFunc.ReadWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.Len)
|
self.BetRecord = ctypes.c_char_p(tmp)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.PlayerID)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.Name)
|
buf = CommFunc.WriteBYTE(buf, self.Faction)
|
buf = CommFunc.WriteWORD(buf, self.Score)
|
buf = CommFunc.WriteBYTE(buf, self.WinCnt)
|
buf = CommFunc.WriteBYTE(buf, self.LoseCnt)
|
buf = CommFunc.WriteBYTE(buf, self.ConWinCnt)
|
buf = CommFunc.WriteDWORD(buf, self.WinAwardRecord)
|
buf = CommFunc.WriteWORD(buf, self.Len)
|
buf = CommFunc.WriteString(buf, self.Len, self.BetRecord)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_char) * 33
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ushort)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ushort)
|
length += self.Len
|
return length
|
|
def outputString(self):
|
output = '''//ÏÉħ֮Õù¼Ç¼±í#tagDBPyXMZZ:
|
PlayerID = %s,
|
Name = %s,
|
Faction = %s,
|
Score = %s,
|
WinCnt = %s,
|
LoseCnt = %s,
|
ConWinCnt = %s,
|
WinAwardRecord = %s,
|
Len = %s,
|
BetRecord = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.Name,
|
self.Faction,
|
self.Score,
|
self.WinCnt,
|
self.LoseCnt,
|
self.ConWinCnt,
|
self.WinAwardRecord,
|
self.Len,
|
self.BetRecord,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetName(self,Str):
|
if len(Str)<=33:
|
self.Name = Str
|
else:
|
self.Name = Str[:33]
|
|
|
|
#·âħ̳¼Ç¼±í#tagDBPySealDemonRecord
|
class tagDBPySealDemonRecord(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('LineID', ctypes.c_ubyte),
|
('Rank', ctypes.c_ushort),
|
('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(tagDBPySealDemonRecord)
|
|
def outputString(self):
|
output = '''//·âħ̳¼Ç¼±í#tagDBPySealDemonRecord:
|
PlayerID = %s,
|
LineID = %s,
|
Rank = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.LineID,
|
self.Rank,
|
self.ADOResult,
|
)
|
return output
|
|
|
|
#Boss¹Ø×¢¼Ç¼±í#tagDBPyBossAttention
|
class tagDBPyBossAttention(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('DataLen', ctypes.c_ushort),
|
('RecordData', ctypes.c_char_p),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.PlayerID = 0
|
self.DataLen = 0
|
self.RecordData = ''
|
|
def readData(self, buf, pos = 0, length = 0):
|
if not pos <= length:
|
return -1
|
if len(buf) < pos + self.getLength():
|
return -1
|
self.clear()
|
self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.DataLen, pos = CommFunc.ReadWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.DataLen)
|
self.RecordData = ctypes.c_char_p(tmp)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.PlayerID)
|
buf = CommFunc.WriteWORD(buf, self.DataLen)
|
buf = CommFunc.WriteString(buf, self.DataLen, self.RecordData)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ushort)
|
length += self.DataLen
|
return length
|
|
def outputString(self):
|
output = '''//Boss¹Ø×¢¼Ç¼±í#tagDBPyBossAttention:
|
PlayerID = %s,
|
DataLen = %s,
|
RecordData = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.DataLen,
|
self.RecordData,
|
self.ADOResult,
|
)
|
return output
|
|
|
|
#½»Ò×ËùÎïÆ·×î½ü³É½»µ¥¼Û±í#tagDBPyBourseItemLastPrice
|
class tagDBPyBourseItemLastPrice(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('ItemID', ctypes.c_ulong),
|
('LastPrice', 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(tagDBPyBourseItemLastPrice)
|
|
def outputString(self):
|
output = '''//½»Ò×ËùÎïÆ·×î½ü³É½»µ¥¼Û±í#tagDBPyBourseItemLastPrice:
|
ItemID = %s,
|
LastPrice = %s,
|
ADOResult = %s,
|
'''%(
|
self.ItemID,
|
self.LastPrice,
|
self.ADOResult,
|
)
|
return output
|
|
|
#½»Ò×Ëù¼Ç¼±í#tagDBPyBourseRecord
|
class tagDBPyBourseRecord(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('Type', ctypes.c_ubyte),
|
('Timestamp', ctypes.c_ulong),
|
('TradeTax', ctypes.c_ulong),
|
('TradeMoney', ctypes.c_ulong),
|
('UserDataLen', ctypes.c_ushort),
|
('UserData', ctypes.c_char_p),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.PlayerID = 0
|
self.Type = 0
|
self.Timestamp = 0
|
self.TradeTax = 0
|
self.TradeMoney = 0
|
self.UserDataLen = 0
|
self.UserData = ''
|
|
def readData(self, buf, pos = 0, length = 0):
|
if not pos <= length:
|
return -1
|
if len(buf) < pos + self.getLength():
|
return -1
|
self.clear()
|
self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Type, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Timestamp, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TradeTax, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TradeMoney, pos = CommFunc.ReadDWORD(buf, pos)
|
self.UserDataLen, pos = CommFunc.ReadWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.UserDataLen)
|
self.UserData = ctypes.c_char_p(tmp)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.PlayerID)
|
buf = CommFunc.WriteBYTE(buf, self.Type)
|
buf = CommFunc.WriteDWORD(buf, self.Timestamp)
|
buf = CommFunc.WriteDWORD(buf, self.TradeTax)
|
buf = CommFunc.WriteDWORD(buf, self.TradeMoney)
|
buf = CommFunc.WriteWORD(buf, self.UserDataLen)
|
buf = CommFunc.WriteString(buf, self.UserDataLen, self.UserData)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ushort)
|
length += self.UserDataLen
|
return length
|
|
def outputString(self):
|
output = '''//½»Ò×Ëù¼Ç¼±í#tagDBPyBourseRecord:
|
PlayerID = %s,
|
Type = %s,
|
Timestamp = %s,
|
TradeTax = %s,
|
TradeMoney = %s,
|
UserDataLen = %s,
|
UserData = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.Type,
|
self.Timestamp,
|
self.TradeTax,
|
self.TradeMoney,
|
self.UserDataLen,
|
self.UserData,
|
self.ADOResult,
|
)
|
return output
|
|
|
# ¼Ò×å²Ö¿âÎïÆ·±í#tagDBPyFamilyStoreItem
|
class tagDBPyFamilyStoreItem(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('FamilyID', ctypes.c_ulong),
|
('ItemIndex', ctypes.c_ubyte),
|
('ItemID', ctypes.c_ulong),
|
('UserDataLen', ctypes.c_ulong),
|
('UserData', ctypes.c_char_p),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.FamilyID = 0
|
self.ItemIndex = 0
|
self.ItemID = 0
|
self.UserDataLen = 0
|
self.UserData = ''
|
|
def readData(self, buf, pos = 0, length = 0):
|
if not pos <= length:
|
return -1
|
if len(buf) < pos + self.getLength():
|
return -1
|
self.clear()
|
self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ItemIndex, pos = CommFunc.ReadBYTE(buf, pos)
|
self.ItemID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.UserDataLen, pos = CommFunc.ReadDWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.UserDataLen)
|
self.UserData = ctypes.c_char_p(tmp)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.FamilyID)
|
buf = CommFunc.WriteBYTE(buf, self.ItemIndex)
|
buf = CommFunc.WriteDWORD(buf, self.ItemID)
|
buf = CommFunc.WriteDWORD(buf, self.UserDataLen)
|
buf = CommFunc.WriteString(buf, self.UserDataLen, self.UserData)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += self.UserDataLen
|
return length
|
|
def outputString(self):
|
output = '''// ¼Ò×å²Ö¿âÎïÆ·±í#tagDBPyFamilyStoreItem:
|
FamilyID = %s,
|
ItemIndex = %s,
|
ItemID = %s,
|
UserDataLen = %s,
|
UserData = %s,
|
ADOResult = %s,
|
'''%(
|
self.FamilyID,
|
self.ItemIndex,
|
self.ItemID,
|
self.UserDataLen,
|
self.UserData,
|
self.ADOResult,
|
)
|
return output
|
|
|
#Íæ¼ÒºÚÃûµ¥ #tagDBPyPlayerBlack
|
class tagDBPyPlayerBlack(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('TagID', 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(tagDBPyPlayerBlack)
|
|
def outputString(self):
|
output = '''//Íæ¼ÒºÚÃûµ¥ #tagDBPyPlayerBlack:
|
PlayerID = %s,
|
TagID = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.TagID,
|
self.ADOResult,
|
)
|
return output
|
|
#×î½üÁªÏµÈË #tagDBPyPlayerContacts
|
class tagDBPyPlayerContacts(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('TagID', ctypes.c_ulong),
|
('Timestamp', 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(tagDBPyPlayerContacts)
|
|
def outputString(self):
|
output = '''//×î½üÁªÏµÈË #tagDBPyPlayerContacts:
|
PlayerID = %s,
|
TagID = %s,
|
Timestamp = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.TagID,
|
self.Timestamp,
|
self.ADOResult,
|
)
|
return output
|
|
#Íæ¼ÒºÃÓѱí#tagDBPyPlayerFriend
|
class tagDBPyPlayerFriend(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('TagID', 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(tagDBPyPlayerFriend)
|
|
def outputString(self):
|
output = '''//Íæ¼ÒºÃÓѱí#tagDBPyPlayerFriend:
|
PlayerID = %s,
|
TagID = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.TagID,
|
self.ADOResult,
|
)
|
return output
|
|
#Íæ¼Ò³ðÈ˱í#tagPlayerEnemy
|
class tagPlayerEnemy(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('TagID', ctypes.c_ulong),
|
('Timestamp', 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(tagPlayerEnemy)
|
|
def outputString(self):
|
output = '''//Íæ¼Ò³ðÈ˱í#tagPlayerEnemy:
|
PlayerID = %s,
|
TagID = %s,
|
Timestamp = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.TagID,
|
self.Timestamp,
|
self.ADOResult,
|
)
|
return output
|
|
|
|
#¸öÈËÉç½»×ܱí #tagPersonalSocial
|
class tagPersonalSocial(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('PlayerName', ctypes.c_char * 33),
|
('Job', ctypes.c_ubyte),
|
('LV', ctypes.c_ushort),
|
('RealmLV', ctypes.c_ushort),
|
('OnlineType', ctypes.c_ubyte),
|
('RefCount', 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(tagPersonalSocial)
|
|
def outputString(self):
|
output = '''//¸öÈËÉç½»×ܱí #tagPersonalSocial:
|
PlayerID = %s,
|
PlayerName = %s,
|
Job = %s,
|
LV = %s,
|
RealmLV = %s,
|
OnlineType = %s,
|
RefCount = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.PlayerName,
|
self.Job,
|
self.LV,
|
self.RealmLV,
|
self.OnlineType,
|
self.RefCount,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetPlayerName(self,Str):
|
if len(Str)<=33:
|
self.PlayerName = Str
|
else:
|
self.PlayerName = Str[:33]
|
|
|
|