#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package DB.DBStruct
|
#
|
# @todo:DBÊý¾Ý½á¹¹Ìå
|
# @author hxp
|
# @date 2025-05-09
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: CodeMaker PyGameServerSaveData.pyÉú³É
|
# ×¢£º Ð޸ıí½á¹¹¡¢Ôöɾ±íʱÐèͬ²½ÐÞ¸Ä GAMEWORLD_DATA_VERSION_NO
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2025-05-09 12:20"""
|
#-------------------------------------------------------------------------------
|
|
import ctypes
|
from ctypes import (Structure, memset, memmove, sizeof, addressof, create_string_buffer, string_at)
|
import CommFunc
|
|
#Íæ¼ÒÏêϸÐÅÏ¢#tagDBPlayer
|
class tagDBPlayer(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('AccID', ctypes.c_char * 65),
|
('PlayerName', ctypes.c_char * 33),
|
('AccState', ctypes.c_ubyte),
|
('IsDeleted', ctypes.c_ubyte),
|
('GMLevel', ctypes.c_ubyte),
|
('Sex', ctypes.c_int),
|
('Hair', ctypes.c_int),
|
('HairColor', ctypes.c_int),
|
('Face', ctypes.c_int),
|
('FacePic', ctypes.c_int),
|
('Job', ctypes.c_int),
|
('RoleType', ctypes.c_ulong),
|
('ReincarnationLv', ctypes.c_ushort),
|
('LV', ctypes.c_int),
|
('TotalExp', ctypes.c_ulong),
|
('FamilyID', ctypes.c_ulong),
|
('FamilyName', ctypes.c_char * 33),
|
('Country', ctypes.c_int),
|
('TeamHornor', ctypes.c_ulong),
|
('FamilyHornor', ctypes.c_ulong),
|
('FamilyActiveValue', ctypes.c_ulong),
|
('LastWeekFamilyActiveValue', ctypes.c_ulong),
|
('CountryHornor', ctypes.c_ulong),
|
('CountryLastWeekHornor', ctypes.c_ulong),
|
('Mate', ctypes.c_ulong),
|
('Gold', ctypes.c_ulong),
|
('GoldPaper', ctypes.c_ulong),
|
('Silver', ctypes.c_ulong),
|
('SilverPaper', ctypes.c_ulong),
|
('FightPoint', ctypes.c_ulong),
|
('HappyPoint', ctypes.c_ulong),
|
('MapID', ctypes.c_ulong),
|
('DataMapID', ctypes.c_ulong),
|
('CopyMapID', ctypes.c_ulong),
|
('PosX', ctypes.c_ushort),
|
('PosY', ctypes.c_ushort),
|
('FromMapID', ctypes.c_ulong),
|
('FromCopyMapID', ctypes.c_ulong),
|
('FromPosX', ctypes.c_ushort),
|
('FromPosY', ctypes.c_ushort),
|
('State', ctypes.c_int),
|
('HP', ctypes.c_ulong),
|
('MP', ctypes.c_ulong),
|
('XP', ctypes.c_ulong),
|
('HPRestoreSetting', ctypes.c_ushort),
|
('MPRestoreSetting', ctypes.c_ushort),
|
('FreePoint', ctypes.c_ulong),
|
('FreeSkillPoint', ctypes.c_ulong),
|
('STR', ctypes.c_int),
|
('PNE', ctypes.c_int),
|
('PHY', ctypes.c_int),
|
('CON', ctypes.c_int),
|
('TotalSTR', ctypes.c_int),
|
('TotalPNE', ctypes.c_int),
|
('TotalPHY', ctypes.c_int),
|
('TotalCON', ctypes.c_int),
|
('Setting', ctypes.c_char * 100),
|
('PKValue', ctypes.c_ushort),
|
('FightPower', ctypes.c_ulong),
|
('ActiveValue', ctypes.c_ushort),
|
('PlayerType', ctypes.c_ubyte),
|
('BackpackLV', ctypes.c_ubyte),
|
('WarehouseLV', ctypes.c_ubyte),
|
('HaveWarehousePsw', ctypes.c_ubyte),
|
('WarehousePsw', ctypes.c_char * 15),
|
('WarehouseLocked', ctypes.c_ubyte),
|
('WarehouseGold', ctypes.c_ulong),
|
('WarehouseSilver', ctypes.c_ulong),
|
('TeamID', ctypes.c_ulong),
|
('UseGoldType', ctypes.c_ubyte),
|
('UseSilverType', ctypes.c_ubyte),
|
('AttackMode', ctypes.c_ubyte),
|
('RebornMapID', ctypes.c_ushort),
|
('RebornPosX', ctypes.c_ushort),
|
('RebornPosY', ctypes.c_ushort),
|
('WeekOnlineTime', ctypes.c_ulong),
|
('LastWeekOnlineTime', ctypes.c_ulong),
|
('LogoffTime', ctypes.c_char * 30),
|
('IsHideMask', ctypes.c_ubyte),
|
('DayProcessGameEventCount', ctypes.c_ulong),
|
('LoginIP', ctypes.c_char * 20),
|
('LoginTime', ctypes.c_char * 30),
|
('OnlineTime', ctypes.c_ulong),
|
('FriendFavor', ctypes.c_ulong),
|
('TeamPrivity', ctypes.c_ulong),
|
('OfflineMinutes', ctypes.c_ulong),
|
('Energy', ctypes.c_ulong),
|
('ReceivedSalary', ctypes.c_ulong),
|
('EquipShowSwitch', ctypes.c_ulong),
|
('LuckValue', ctypes.c_ushort),
|
('ExAttr1', ctypes.c_ulong),
|
('ExAttr2', ctypes.c_ulong),
|
('ExAttr3', ctypes.c_ulong),
|
('ExAttr4', ctypes.c_ulong),
|
('ExAttr5', ctypes.c_ulong),
|
('Faction', ctypes.c_int),
|
('InfamyValue', ctypes.c_ulong),
|
('OfficialRank', ctypes.c_ubyte),
|
('IsFindByLabel', ctypes.c_ubyte),
|
('IsCloseFriendLabel', ctypes.c_ubyte),
|
('ChangeCoinPointTotal', ctypes.c_ulong),
|
('VIPLv', ctypes.c_ubyte),
|
('VIPLvForPhone', ctypes.c_ubyte),
|
('PhoneVIPStartTime', ctypes.c_double),
|
('PhoneVIPEndTime', ctypes.c_double),
|
('VsRoomId', ctypes.c_ulong),
|
('ExAttr6', ctypes.c_ulong),
|
('ExAttr7', ctypes.c_ulong),
|
('ExAttr8', ctypes.c_ulong),
|
('ExAttr9', ctypes.c_ulong),
|
('ExAttr10', ctypes.c_ulong),
|
('ModelMark', ctypes.c_ulong),
|
('FromDataMapID', ctypes.c_ulong),
|
('LastOrderId', ctypes.c_char * 40),
|
('PrizeCoin', ctypes.c_ulong),
|
('ExAttr11', ctypes.c_ulong),
|
('ExAttr12', ctypes.c_ulong),
|
('ExAttr13', ctypes.c_ulong),
|
('ExAttr14', ctypes.c_ulong),
|
('CreateRoleTime', ctypes.c_char * 30),
|
('LVEx', ctypes.c_ushort),
|
('LV2', ctypes.c_ushort),
|
('ExpPoint', ctypes.c_ulong),
|
('OperateInfo', ctypes.c_ulong),
|
('Operate', ctypes.c_char * 15),
|
('ServerID', ctypes.c_ulong),
|
('ExAttr15', ctypes.c_ulong),
|
('ExAttr16', ctypes.c_ulong),
|
('ExAttr17', ctypes.c_ulong),
|
('ExAttr18', ctypes.c_ulong),
|
('ExAttr19', ctypes.c_ulong),
|
('ExAttr20', ctypes.c_ulong),
|
('HPEx', ctypes.c_ulong),
|
('FightPowerEx', 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()
|
self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.AccID, pos = CommFunc.ReadString(buf, pos, 65)
|
self.PlayerName, pos = CommFunc.ReadString(buf, pos, 33)
|
self.AccState, pos = CommFunc.ReadBYTE(buf, pos)
|
self.IsDeleted, pos = CommFunc.ReadBYTE(buf, pos)
|
self.GMLevel, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Sex, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Hair, pos = CommFunc.ReadDWORD(buf, pos)
|
self.HairColor, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Face, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FacePic, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Job, pos = CommFunc.ReadDWORD(buf, pos)
|
self.RoleType, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ReincarnationLv, pos = CommFunc.ReadWORD(buf, pos)
|
self.LV, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TotalExp, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FamilyName, pos = CommFunc.ReadString(buf, pos, 33)
|
self.Country, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TeamHornor, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FamilyHornor, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FamilyActiveValue, pos = CommFunc.ReadDWORD(buf, pos)
|
self.LastWeekFamilyActiveValue, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CountryHornor, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CountryLastWeekHornor, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Mate, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Gold, pos = CommFunc.ReadDWORD(buf, pos)
|
self.GoldPaper, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Silver, pos = CommFunc.ReadDWORD(buf, pos)
|
self.SilverPaper, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FightPoint, pos = CommFunc.ReadDWORD(buf, pos)
|
self.HappyPoint, pos = CommFunc.ReadDWORD(buf, pos)
|
self.MapID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.DataMapID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CopyMapID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.PosX, pos = CommFunc.ReadWORD(buf, pos)
|
self.PosY, pos = CommFunc.ReadWORD(buf, pos)
|
self.FromMapID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FromCopyMapID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FromPosX, pos = CommFunc.ReadWORD(buf, pos)
|
self.FromPosY, pos = CommFunc.ReadWORD(buf, pos)
|
self.State, pos = CommFunc.ReadDWORD(buf, pos)
|
self.HP, pos = CommFunc.ReadDWORD(buf, pos)
|
self.MP, pos = CommFunc.ReadDWORD(buf, pos)
|
self.XP, pos = CommFunc.ReadDWORD(buf, pos)
|
self.HPRestoreSetting, pos = CommFunc.ReadWORD(buf, pos)
|
self.MPRestoreSetting, pos = CommFunc.ReadWORD(buf, pos)
|
self.FreePoint, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FreeSkillPoint, pos = CommFunc.ReadDWORD(buf, pos)
|
self.STR, pos = CommFunc.ReadDWORD(buf, pos)
|
self.PNE, pos = CommFunc.ReadDWORD(buf, pos)
|
self.PHY, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CON, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TotalSTR, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TotalPNE, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TotalPHY, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TotalCON, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Setting, pos = CommFunc.ReadString(buf, pos, 100)
|
self.PKValue, pos = CommFunc.ReadWORD(buf, pos)
|
self.FightPower, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ActiveValue, pos = CommFunc.ReadWORD(buf, pos)
|
self.PlayerType, pos = CommFunc.ReadBYTE(buf, pos)
|
self.BackpackLV, pos = CommFunc.ReadBYTE(buf, pos)
|
self.WarehouseLV, pos = CommFunc.ReadBYTE(buf, pos)
|
self.HaveWarehousePsw, pos = CommFunc.ReadBYTE(buf, pos)
|
self.WarehousePsw, pos = CommFunc.ReadString(buf, pos, 15)
|
self.WarehouseLocked, pos = CommFunc.ReadBYTE(buf, pos)
|
self.WarehouseGold, pos = CommFunc.ReadDWORD(buf, pos)
|
self.WarehouseSilver, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TeamID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.UseGoldType, pos = CommFunc.ReadBYTE(buf, pos)
|
self.UseSilverType, pos = CommFunc.ReadBYTE(buf, pos)
|
self.AttackMode, pos = CommFunc.ReadBYTE(buf, pos)
|
self.RebornMapID, pos = CommFunc.ReadWORD(buf, pos)
|
self.RebornPosX, pos = CommFunc.ReadWORD(buf, pos)
|
self.RebornPosY, pos = CommFunc.ReadWORD(buf, pos)
|
self.WeekOnlineTime, pos = CommFunc.ReadDWORD(buf, pos)
|
self.LastWeekOnlineTime, pos = CommFunc.ReadDWORD(buf, pos)
|
self.LogoffTime, pos = CommFunc.ReadString(buf, pos, 30)
|
self.IsHideMask, pos = CommFunc.ReadBYTE(buf, pos)
|
self.DayProcessGameEventCount, pos = CommFunc.ReadDWORD(buf, pos)
|
self.LoginIP, pos = CommFunc.ReadString(buf, pos, 20)
|
self.LoginTime, pos = CommFunc.ReadString(buf, pos, 30)
|
self.OnlineTime, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FriendFavor, pos = CommFunc.ReadDWORD(buf, pos)
|
self.TeamPrivity, pos = CommFunc.ReadDWORD(buf, pos)
|
self.OfflineMinutes, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Energy, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ReceivedSalary, pos = CommFunc.ReadDWORD(buf, pos)
|
self.EquipShowSwitch, pos = CommFunc.ReadDWORD(buf, pos)
|
self.LuckValue, pos = CommFunc.ReadWORD(buf, pos)
|
self.ExAttr1, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr2, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr3, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr4, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr5, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Faction, pos = CommFunc.ReadDWORD(buf, pos)
|
self.InfamyValue, pos = CommFunc.ReadDWORD(buf, pos)
|
self.OfficialRank, pos = CommFunc.ReadBYTE(buf, pos)
|
self.IsFindByLabel, pos = CommFunc.ReadBYTE(buf, pos)
|
self.IsCloseFriendLabel, pos = CommFunc.ReadBYTE(buf, pos)
|
self.ChangeCoinPointTotal, pos = CommFunc.ReadDWORD(buf, pos)
|
self.VIPLv, pos = CommFunc.ReadBYTE(buf, pos)
|
self.VIPLvForPhone, pos = CommFunc.ReadBYTE(buf, pos)
|
self.PhoneVIPStartTime, pos = CommFunc.ReadDouble(buf, pos)
|
self.PhoneVIPEndTime, pos = CommFunc.ReadDouble(buf, pos)
|
self.VsRoomId, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr6, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr7, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr8, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr9, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr10, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ModelMark, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FromDataMapID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.LastOrderId, pos = CommFunc.ReadString(buf, pos, 40)
|
self.PrizeCoin, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr11, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr12, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr13, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr14, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CreateRoleTime, pos = CommFunc.ReadString(buf, pos, 30)
|
self.LVEx, pos = CommFunc.ReadWORD(buf, pos)
|
self.LV2, pos = CommFunc.ReadWORD(buf, pos)
|
self.ExpPoint, pos = CommFunc.ReadDWORD(buf, pos)
|
self.OperateInfo, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Operate, pos = CommFunc.ReadString(buf, pos, 15)
|
self.ServerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr15, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr16, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr17, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr18, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr19, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ExAttr20, pos = CommFunc.ReadDWORD(buf, pos)
|
self.HPEx, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FightPowerEx, pos = CommFunc.ReadDWORD(buf, pos)
|
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(tagDBPlayer)
|
|
def outputString(self):
|
output = '''//Íæ¼ÒÏêϸÐÅÏ¢#tagDBPlayer:
|
PlayerID = %s,
|
AccID = %s,
|
PlayerName = %s,
|
AccState = %s,
|
IsDeleted = %s,
|
GMLevel = %s,
|
Sex = %s,
|
Hair = %s,
|
HairColor = %s,
|
Face = %s,
|
FacePic = %s,
|
Job = %s,
|
RoleType = %s,
|
ReincarnationLv = %s,
|
LV = %s,
|
TotalExp = %s,
|
FamilyID = %s,
|
FamilyName = %s,
|
Country = %s,
|
TeamHornor = %s,
|
FamilyHornor = %s,
|
FamilyActiveValue = %s,
|
LastWeekFamilyActiveValue = %s,
|
CountryHornor = %s,
|
CountryLastWeekHornor = %s,
|
Mate = %s,
|
Gold = %s,
|
GoldPaper = %s,
|
Silver = %s,
|
SilverPaper = %s,
|
FightPoint = %s,
|
HappyPoint = %s,
|
MapID = %s,
|
DataMapID = %s,
|
CopyMapID = %s,
|
PosX = %s,
|
PosY = %s,
|
FromMapID = %s,
|
FromCopyMapID = %s,
|
FromPosX = %s,
|
FromPosY = %s,
|
State = %s,
|
HP = %s,
|
MP = %s,
|
XP = %s,
|
HPRestoreSetting = %s,
|
MPRestoreSetting = %s,
|
FreePoint = %s,
|
FreeSkillPoint = %s,
|
STR = %s,
|
PNE = %s,
|
PHY = %s,
|
CON = %s,
|
TotalSTR = %s,
|
TotalPNE = %s,
|
TotalPHY = %s,
|
TotalCON = %s,
|
Setting = %s,
|
PKValue = %s,
|
FightPower = %s,
|
ActiveValue = %s,
|
PlayerType = %s,
|
BackpackLV = %s,
|
WarehouseLV = %s,
|
HaveWarehousePsw = %s,
|
WarehousePsw = %s,
|
WarehouseLocked = %s,
|
WarehouseGold = %s,
|
WarehouseSilver = %s,
|
TeamID = %s,
|
UseGoldType = %s,
|
UseSilverType = %s,
|
AttackMode = %s,
|
RebornMapID = %s,
|
RebornPosX = %s,
|
RebornPosY = %s,
|
WeekOnlineTime = %s,
|
LastWeekOnlineTime = %s,
|
LogoffTime = %s,
|
IsHideMask = %s,
|
DayProcessGameEventCount = %s,
|
LoginIP = %s,
|
LoginTime = %s,
|
OnlineTime = %s,
|
FriendFavor = %s,
|
TeamPrivity = %s,
|
OfflineMinutes = %s,
|
Energy = %s,
|
ReceivedSalary = %s,
|
EquipShowSwitch = %s,
|
LuckValue = %s,
|
ExAttr1 = %s,
|
ExAttr2 = %s,
|
ExAttr3 = %s,
|
ExAttr4 = %s,
|
ExAttr5 = %s,
|
Faction = %s,
|
InfamyValue = %s,
|
OfficialRank = %s,
|
IsFindByLabel = %s,
|
IsCloseFriendLabel = %s,
|
ChangeCoinPointTotal = %s,
|
VIPLv = %s,
|
VIPLvForPhone = %s,
|
PhoneVIPStartTime = %s,
|
PhoneVIPEndTime = %s,
|
VsRoomId = %s,
|
ExAttr6 = %s,
|
ExAttr7 = %s,
|
ExAttr8 = %s,
|
ExAttr9 = %s,
|
ExAttr10 = %s,
|
ModelMark = %s,
|
FromDataMapID = %s,
|
LastOrderId = %s,
|
PrizeCoin = %s,
|
ExAttr11 = %s,
|
ExAttr12 = %s,
|
ExAttr13 = %s,
|
ExAttr14 = %s,
|
CreateRoleTime = %s,
|
LVEx = %s,
|
LV2 = %s,
|
ExpPoint = %s,
|
OperateInfo = %s,
|
Operate = %s,
|
ServerID = %s,
|
ExAttr15 = %s,
|
ExAttr16 = %s,
|
ExAttr17 = %s,
|
ExAttr18 = %s,
|
ExAttr19 = %s,
|
ExAttr20 = %s,
|
HPEx = %s,
|
FightPowerEx = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.AccID,
|
self.PlayerName,
|
self.AccState,
|
self.IsDeleted,
|
self.GMLevel,
|
self.Sex,
|
self.Hair,
|
self.HairColor,
|
self.Face,
|
self.FacePic,
|
self.Job,
|
self.RoleType,
|
self.ReincarnationLv,
|
self.LV,
|
self.TotalExp,
|
self.FamilyID,
|
self.FamilyName,
|
self.Country,
|
self.TeamHornor,
|
self.FamilyHornor,
|
self.FamilyActiveValue,
|
self.LastWeekFamilyActiveValue,
|
self.CountryHornor,
|
self.CountryLastWeekHornor,
|
self.Mate,
|
self.Gold,
|
self.GoldPaper,
|
self.Silver,
|
self.SilverPaper,
|
self.FightPoint,
|
self.HappyPoint,
|
self.MapID,
|
self.DataMapID,
|
self.CopyMapID,
|
self.PosX,
|
self.PosY,
|
self.FromMapID,
|
self.FromCopyMapID,
|
self.FromPosX,
|
self.FromPosY,
|
self.State,
|
self.HP,
|
self.MP,
|
self.XP,
|
self.HPRestoreSetting,
|
self.MPRestoreSetting,
|
self.FreePoint,
|
self.FreeSkillPoint,
|
self.STR,
|
self.PNE,
|
self.PHY,
|
self.CON,
|
self.TotalSTR,
|
self.TotalPNE,
|
self.TotalPHY,
|
self.TotalCON,
|
self.Setting,
|
self.PKValue,
|
self.FightPower,
|
self.ActiveValue,
|
self.PlayerType,
|
self.BackpackLV,
|
self.WarehouseLV,
|
self.HaveWarehousePsw,
|
self.WarehousePsw,
|
self.WarehouseLocked,
|
self.WarehouseGold,
|
self.WarehouseSilver,
|
self.TeamID,
|
self.UseGoldType,
|
self.UseSilverType,
|
self.AttackMode,
|
self.RebornMapID,
|
self.RebornPosX,
|
self.RebornPosY,
|
self.WeekOnlineTime,
|
self.LastWeekOnlineTime,
|
self.LogoffTime,
|
self.IsHideMask,
|
self.DayProcessGameEventCount,
|
self.LoginIP,
|
self.LoginTime,
|
self.OnlineTime,
|
self.FriendFavor,
|
self.TeamPrivity,
|
self.OfflineMinutes,
|
self.Energy,
|
self.ReceivedSalary,
|
self.EquipShowSwitch,
|
self.LuckValue,
|
self.ExAttr1,
|
self.ExAttr2,
|
self.ExAttr3,
|
self.ExAttr4,
|
self.ExAttr5,
|
self.Faction,
|
self.InfamyValue,
|
self.OfficialRank,
|
self.IsFindByLabel,
|
self.IsCloseFriendLabel,
|
self.ChangeCoinPointTotal,
|
self.VIPLv,
|
self.VIPLvForPhone,
|
self.PhoneVIPStartTime,
|
self.PhoneVIPEndTime,
|
self.VsRoomId,
|
self.ExAttr6,
|
self.ExAttr7,
|
self.ExAttr8,
|
self.ExAttr9,
|
self.ExAttr10,
|
self.ModelMark,
|
self.FromDataMapID,
|
self.LastOrderId,
|
self.PrizeCoin,
|
self.ExAttr11,
|
self.ExAttr12,
|
self.ExAttr13,
|
self.ExAttr14,
|
self.CreateRoleTime,
|
self.LVEx,
|
self.LV2,
|
self.ExpPoint,
|
self.OperateInfo,
|
self.Operate,
|
self.ServerID,
|
self.ExAttr15,
|
self.ExAttr16,
|
self.ExAttr17,
|
self.ExAttr18,
|
self.ExAttr19,
|
self.ExAttr20,
|
self.HPEx,
|
self.FightPowerEx,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetAccID(self,Str):
|
if len(Str)<=65:
|
self.AccID = Str
|
else:
|
self.AccID = Str[:65]
|
|
def SetPlayerName(self,Str):
|
if len(Str)<=33:
|
self.PlayerName = Str
|
else:
|
self.PlayerName = Str[:33]
|
|
def SetFamilyName(self,Str):
|
if len(Str)<=33:
|
self.FamilyName = Str
|
else:
|
self.FamilyName = Str[:33]
|
|
def SetSetting(self,Str):
|
if len(Str)<=100:
|
self.Setting = Str
|
else:
|
self.Setting = Str[:100]
|
|
def SetWarehousePsw(self,Str):
|
if len(Str)<=15:
|
self.WarehousePsw = Str
|
else:
|
self.WarehousePsw = Str[:15]
|
|
def SetLogoffTime(self,Str):
|
if len(Str)<=30:
|
self.LogoffTime = Str
|
else:
|
self.LogoffTime = Str[:30]
|
|
def SetLoginIP(self,Str):
|
if len(Str)<=20:
|
self.LoginIP = Str
|
else:
|
self.LoginIP = Str[:20]
|
|
def SetLoginTime(self,Str):
|
if len(Str)<=30:
|
self.LoginTime = Str
|
else:
|
self.LoginTime = Str[:30]
|
|
def SetLastOrderId(self,Str):
|
if len(Str)<=40:
|
self.LastOrderId = Str
|
else:
|
self.LastOrderId = Str[:40]
|
|
def SetCreateRoleTime(self,Str):
|
if len(Str)<=30:
|
self.CreateRoleTime = Str
|
else:
|
self.CreateRoleTime = Str[:30]
|
|
def SetOperate(self,Str):
|
if len(Str)<=15:
|
self.Operate = Str
|
else:
|
self.Operate = Str[:15]
|
|
|
# ʼþ´¥·¢±í #tagDBEventTrig
|
class tagDBEventTrig(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('EventLen', ctypes.c_ulong),
|
('EventID', ctypes.c_char_p),
|
('EventValue', ctypes.c_ulong),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.EventLen = 0
|
self.EventID = ''
|
self.EventValue = 0
|
|
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.EventLen, pos = CommFunc.ReadDWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.EventLen)
|
self.EventID = ctypes.c_char_p(tmp)
|
self.EventValue, pos = CommFunc.ReadDWORD(buf, pos)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.EventLen)
|
buf = CommFunc.WriteString(buf, self.EventLen, self.EventID)
|
buf = CommFunc.WriteDWORD(buf, self.EventValue)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += self.EventLen
|
length += sizeof(ctypes.c_ulong)
|
return length
|
|
def outputString(self):
|
output = '''// ʼþ´¥·¢±í #tagDBEventTrig:
|
EventLen = %s,
|
EventID = %s,
|
EventValue = %s,
|
ADOResult = %s,
|
'''%(
|
self.EventLen,
|
self.EventID,
|
self.EventValue,
|
self.ADOResult,
|
)
|
return output
|
|
|
# ¼Ò×å±í #tagDBFamily
|
class tagDBFamily(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('ID', ctypes.c_ulong),
|
('Name', ctypes.c_char * 33),
|
('LeaderID', ctypes.c_ulong),
|
('LV', ctypes.c_ubyte),
|
('Exp', ctypes.c_ulong),
|
('JoinReview', ctypes.c_ubyte),
|
('JoinLVMin', ctypes.c_ushort),
|
('CreateTime', ctypes.c_ulong),
|
('ServerID', ctypes.c_ulong),
|
('BroadcastLen', ctypes.c_ubyte),
|
('Broadcast', ctypes.c_char_p),
|
('FightPower', ctypes.c_ulong),
|
('FightPowerEx', ctypes.c_ulong),
|
('EmblemID', ctypes.c_ushort),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.ID = 0
|
self.Name = ''
|
self.LeaderID = 0
|
self.LV = 0
|
self.Exp = 0
|
self.JoinReview = 0
|
self.JoinLVMin = 0
|
self.CreateTime = 0
|
self.ServerID = 0
|
self.BroadcastLen = 0
|
self.Broadcast = ''
|
self.FightPower = 0
|
self.FightPowerEx = 0
|
self.EmblemID = 0
|
|
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.ID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Name, pos = CommFunc.ReadString(buf, pos, 33)
|
self.LeaderID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.LV, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Exp, pos = CommFunc.ReadDWORD(buf, pos)
|
self.JoinReview, pos = CommFunc.ReadBYTE(buf, pos)
|
self.JoinLVMin, pos = CommFunc.ReadWORD(buf, pos)
|
self.CreateTime, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ServerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.BroadcastLen, pos = CommFunc.ReadBYTE(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.BroadcastLen)
|
self.Broadcast = ctypes.c_char_p(tmp)
|
self.FightPower, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FightPowerEx, pos = CommFunc.ReadDWORD(buf, pos)
|
self.EmblemID, pos = CommFunc.ReadWORD(buf, pos)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.ID)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.Name)
|
buf = CommFunc.WriteDWORD(buf, self.LeaderID)
|
buf = CommFunc.WriteBYTE(buf, self.LV)
|
buf = CommFunc.WriteDWORD(buf, self.Exp)
|
buf = CommFunc.WriteBYTE(buf, self.JoinReview)
|
buf = CommFunc.WriteWORD(buf, self.JoinLVMin)
|
buf = CommFunc.WriteDWORD(buf, self.CreateTime)
|
buf = CommFunc.WriteDWORD(buf, self.ServerID)
|
buf = CommFunc.WriteBYTE(buf, self.BroadcastLen)
|
buf = CommFunc.WriteString(buf, self.BroadcastLen, self.Broadcast)
|
buf = CommFunc.WriteDWORD(buf, self.FightPower)
|
buf = CommFunc.WriteDWORD(buf, self.FightPowerEx)
|
buf = CommFunc.WriteWORD(buf, self.EmblemID)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_char) * 33
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ushort)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += self.BroadcastLen
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ushort)
|
return length
|
|
def outputString(self):
|
output = '''// ¼Ò×å±í #tagDBFamily:
|
ID = %s,
|
Name = %s,
|
LeaderID = %s,
|
LV = %s,
|
Exp = %s,
|
JoinReview = %s,
|
JoinLVMin = %s,
|
CreateTime = %s,
|
ServerID = %s,
|
BroadcastLen = %s,
|
Broadcast = %s,
|
FightPower = %s,
|
FightPowerEx = %s,
|
EmblemID = %s,
|
ADOResult = %s,
|
'''%(
|
self.ID,
|
self.Name,
|
self.LeaderID,
|
self.LV,
|
self.Exp,
|
self.JoinReview,
|
self.JoinLVMin,
|
self.CreateTime,
|
self.ServerID,
|
self.BroadcastLen,
|
self.Broadcast,
|
self.FightPower,
|
self.FightPowerEx,
|
self.EmblemID,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetName(self,Str):
|
if len(Str)<=33:
|
self.Name = Str
|
else:
|
self.Name = Str[:33]
|
|
|
# ¼Ò×å³ÉÔ±±í #tagDBFamilyMem
|
class tagDBFamilyMem(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('FamilyID', ctypes.c_ulong),
|
('JoinTime', ctypes.c_ulong),
|
('PlayerName', ctypes.c_char * 33),
|
('LV', ctypes.c_int),
|
('Job', ctypes.c_int),
|
('RealmLV', ctypes.c_ubyte),
|
('Face', ctypes.c_int),
|
('FacePic', ctypes.c_int),
|
('FightPower', ctypes.c_ulong),
|
('FightPowerEx', ctypes.c_ulong),
|
('ServerID', ctypes.c_ulong),
|
('OffTime', ctypes.c_ulong),
|
('FmLV', ctypes.c_ubyte),
|
('ContribTotal', ctypes.c_ulong),
|
('ContribWeek', 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()
|
self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.JoinTime, pos = CommFunc.ReadDWORD(buf, pos)
|
self.PlayerName, pos = CommFunc.ReadString(buf, pos, 33)
|
self.LV, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Job, pos = CommFunc.ReadDWORD(buf, pos)
|
self.RealmLV, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Face, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FacePic, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FightPower, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FightPowerEx, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ServerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.OffTime, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FmLV, pos = CommFunc.ReadBYTE(buf, pos)
|
self.ContribTotal, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ContribWeek, pos = CommFunc.ReadDWORD(buf, pos)
|
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(tagDBFamilyMem)
|
|
def outputString(self):
|
output = '''// ¼Ò×å³ÉÔ±±í #tagDBFamilyMem:
|
PlayerID = %s,
|
FamilyID = %s,
|
JoinTime = %s,
|
PlayerName = %s,
|
LV = %s,
|
Job = %s,
|
RealmLV = %s,
|
Face = %s,
|
FacePic = %s,
|
FightPower = %s,
|
FightPowerEx = %s,
|
ServerID = %s,
|
OffTime = %s,
|
FmLV = %s,
|
ContribTotal = %s,
|
ContribWeek = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.FamilyID,
|
self.JoinTime,
|
self.PlayerName,
|
self.LV,
|
self.Job,
|
self.RealmLV,
|
self.Face,
|
self.FacePic,
|
self.FightPower,
|
self.FightPowerEx,
|
self.ServerID,
|
self.OffTime,
|
self.FmLV,
|
self.ContribTotal,
|
self.ContribWeek,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetPlayerName(self,Str):
|
if len(Str)<=33:
|
self.PlayerName = Str
|
else:
|
self.PlayerName = Str[:33]
|
|
|
# ¼Ò×åÐÐΪ±í #tagDBFamilyAction
|
class tagDBFamilyAction(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('FamilyID', ctypes.c_ulong),
|
('ActionType', ctypes.c_ubyte),
|
('Name', ctypes.c_char * 33),
|
('Time', ctypes.c_ulong),
|
('Value1', ctypes.c_ulong),
|
('Value2', ctypes.c_ulong),
|
('Value3', ctypes.c_ulong),
|
('Value4', ctypes.c_ulong),
|
('Value5', ctypes.c_ulong),
|
('Value6', ctypes.c_ulong),
|
('DataLen', ctypes.c_ushort),
|
('Data', ctypes.c_char_p),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.FamilyID = 0
|
self.ActionType = 0
|
self.Name = ''
|
self.Time = 0
|
self.Value1 = 0
|
self.Value2 = 0
|
self.Value3 = 0
|
self.Value4 = 0
|
self.Value5 = 0
|
self.Value6 = 0
|
self.DataLen = 0
|
self.Data = ''
|
|
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.ActionType, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Name, pos = CommFunc.ReadString(buf, pos, 33)
|
self.Time, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value1, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value2, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value3, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value4, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value5, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value6, pos = CommFunc.ReadDWORD(buf, pos)
|
self.DataLen, pos = CommFunc.ReadWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.DataLen)
|
self.Data = ctypes.c_char_p(tmp)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.FamilyID)
|
buf = CommFunc.WriteBYTE(buf, self.ActionType)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.Name)
|
buf = CommFunc.WriteDWORD(buf, self.Time)
|
buf = CommFunc.WriteDWORD(buf, self.Value1)
|
buf = CommFunc.WriteDWORD(buf, self.Value2)
|
buf = CommFunc.WriteDWORD(buf, self.Value3)
|
buf = CommFunc.WriteDWORD(buf, self.Value4)
|
buf = CommFunc.WriteDWORD(buf, self.Value5)
|
buf = CommFunc.WriteDWORD(buf, self.Value6)
|
buf = CommFunc.WriteWORD(buf, self.DataLen)
|
buf = CommFunc.WriteString(buf, self.DataLen, self.Data)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_char) * 33
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ushort)
|
length += self.DataLen
|
return length
|
|
def outputString(self):
|
output = '''// ¼Ò×åÐÐΪ±í #tagDBFamilyAction:
|
FamilyID = %s,
|
ActionType = %s,
|
Name = %s,
|
Time = %s,
|
Value1 = %s,
|
Value2 = %s,
|
Value3 = %s,
|
Value4 = %s,
|
Value5 = %s,
|
Value6 = %s,
|
DataLen = %s,
|
Data = %s,
|
ADOResult = %s,
|
'''%(
|
self.FamilyID,
|
self.ActionType,
|
self.Name,
|
self.Time,
|
self.Value1,
|
self.Value2,
|
self.Value3,
|
self.Value4,
|
self.Value5,
|
self.Value6,
|
self.DataLen,
|
self.Data,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetName(self,Str):
|
if len(Str)<=33:
|
self.Name = Str
|
else:
|
self.Name = Str[:33]
|
|
|
# Íæ¼Ò²é¿´»º´æ±í #tagDBPlayerViewCache
|
class tagDBPlayerViewCache(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('AccID', ctypes.c_char * 65),
|
('PlayerName', ctypes.c_char * 33),
|
('LV', ctypes.c_int),
|
('Job', ctypes.c_int),
|
('RealmLV', ctypes.c_ubyte),
|
('Face', ctypes.c_int),
|
('FacePic', ctypes.c_int),
|
('FamilyID', ctypes.c_ulong),
|
('FamilyName', ctypes.c_char * 33),
|
('FamilyEmblemID', ctypes.c_ushort),
|
('TitleID', ctypes.c_ulong),
|
('FightPower', ctypes.c_ulong),
|
('FightPowerEx', ctypes.c_ulong),
|
('ServerID', ctypes.c_ulong),
|
('OffTime', ctypes.c_ulong),
|
('PlusDataSize', ctypes.c_ulong),
|
('PlusData', ctypes.c_char_p),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.PlayerID = 0
|
self.AccID = ''
|
self.PlayerName = ''
|
self.LV = 0
|
self.Job = 0
|
self.RealmLV = 0
|
self.Face = 0
|
self.FacePic = 0
|
self.FamilyID = 0
|
self.FamilyName = ''
|
self.FamilyEmblemID = 0
|
self.TitleID = 0
|
self.FightPower = 0
|
self.FightPowerEx = 0
|
self.ServerID = 0
|
self.OffTime = 0
|
self.PlusDataSize = 0
|
self.PlusData = ''
|
|
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.AccID, pos = CommFunc.ReadString(buf, pos, 65)
|
self.PlayerName, pos = CommFunc.ReadString(buf, pos, 33)
|
self.LV, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Job, pos = CommFunc.ReadDWORD(buf, pos)
|
self.RealmLV, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Face, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FacePic, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FamilyName, pos = CommFunc.ReadString(buf, pos, 33)
|
self.FamilyEmblemID, pos = CommFunc.ReadWORD(buf, pos)
|
self.TitleID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FightPower, pos = CommFunc.ReadDWORD(buf, pos)
|
self.FightPowerEx, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ServerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.OffTime, pos = CommFunc.ReadDWORD(buf, pos)
|
self.PlusDataSize, pos = CommFunc.ReadDWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.PlusDataSize)
|
self.PlusData = 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) * 65, self.AccID)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.PlayerName)
|
buf = CommFunc.WriteDWORD(buf, self.LV)
|
buf = CommFunc.WriteDWORD(buf, self.Job)
|
buf = CommFunc.WriteBYTE(buf, self.RealmLV)
|
buf = CommFunc.WriteDWORD(buf, self.Face)
|
buf = CommFunc.WriteDWORD(buf, self.FacePic)
|
buf = CommFunc.WriteDWORD(buf, self.FamilyID)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.FamilyName)
|
buf = CommFunc.WriteWORD(buf, self.FamilyEmblemID)
|
buf = CommFunc.WriteDWORD(buf, self.TitleID)
|
buf = CommFunc.WriteDWORD(buf, self.FightPower)
|
buf = CommFunc.WriteDWORD(buf, self.FightPowerEx)
|
buf = CommFunc.WriteDWORD(buf, self.ServerID)
|
buf = CommFunc.WriteDWORD(buf, self.OffTime)
|
buf = CommFunc.WriteDWORD(buf, self.PlusDataSize)
|
buf = CommFunc.WriteString(buf, self.PlusDataSize, self.PlusData)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_char) * 65
|
length += sizeof(ctypes.c_char) * 33
|
length += sizeof(ctypes.c_int)
|
length += sizeof(ctypes.c_int)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_int)
|
length += sizeof(ctypes.c_int)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_char) * 33
|
length += sizeof(ctypes.c_ushort)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += self.PlusDataSize
|
return length
|
|
def outputString(self):
|
output = '''// Íæ¼Ò²é¿´»º´æ±í #tagDBPlayerViewCache:
|
PlayerID = %s,
|
AccID = %s,
|
PlayerName = %s,
|
LV = %s,
|
Job = %s,
|
RealmLV = %s,
|
Face = %s,
|
FacePic = %s,
|
FamilyID = %s,
|
FamilyName = %s,
|
FamilyEmblemID = %s,
|
TitleID = %s,
|
FightPower = %s,
|
FightPowerEx = %s,
|
ServerID = %s,
|
OffTime = %s,
|
PlusDataSize = %s,
|
PlusData = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.AccID,
|
self.PlayerName,
|
self.LV,
|
self.Job,
|
self.RealmLV,
|
self.Face,
|
self.FacePic,
|
self.FamilyID,
|
self.FamilyName,
|
self.FamilyEmblemID,
|
self.TitleID,
|
self.FightPower,
|
self.FightPowerEx,
|
self.ServerID,
|
self.OffTime,
|
self.PlusDataSize,
|
self.PlusData,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetAccID(self,Str):
|
if len(Str)<=65:
|
self.AccID = Str
|
else:
|
self.AccID = Str[:65]
|
|
def SetPlayerName(self,Str):
|
if len(Str)<=33:
|
self.PlayerName = Str
|
else:
|
self.PlayerName = Str[:33]
|
|
def SetFamilyName(self,Str):
|
if len(Str)<=33:
|
self.FamilyName = Str
|
else:
|
self.FamilyName = Str[:33]
|
|
|
# Óʼþ¸öÈËÓʼþ±í #tagDBMailPersonal
|
class tagDBMailPersonal(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('GUID', ctypes.c_char * 36),
|
('Type', ctypes.c_ubyte),
|
('CreateTime', ctypes.c_char * 30),
|
('LimitDays', ctypes.c_ubyte),
|
('TitleLen', ctypes.c_ubyte),
|
('Title', ctypes.c_char_p),
|
('TextLen', ctypes.c_ushort),
|
('Text', ctypes.c_char_p),
|
('MailState', ctypes.c_ubyte),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.PlayerID = 0
|
self.GUID = ''
|
self.Type = 0
|
self.CreateTime = ''
|
self.LimitDays = 0
|
self.TitleLen = 0
|
self.Title = ''
|
self.TextLen = 0
|
self.Text = ''
|
self.MailState = 0
|
|
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.GUID, pos = CommFunc.ReadString(buf, pos, 36)
|
self.Type, pos = CommFunc.ReadBYTE(buf, pos)
|
self.CreateTime, pos = CommFunc.ReadString(buf, pos, 30)
|
self.LimitDays, pos = CommFunc.ReadBYTE(buf, pos)
|
self.TitleLen, pos = CommFunc.ReadBYTE(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.TitleLen)
|
self.Title = ctypes.c_char_p(tmp)
|
self.TextLen, pos = CommFunc.ReadWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.TextLen)
|
self.Text = ctypes.c_char_p(tmp)
|
self.MailState, pos = CommFunc.ReadBYTE(buf, pos)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.PlayerID)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 36, self.GUID)
|
buf = CommFunc.WriteBYTE(buf, self.Type)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 30, self.CreateTime)
|
buf = CommFunc.WriteBYTE(buf, self.LimitDays)
|
buf = CommFunc.WriteBYTE(buf, self.TitleLen)
|
buf = CommFunc.WriteString(buf, self.TitleLen, self.Title)
|
buf = CommFunc.WriteWORD(buf, self.TextLen)
|
buf = CommFunc.WriteString(buf, self.TextLen, self.Text)
|
buf = CommFunc.WriteBYTE(buf, self.MailState)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_char) * 36
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_char) * 30
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ubyte)
|
length += self.TitleLen
|
length += sizeof(ctypes.c_ushort)
|
length += self.TextLen
|
length += sizeof(ctypes.c_ubyte)
|
return length
|
|
def outputString(self):
|
output = '''// Óʼþ¸öÈËÓʼþ±í #tagDBMailPersonal:
|
PlayerID = %s,
|
GUID = %s,
|
Type = %s,
|
CreateTime = %s,
|
LimitDays = %s,
|
TitleLen = %s,
|
Title = %s,
|
TextLen = %s,
|
Text = %s,
|
MailState = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.GUID,
|
self.Type,
|
self.CreateTime,
|
self.LimitDays,
|
self.TitleLen,
|
self.Title,
|
self.TextLen,
|
self.Text,
|
self.MailState,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetGUID(self,Str):
|
if len(Str)<=36:
|
self.GUID = Str
|
else:
|
self.GUID = Str[:36]
|
|
def SetCreateTime(self,Str):
|
if len(Str)<=30:
|
self.CreateTime = Str
|
else:
|
self.CreateTime = Str[:30]
|
|
|
# ÓʼþÈ«·þÓʼþ±í #tagDBMailServer
|
class tagDBMailServer(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('GUID', ctypes.c_char * 36),
|
('Type', ctypes.c_ubyte),
|
('CreateTime', ctypes.c_char * 30),
|
('LimitDays', ctypes.c_ubyte),
|
('TitleLen', ctypes.c_ubyte),
|
('Title', ctypes.c_char_p),
|
('TextLen', ctypes.c_ushort),
|
('Text', ctypes.c_char_p),
|
('LimitLV', ctypes.c_ushort),
|
('LimitLVType', ctypes.c_ubyte),
|
('CheckState', ctypes.c_ubyte),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.GUID = ''
|
self.Type = 0
|
self.CreateTime = ''
|
self.LimitDays = 0
|
self.TitleLen = 0
|
self.Title = ''
|
self.TextLen = 0
|
self.Text = ''
|
self.LimitLV = 0
|
self.LimitLVType = 0
|
self.CheckState = 0
|
|
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.GUID, pos = CommFunc.ReadString(buf, pos, 36)
|
self.Type, pos = CommFunc.ReadBYTE(buf, pos)
|
self.CreateTime, pos = CommFunc.ReadString(buf, pos, 30)
|
self.LimitDays, pos = CommFunc.ReadBYTE(buf, pos)
|
self.TitleLen, pos = CommFunc.ReadBYTE(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.TitleLen)
|
self.Title = ctypes.c_char_p(tmp)
|
self.TextLen, pos = CommFunc.ReadWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.TextLen)
|
self.Text = ctypes.c_char_p(tmp)
|
self.LimitLV, pos = CommFunc.ReadWORD(buf, pos)
|
self.LimitLVType, pos = CommFunc.ReadBYTE(buf, pos)
|
self.CheckState, pos = CommFunc.ReadBYTE(buf, pos)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 36, self.GUID)
|
buf = CommFunc.WriteBYTE(buf, self.Type)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 30, self.CreateTime)
|
buf = CommFunc.WriteBYTE(buf, self.LimitDays)
|
buf = CommFunc.WriteBYTE(buf, self.TitleLen)
|
buf = CommFunc.WriteString(buf, self.TitleLen, self.Title)
|
buf = CommFunc.WriteWORD(buf, self.TextLen)
|
buf = CommFunc.WriteString(buf, self.TextLen, self.Text)
|
buf = CommFunc.WriteWORD(buf, self.LimitLV)
|
buf = CommFunc.WriteBYTE(buf, self.LimitLVType)
|
buf = CommFunc.WriteBYTE(buf, self.CheckState)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_char) * 36
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_char) * 30
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ubyte)
|
length += self.TitleLen
|
length += sizeof(ctypes.c_ushort)
|
length += self.TextLen
|
length += sizeof(ctypes.c_ushort)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ubyte)
|
return length
|
|
def outputString(self):
|
output = '''// ÓʼþÈ«·þÓʼþ±í #tagDBMailServer:
|
GUID = %s,
|
Type = %s,
|
CreateTime = %s,
|
LimitDays = %s,
|
TitleLen = %s,
|
Title = %s,
|
TextLen = %s,
|
Text = %s,
|
LimitLV = %s,
|
LimitLVType = %s,
|
CheckState = %s,
|
ADOResult = %s,
|
'''%(
|
self.GUID,
|
self.Type,
|
self.CreateTime,
|
self.LimitDays,
|
self.TitleLen,
|
self.Title,
|
self.TextLen,
|
self.Text,
|
self.LimitLV,
|
self.LimitLVType,
|
self.CheckState,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetGUID(self,Str):
|
if len(Str)<=36:
|
self.GUID = Str
|
else:
|
self.GUID = Str[:36]
|
|
def SetCreateTime(self,Str):
|
if len(Str)<=30:
|
self.CreateTime = Str
|
else:
|
self.CreateTime = Str[:30]
|
|
|
|
# ÓʼþÎïÆ·±í #tagDBMailItem
|
class tagDBMailItem(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('GUID', ctypes.c_char * 36),
|
('ItemID', ctypes.c_ulong),
|
('Count', ctypes.c_ulong),
|
('IsBind', ctypes.c_ubyte),
|
('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.GUID = ''
|
self.ItemID = 0
|
self.Count = 0
|
self.IsBind = 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.GUID, pos = CommFunc.ReadString(buf, pos, 36)
|
self.ItemID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Count, pos = CommFunc.ReadDWORD(buf, pos)
|
self.IsBind, pos = CommFunc.ReadBYTE(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.WriteString(buf, sizeof(ctypes.c_char) * 36, self.GUID)
|
buf = CommFunc.WriteDWORD(buf, self.ItemID)
|
buf = CommFunc.WriteDWORD(buf, self.Count)
|
buf = CommFunc.WriteBYTE(buf, self.IsBind)
|
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_char) * 36
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ushort)
|
length += self.UserDataLen
|
return length
|
|
def outputString(self):
|
output = '''// ÓʼþÎïÆ·±í #tagDBMailItem:
|
GUID = %s,
|
ItemID = %s,
|
Count = %s,
|
IsBind = %s,
|
UserDataLen = %s,
|
UserData = %s,
|
ADOResult = %s,
|
'''%(
|
self.GUID,
|
self.ItemID,
|
self.Count,
|
self.IsBind,
|
self.UserDataLen,
|
self.UserData,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetGUID(self,Str):
|
if len(Str)<=36:
|
self.GUID = Str
|
else:
|
self.GUID = Str[:36]
|
|
|
# ÓʼþÈ«·þ¼Ç¼±í #tagDBMailPlayerRec
|
class tagDBMailPlayerRec(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('PlayerID', ctypes.c_ulong),
|
('GUID', ctypes.c_char * 36),
|
('MailState', ctypes.c_ubyte),
|
('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()
|
self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.GUID, pos = CommFunc.ReadString(buf, pos, 36)
|
self.MailState, pos = CommFunc.ReadBYTE(buf, pos)
|
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(tagDBMailPlayerRec)
|
|
def outputString(self):
|
output = '''// ÓʼþÈ«·þ¼Ç¼±í #tagDBMailPlayerRec:
|
PlayerID = %s,
|
GUID = %s,
|
MailState = %s,
|
ADOResult = %s,
|
'''%(
|
self.PlayerID,
|
self.GUID,
|
self.MailState,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetGUID(self,Str):
|
if len(Str)<=36:
|
self.GUID = Str
|
else:
|
self.GUID = Str[:36]
|
|
|
# ÅÅÐаñ±í #tagDBBillboard
|
class tagDBBillboard(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('GroupValue1', ctypes.c_ulong),
|
('GroupValue2', ctypes.c_ulong),
|
('BillboardType', ctypes.c_ubyte),
|
('ID', ctypes.c_ulong),
|
('ID2', ctypes.c_ulong),
|
('Name1', ctypes.c_char * 33),
|
('Name2', ctypes.c_char * 65),
|
('Type2', ctypes.c_ubyte),
|
('Value1', ctypes.c_ulong),
|
('Value2', ctypes.c_ulong),
|
('Value3', ctypes.c_ulong),
|
('Value4', ctypes.c_ulong),
|
('Value5', ctypes.c_ulong),
|
('Value6', ctypes.c_ulong),
|
('Value7', ctypes.c_ulong),
|
('Value8', ctypes.c_ulong),
|
('CmpValue', ctypes.c_ulong),
|
('CmpValue2', ctypes.c_ulong),
|
('CmpValue3', ctypes.c_ulong),
|
('DataLen', ctypes.c_ushort),
|
('UserData', ctypes.c_char_p),
|
('ADOResult', ctypes.c_ulong),
|
]
|
|
def __init__(self):
|
Structure.__init__(self)
|
self.clear()
|
|
def clear(self):
|
self.GroupValue1 = 0
|
self.GroupValue2 = 0
|
self.BillboardType = 0
|
self.ID = 0
|
self.ID2 = 0
|
self.Name1 = ''
|
self.Name2 = ''
|
self.Type2 = 0
|
self.Value1 = 0
|
self.Value2 = 0
|
self.Value3 = 0
|
self.Value4 = 0
|
self.Value5 = 0
|
self.Value6 = 0
|
self.Value7 = 0
|
self.Value8 = 0
|
self.CmpValue = 0
|
self.CmpValue2 = 0
|
self.CmpValue3 = 0
|
self.DataLen = 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.GroupValue1, pos = CommFunc.ReadDWORD(buf, pos)
|
self.GroupValue2, pos = CommFunc.ReadDWORD(buf, pos)
|
self.BillboardType, pos = CommFunc.ReadBYTE(buf, pos)
|
self.ID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.ID2, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Name1, pos = CommFunc.ReadString(buf, pos, 33)
|
self.Name2, pos = CommFunc.ReadString(buf, pos, 65)
|
self.Type2, pos = CommFunc.ReadBYTE(buf, pos)
|
self.Value1, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value2, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value3, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value4, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value5, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value6, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value7, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value8, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CmpValue, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CmpValue2, pos = CommFunc.ReadDWORD(buf, pos)
|
self.CmpValue3, pos = CommFunc.ReadDWORD(buf, pos)
|
self.DataLen, pos = CommFunc.ReadWORD(buf, pos)
|
tmp, pos = CommFunc.ReadString(buf, pos, self.DataLen)
|
self.UserData = ctypes.c_char_p(tmp)
|
return self.getLength()
|
|
def getBuffer(self):
|
buf = ''
|
buf = CommFunc.WriteDWORD(buf, self.GroupValue1)
|
buf = CommFunc.WriteDWORD(buf, self.GroupValue2)
|
buf = CommFunc.WriteBYTE(buf, self.BillboardType)
|
buf = CommFunc.WriteDWORD(buf, self.ID)
|
buf = CommFunc.WriteDWORD(buf, self.ID2)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.Name1)
|
buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 65, self.Name2)
|
buf = CommFunc.WriteBYTE(buf, self.Type2)
|
buf = CommFunc.WriteDWORD(buf, self.Value1)
|
buf = CommFunc.WriteDWORD(buf, self.Value2)
|
buf = CommFunc.WriteDWORD(buf, self.Value3)
|
buf = CommFunc.WriteDWORD(buf, self.Value4)
|
buf = CommFunc.WriteDWORD(buf, self.Value5)
|
buf = CommFunc.WriteDWORD(buf, self.Value6)
|
buf = CommFunc.WriteDWORD(buf, self.Value7)
|
buf = CommFunc.WriteDWORD(buf, self.Value8)
|
buf = CommFunc.WriteDWORD(buf, self.CmpValue)
|
buf = CommFunc.WriteDWORD(buf, self.CmpValue2)
|
buf = CommFunc.WriteDWORD(buf, self.CmpValue3)
|
buf = CommFunc.WriteWORD(buf, self.DataLen)
|
buf = CommFunc.WriteString(buf, self.DataLen, self.UserData)
|
return buf
|
|
def getLength(self):
|
length = 0
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_char) * 33
|
length += sizeof(ctypes.c_char) * 65
|
length += sizeof(ctypes.c_ubyte)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ushort)
|
length += self.DataLen
|
return length
|
|
def outputString(self):
|
output = '''// ÅÅÐаñ±í #tagDBBillboard:
|
GroupValue1 = %s,
|
GroupValue2 = %s,
|
BillboardType = %s,
|
ID = %s,
|
ID2 = %s,
|
Name1 = %s,
|
Name2 = %s,
|
Type2 = %s,
|
Value1 = %s,
|
Value2 = %s,
|
Value3 = %s,
|
Value4 = %s,
|
Value5 = %s,
|
Value6 = %s,
|
Value7 = %s,
|
Value8 = %s,
|
CmpValue = %s,
|
CmpValue2 = %s,
|
CmpValue3 = %s,
|
DataLen = %s,
|
UserData = %s,
|
ADOResult = %s,
|
'''%(
|
self.GroupValue1,
|
self.GroupValue2,
|
self.BillboardType,
|
self.ID,
|
self.ID2,
|
self.Name1,
|
self.Name2,
|
self.Type2,
|
self.Value1,
|
self.Value2,
|
self.Value3,
|
self.Value4,
|
self.Value5,
|
self.Value6,
|
self.Value7,
|
self.Value8,
|
self.CmpValue,
|
self.CmpValue2,
|
self.CmpValue3,
|
self.DataLen,
|
self.UserData,
|
self.ADOResult,
|
)
|
return output
|
|
#CharÊý×éÀàÐÍSet½Ó¿Ú,ʹÓøýӿڶԴËÀàÐÍÊý¾Ý¸³Öµ£¬·ÀÖ¹¸³ÖµµÄÊý¾Ý¹ý³¤±¨´í
|
def SetName1(self,Str):
|
if len(Str)<=33:
|
self.Name1 = Str
|
else:
|
self.Name1 = Str[:33]
|
|
def SetName2(self,Str):
|
if len(Str)<=65:
|
self.Name2 = Str
|
else:
|
self.Name2 = Str[:65]
|
|
|
# ͨÓüǼ±íР#tagDBGameRec
|
class tagDBGameRec(Structure):
|
_pack_ = 1
|
_fields_ = [
|
('RecType', ctypes.c_ushort),
|
('RecID', ctypes.c_ulong),
|
('Time', ctypes.c_double),
|
('Value1', ctypes.c_ulong),
|
('Value2', ctypes.c_ulong),
|
('Value3', ctypes.c_ulong),
|
('Value4', ctypes.c_ulong),
|
('Value5', ctypes.c_ulong),
|
('Value6', ctypes.c_ulong),
|
('Value7', ctypes.c_ulong),
|
('Value8', 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.RecType = 0
|
self.RecID = 0
|
self.Time = 0.0
|
self.Value1 = 0
|
self.Value2 = 0
|
self.Value3 = 0
|
self.Value4 = 0
|
self.Value5 = 0
|
self.Value6 = 0
|
self.Value7 = 0
|
self.Value8 = 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.RecType, pos = CommFunc.ReadWORD(buf, pos)
|
self.RecID, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Time, pos = CommFunc.ReadDouble(buf, pos)
|
self.Value1, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value2, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value3, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value4, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value5, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value6, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value7, pos = CommFunc.ReadDWORD(buf, pos)
|
self.Value8, 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.WriteWORD(buf, self.RecType)
|
buf = CommFunc.WriteDWORD(buf, self.RecID)
|
buf = CommFunc.WriteDouble(buf, self.Time)
|
buf = CommFunc.WriteDWORD(buf, self.Value1)
|
buf = CommFunc.WriteDWORD(buf, self.Value2)
|
buf = CommFunc.WriteDWORD(buf, self.Value3)
|
buf = CommFunc.WriteDWORD(buf, self.Value4)
|
buf = CommFunc.WriteDWORD(buf, self.Value5)
|
buf = CommFunc.WriteDWORD(buf, self.Value6)
|
buf = CommFunc.WriteDWORD(buf, self.Value7)
|
buf = CommFunc.WriteDWORD(buf, self.Value8)
|
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_ushort)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_double)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
length += sizeof(ctypes.c_ulong)
|
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 = '''// ͨÓüǼ±íР#tagDBGameRec:
|
RecType = %s,
|
RecID = %s,
|
Time = %s,
|
Value1 = %s,
|
Value2 = %s,
|
Value3 = %s,
|
Value4 = %s,
|
Value5 = %s,
|
Value6 = %s,
|
Value7 = %s,
|
Value8 = %s,
|
UserDataLen = %s,
|
UserData = %s,
|
ADOResult = %s,
|
'''%(
|
self.RecType,
|
self.RecID,
|
self.Time,
|
self.Value1,
|
self.Value2,
|
self.Value3,
|
self.Value4,
|
self.Value5,
|
self.Value6,
|
self.Value7,
|
self.Value8,
|
self.UserDataLen,
|
self.UserData,
|
self.ADOResult,
|
)
|
return output
|
|
|
|
#·þÎñÆ÷ÊÀ½çÊý¾Ý±í°æ±¾ºÅ
|
GAMEWORLD_DATA_VERSION_NO = ctypes.c_ulong (\
|
sizeof(tagDBEventTrig) + sizeof(tagDBFamily) + sizeof(tagDBFamilyMem) + sizeof(tagDBFamilyAction) +
|
sizeof(tagDBPlayerViewCache) + sizeof(tagDBMailPersonal) + sizeof(tagDBMailServer) + sizeof(tagDBMailItem) +
|
sizeof(tagDBMailPlayerRec) + sizeof(tagDBBillboard) + sizeof(tagDBGameRec)
|
).value
|
|