hch
2021-05-04 1a0ad714b01722f0a1c9bc4777b8e0d11ed15e01
Tool/Êý¾Ý¿â/ChangeAccount/Collections/DataServerPlayerData.py
@@ -162,6 +162,8 @@
        ('ExAttr18', ctypes.c_ulong),
        ('ExAttr19', ctypes.c_ulong),
        ('ExAttr20', ctypes.c_ulong),
        ('HPEx', ctypes.c_ulong),
        ('FightPowerEx', ctypes.c_ulong),
        ('ADOResult', ctypes.c_ulong),
        ('SID', ctypes.c_int),    #用于校验
        ('VerNO', ctypes.c_ulong)   #用于SID校验时比较版本号
@@ -175,18 +177,149 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        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.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()
@@ -337,6 +470,8 @@
        rec[u'ExAttr18'] = self.ExAttr18
        rec[u'ExAttr19'] = self.ExAttr19
        rec[u'ExAttr20'] = self.ExAttr20
        rec[u'HPEx'] = self.HPEx
        rec[u'FightPowerEx'] = self.FightPowerEx
        rec[u'SID'] = self.SID
        rec[u'VerNO'] = self.VerNO
        return rec
@@ -475,6 +610,8 @@
        self.ExAttr18 = rec.get(u'ExAttr18', 0)
        self.ExAttr19 = rec.get(u'ExAttr19', 0)
        self.ExAttr20 = rec.get(u'ExAttr20', 0)
        self.HPEx = rec.get(u'HPEx', 0)
        self.FightPowerEx = rec.get(u'FightPowerEx', 0)
        self.SID = rec['SID']
        self.VerNO = rec.get(u'VerNO', 0)
@@ -828,6 +965,8 @@
            ExAttr18 = %s,
            ExAttr19 = %s,
            ExAttr20 = %s,
            HPEx = %s,
            FightPowerEx = %s,
            ADOResult = %s,
            SID = %s,
            VerNO = %s,
@@ -964,6 +1103,8 @@
                self.ExAttr18,
                self.ExAttr19,
                self.ExAttr20,
                self.HPEx,
                self.FightPowerEx,
                self.ADOResult,
                self.SID,
                self.VerNO
@@ -971,7 +1112,7 @@
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.PlayerID,
                self.AccID,
                self.PlayerName,
@@ -1104,6 +1245,8 @@
                self.ExAttr18,
                self.ExAttr19,
                self.ExAttr20,
                self.HPEx,
                self.FightPowerEx,
            )
        return output
@@ -1209,6 +1352,8 @@
        ('AccountID', ctypes.c_ulong),
        ('TokenExpire', ctypes.c_char * 20),
        ('Phone', ctypes.c_ubyte),
        ('DeviceFlag', ctypes.c_char * 33),
        ('ClientVersion', ctypes.c_char * 25),
        ('ADOResult', ctypes.c_ulong),
        ('SID', ctypes.c_int),    #用于校验
        ('VerNO', ctypes.c_ulong)   #用于SID校验时比较版本号
@@ -1222,18 +1367,44 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.ACCID, pos = CommFunc.ReadString(buf, pos, 65)
        self.Psw, pos = CommFunc.ReadString(buf, pos, 33)
        self.PswLV2, pos = CommFunc.ReadString(buf, pos, 33)
        self.LogNum, pos = CommFunc.ReadDWORD(buf, pos)
        self.Adult, pos = CommFunc.ReadBYTE(buf, pos)
        self.RegIP, pos = CommFunc.ReadString(buf, pos, 20)
        self.Presentee, pos = CommFunc.ReadBYTE(buf, pos)
        self.TelLockState, pos = CommFunc.ReadBYTE(buf, pos)
        self.GeTuiClientID, pos = CommFunc.ReadString(buf, pos, 33)
        self.TotalSavePoint, pos = CommFunc.ReadDWORD(buf, pos)
        self.BalanceInfo, pos = CommFunc.ReadDWORD(buf, pos)
        self.AppID, pos = CommFunc.ReadString(buf, pos, 20)
        self.AreaID, pos = CommFunc.ReadDWORD(buf, pos)
        self.fobbiddenAccount, pos = CommFunc.ReadBYTE(buf, pos)
        self.ApplyingAdult, pos = CommFunc.ReadBYTE(buf, pos)
        self.SpreadedUser, pos = CommFunc.ReadBYTE(buf, pos)
        self.Spreader, pos = CommFunc.ReadBYTE(buf, pos)
        self.onlineSMSNotice, pos = CommFunc.ReadBYTE(buf, pos)
        self.EkeyType, pos = CommFunc.ReadBYTE(buf, pos)
        self.EkeyBindFlag, pos = CommFunc.ReadBYTE(buf, pos)
        self.IPBan, pos = CommFunc.ReadBYTE(buf, pos)
        self.RegisterTime, pos = CommFunc.ReadString(buf, pos, 20)
        self.LastLoginTime, pos = CommFunc.ReadString(buf, pos, 20)
        self.Operator, pos = CommFunc.ReadString(buf, pos, 15)
        self.AccountID, pos = CommFunc.ReadDWORD(buf, pos)
        self.TokenExpire, pos = CommFunc.ReadString(buf, pos, 20)
        self.Phone, pos = CommFunc.ReadBYTE(buf, pos)
        self.DeviceFlag, pos = CommFunc.ReadString(buf, pos, 33)
        self.ClientVersion, pos = CommFunc.ReadString(buf, pos, 25)
        return self.getLength()
@@ -1279,6 +1450,8 @@
        rec[u'AccountID'] = self.AccountID
        rec[u'TokenExpire'] = fix_incomingText(self.TokenExpire)
        rec[u'Phone'] = self.Phone
        rec[u'DeviceFlag'] = fix_incomingText(self.DeviceFlag)
        rec[u'ClientVersion'] = fix_incomingText(self.ClientVersion)
        rec[u'SID'] = self.SID
        rec[u'VerNO'] = self.VerNO
        return rec
@@ -1312,6 +1485,8 @@
        self.AccountID = rec.get(u'AccountID', 0)
        self.TokenExpire = fix_outgoingText(rec.get(u'TokenExpire', u''))
        self.Phone = rec.get(u'Phone', 0)
        self.DeviceFlag = fix_outgoingText(rec.get(u'DeviceFlag', u''))
        self.ClientVersion = fix_outgoingText(rec.get(u'ClientVersion', u''))
        self.SID = rec['SID']
        self.VerNO = rec.get(u'VerNO', 0)
@@ -1560,6 +1735,8 @@
            AccountID = %s,
            TokenExpire = %s,
            Phone = %s,
            DeviceFlag = %s,
            ClientVersion = %s,
            ADOResult = %s,
            SID = %s,
            VerNO = %s,
@@ -1591,6 +1768,8 @@
                self.AccountID,
                self.TokenExpire,
                self.Phone,
                self.DeviceFlag,
                self.ClientVersion,
                self.ADOResult,
                self.SID,
                self.VerNO
@@ -1598,7 +1777,7 @@
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.ACCID,
                self.Psw,
                self.PswLV2,
@@ -1626,6 +1805,8 @@
                self.AccountID,
                self.TokenExpire,
                self.Phone,
                self.DeviceFlag,
                self.ClientVersion,
            )
        return output
@@ -1690,7 +1871,19 @@
        else:
            self.TokenExpire = Str[:20]
            
    def SetDeviceFlag(self,Str):
        if len(Str)<=33:
            self.DeviceFlag = Str
        else:
            self.DeviceFlag = Str[:33]
            
    def SetClientVersion(self,Str):
        if len(Str)<=25:
            self.ClientVersion = Str
        else:
            self.ClientVersion = Str[:25]
#------------------------------------------------------
#人物物品#tagRoleItem
class tagRoleItem(Structure):
@@ -13714,18 +13907,32 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
        self.Name, pos = CommFunc.ReadString(buf, pos, 33)
        self.Sex, pos = CommFunc.ReadBYTE(buf, pos)
        self.LV, pos = CommFunc.ReadWORD(buf, pos)
        self.Job, pos = CommFunc.ReadBYTE(buf, pos)
        self.FamilyLV, pos = CommFunc.ReadBYTE(buf, pos)
        self.FamilyName, pos = CommFunc.ReadString(buf, pos, 33)
        self.FamilyActiveValue, pos = CommFunc.ReadDWORD(buf, pos)
        self.OfficialRank, pos = CommFunc.ReadBYTE(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.ReincarnationLv, pos = CommFunc.ReadWORD(buf, pos)
        self.OperateInfo, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
@@ -14004,8 +14211,6 @@
        else:
            self.FamilyName = Str[:33]
            
            
#------------------------------------------------------
#玩家骠车马匹表#tagPlayerHorseTable
@@ -15275,6 +15480,7 @@
        ('Name', ctypes.c_char * 24),
        ('Friendliness', ctypes.c_ushort),
        ('HP', ctypes.c_ulong),
        ('HPEx', ctypes.c_ulong),
        ('MP', ctypes.c_ulong),
        ('Lv', ctypes.c_ushort),
        ('Exp', ctypes.c_ulong),
@@ -15311,18 +15517,47 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PetID, pos = CommFunc.ReadDWORD(buf, pos)
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.NPCID, pos = CommFunc.ReadDWORD(buf, pos)
        self.Name, pos = CommFunc.ReadString(buf, pos, 24)
        self.Friendliness, pos = CommFunc.ReadWORD(buf, pos)
        self.HP, pos = CommFunc.ReadDWORD(buf, pos)
        self.HPEx, pos = CommFunc.ReadDWORD(buf, pos)
        self.MP, pos = CommFunc.ReadDWORD(buf, pos)
        self.Lv, pos = CommFunc.ReadWORD(buf, pos)
        self.Exp, pos = CommFunc.ReadDWORD(buf, pos)
        self.HPTalent, pos = CommFunc.ReadWORD(buf, pos)
        self.MPTalent, pos = CommFunc.ReadWORD(buf, pos)
        self.PhysicAtkTalent, pos = CommFunc.ReadWORD(buf, pos)
        self.MagicAtkTalent, pos = CommFunc.ReadWORD(buf, pos)
        self.PhysicDefTalent, pos = CommFunc.ReadWORD(buf, pos)
        self.MagicDefTalent, pos = CommFunc.ReadWORD(buf, pos)
        self.BindType, pos = CommFunc.ReadBYTE(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.Pos, pos = CommFunc.ReadBYTE(buf, pos)
        self.DailyTrainCnt, pos = CommFunc.ReadBYTE(buf, pos)
        self.RemainTrainTime, pos = CommFunc.ReadDWORD(buf, pos)
        self.UseCreatorDrugCnt, pos = CommFunc.ReadBYTE(buf, pos)
        self.LeftPoints, pos = CommFunc.ReadWORD(buf, pos)
        self.AIMode, pos = CommFunc.ReadBYTE(buf, pos)
        self.IsBattle, pos = CommFunc.ReadBYTE(buf, pos)
        self.BattlePower, pos = CommFunc.ReadDWORD(buf, pos)
        self.IncreateSkillCnt, pos = CommFunc.ReadBYTE(buf, pos)
        self.TrainType, pos = CommFunc.ReadBYTE(buf, pos)
        self.PetIndex, pos = CommFunc.ReadBYTE(buf, pos)
        return self.getLength()
@@ -15343,6 +15578,7 @@
        rec[u'Name'] = fix_incomingText(self.Name)
        rec[u'Friendliness'] = self.Friendliness
        rec[u'HP'] = self.HP
        rec[u'HPEx'] = self.HPEx
        rec[u'MP'] = self.MP
        rec[u'Lv'] = self.Lv
        rec[u'Exp'] = self.Exp
@@ -15378,6 +15614,7 @@
        self.Name = fix_outgoingText(rec.get(u'Name', u''))
        self.Friendliness = rec.get(u'Friendliness', 0)
        self.HP = rec.get(u'HP', 0)
        self.HPEx = rec.get(u'HPEx', 0)
        self.MP = rec.get(u'MP', 0)
        self.Lv = rec.get(u'Lv', 0)
        self.Exp = rec.get(u'Exp', 0)
@@ -15560,6 +15797,7 @@
            Name = %s,
            Friendliness = %s,
            HP = %s,
            HPEx = %s,
            MP = %s,
            Lv = %s,
            Exp = %s,
@@ -15593,6 +15831,7 @@
                self.Name,
                self.Friendliness,
                self.HP,
                self.HPEx,
                self.MP,
                self.Lv,
                self.Exp,
@@ -15623,13 +15862,14 @@
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.PetID,
                self.PlayerID,
                self.NPCID,
                self.Name,
                self.Friendliness,
                self.HP,
                self.HPEx,
                self.MP,
                self.Lv,
                self.Exp,
@@ -15665,7 +15905,6 @@
        else:
            self.Name = Str[:24]
            
#------------------------------------------------------
#玩家重复事件表#tagRoleRepeatTime
@@ -16436,7 +16675,6 @@
            
#通用记录表#tagUniversalGameRec
class tagUniversalGameRec(Structure):
    _pack_ = 1
@@ -16462,18 +16700,25 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.Type, pos = CommFunc.ReadBYTE(buf, pos)
        self.Time, pos = CommFunc.ReadDouble(buf, pos)
        self.StrValue1, pos = CommFunc.ReadString(buf, pos, 33)
        self.StrValue2, pos = CommFunc.ReadString(buf, pos, 33)
        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.StrValue3, pos = CommFunc.ReadString(buf, pos, 256)
        return self.getLength()
@@ -16674,7 +16919,7 @@
            self.StrValue3 = Str
        else:
            self.StrValue3 = Str[:256]
#阵法#tagBattleFormation
class tagBattleFormation(Structure):
@@ -18338,6 +18583,7 @@
        ('Gold', ctypes.c_ulong),
        ('GoldPaper', ctypes.c_ulong),
        ('Silver', ctypes.c_ulong),
        ('ServerID', ctypes.c_ulong),
        ('ADOResult', ctypes.c_ulong),
    ]
@@ -18356,6 +18602,7 @@
        self.Gold = 0
        self.GoldPaper = 0
        self.Silver = 0
        self.ServerID = 0
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
@@ -18377,6 +18624,7 @@
        self.Gold, pos = CommFunc.ReadDWORD(buf, pos)
        self.GoldPaper, pos = CommFunc.ReadDWORD(buf, pos)
        self.Silver, pos = CommFunc.ReadDWORD(buf, pos)
        self.ServerID, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
    def getBuffer(self):
@@ -18391,6 +18639,7 @@
        buf = CommFunc.WriteDWORD(buf, self.Gold)
        buf = CommFunc.WriteDWORD(buf, self.GoldPaper)
        buf = CommFunc.WriteDWORD(buf, self.Silver)
        buf = CommFunc.WriteDWORD(buf, self.ServerID)
        return buf
    def getLength(self):
@@ -18402,6 +18651,7 @@
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_ulong)
        length += self.TextLen
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ulong)
@@ -18420,6 +18670,7 @@
        rec[u'Gold'] = self.Gold
        rec[u'GoldPaper'] = self.GoldPaper
        rec[u'Silver'] = self.Silver
        rec[u'ServerID'] = self.ServerID
        return rec
    def readRecord(self, rec):
@@ -18434,6 +18685,7 @@
        self.Gold = rec.get(u'Gold', 0)
        self.GoldPaper = rec.get(u'GoldPaper', 0)
        self.Silver = rec.get(u'Silver', 0)
        self.ServerID = rec.get(u'ServerID', 0)
#Can not implement adoLoadStr method:No key defined!
#Can not implement adoInsertStr method:No key defined!
@@ -18479,6 +18731,7 @@
            Gold = %s,
            GoldPaper = %s,
            Silver = %s,
            ServerID = %s,
            ADOResult = %s,
            '''%(
                self.GUID,
@@ -18491,12 +18744,13 @@
                self.Gold,
                self.GoldPaper,
                self.Silver,
                self.ServerID,
                self.ADOResult,
            )
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.GUID,
                self.CreateTime,
                self.LimitTime,
@@ -18507,6 +18761,7 @@
                self.Gold,
                self.GoldPaper,
                self.Silver,
                self.ServerID,
            )
        return output
@@ -18530,8 +18785,6 @@
            self.LimitTime = Str[:30]
            
#补偿物品个人领取表 #tagDBPersonalCompensation
class tagDBPersonalCompensation(Structure):
    _pack_ = 1
@@ -18756,18 +19009,18 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.GUID, pos = CommFunc.ReadString(buf, pos, 40)
        self.RecState, pos = CommFunc.ReadBYTE(buf, pos)
        return self.getLength()
@@ -18853,6 +19106,9 @@
            self.GUID = Str
        else:
            self.GUID = Str[:40]
            
#玩家数据查看缓存表#tagPlayerViewCache
class tagPlayerViewCache(Structure):
@@ -19140,18 +19396,17 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.TagID, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
@@ -19294,6 +19549,7 @@
            )
        return output
#个人社交总表 #tagPersonalSocial
class tagPersonalSocial(Structure):
    _pack_ = 1
@@ -19316,18 +19572,22 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.PlayerName, pos = CommFunc.ReadString(buf, pos, 33)
        self.Job, pos = CommFunc.ReadBYTE(buf, pos)
        self.LV, pos = CommFunc.ReadWORD(buf, pos)
        self.RealmLV, pos = CommFunc.ReadWORD(buf, pos)
        self.OnlineType, pos = CommFunc.ReadBYTE(buf, pos)
        self.RefCount, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
@@ -19551,9 +19811,7 @@
            self.PlayerName = Str[:33]
            
            
#玩家黑名单 #tagDBPyPlayerBlack
class tagDBPyPlayerBlack(Structure):
    _pack_ = 1
@@ -19571,18 +19829,17 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.TagID, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
@@ -19744,18 +20001,18 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.TagID, pos = CommFunc.ReadDWORD(buf, pos)
        self.Timestamp, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
@@ -19922,18 +20179,18 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.TagID, pos = CommFunc.ReadDWORD(buf, pos)
        self.Timestamp, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
@@ -20080,6 +20337,7 @@
                self.Timestamp,
            )
        return output
# å®¶æ—ä»“库物品表#tagDBPyFamilyStoreItem
@@ -20529,18 +20787,17 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.ItemID, pos = CommFunc.ReadDWORD(buf, pos)
        self.LastPrice, pos = CommFunc.ReadDWORD(buf, pos)
        return self.getLength()
@@ -20887,18 +21144,18 @@
    def clear(self):
        memset(addressof(self), 0, self.getLength())
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
            return -1
        self.clear()
        memmove(addressof(self), buf[pos:], self.getLength())
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.LineID, pos = CommFunc.ReadBYTE(buf, pos)
        self.Rank, pos = CommFunc.ReadWORD(buf, pos)
        return self.getLength()
@@ -21309,3 +21566,1074 @@
            self.Name = Str[:33]
            
# è·¨æœç«žæŠ€åœº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:
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
        self.clear()
        self.ZoneID, pos = CommFunc.ReadBYTE(buf, pos)
        self.SeasonID, pos = CommFunc.ReadBYTE(buf, pos)
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.PlayerName, pos = CommFunc.ReadString(buf, pos, 33)
        self.Job, pos = CommFunc.ReadBYTE(buf, pos)
        self.FightPower, pos = CommFunc.ReadDWORD(buf, pos)
        self.RealmLV, pos = CommFunc.ReadWORD(buf, pos)
        self.PKScore, pos = CommFunc.ReadDWORD(buf, pos)
        self.DanLV, pos = CommFunc.ReadBYTE(buf, pos)
        self.Time, 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(tagDBCrossPKBillboard)
    def getRecord(self):
        '''组织存储记录'''
        rec = {}
        rec[u'ZoneID'] = self.ZoneID
        rec[u'SeasonID'] = self.SeasonID
        rec[u'PlayerID'] = self.PlayerID
        rec[u'PlayerName'] = fix_incomingText(self.PlayerName)
        rec[u'Job'] = self.Job
        rec[u'FightPower'] = self.FightPower
        rec[u'RealmLV'] = self.RealmLV
        rec[u'PKScore'] = self.PKScore
        rec[u'DanLV'] = self.DanLV
        rec[u'Time'] = self.Time
        return rec
    def readRecord(self, rec):
        '''由于MongoDB读出来是unicode,所有字符串需要进行转换'''
        self.ZoneID = rec.get(u'ZoneID', 0)
        self.SeasonID = rec.get(u'SeasonID', 0)
        self.PlayerID = rec.get(u'PlayerID', 0)
        self.PlayerName = fix_outgoingText(rec.get(u'PlayerName', u''))
        self.Job = rec.get(u'Job', 0)
        self.FightPower = rec.get(u'FightPower', 0)
        self.RealmLV = rec.get(u'RealmLV', 0)
        self.PKScore = rec.get(u'PKScore', 0)
        self.DanLV = rec.get(u'DanLV', 0)
        self.Time = rec.get(u'Time', 0)
#Can not implement adoLoadStr method:No key defined!
#Can not implement adoInsertStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoCheckUpdateStr method:No key defined!
#Can not implement adoCheckUpdateExStr method:No key defined!
    def getAdoRecords(self, resultCollection):
        '''查询结果打包成二进制流'''
        result = ''
        result = CommFunc.WriteDWORD(result, resultCollection.count())
        for rec in resultCollection:
            self.readRecord(rec)
            result += self.getBuffer()
        return result
#Can not implement adoQueryIndexStr method:No key defined!
    def adoQueryCustom(self, collection, queryDict):
        '''自定义查询'''
        resultCollection = collection.find(queryDict)
        return self.getAdoRecords(resultCollection)
    def adoQueryAll(self, collection):
        '''查询所有'''
        resultCollection = collection.find()
        return self.getAdoRecords(resultCollection)
#Can not implement adoDeleteByIndexStr method:No key defined!
    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
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.ZoneID,
                self.SeasonID,
                self.PlayerID,
                self.PlayerName,
                self.Job,
                self.FightPower,
                self.RealmLV,
                self.PKScore,
                self.DanLV,
                self.Time,
            )
        return output
    #Char数组类型Set接口,使用该接口对此类型数据赋值,防止赋值的数据过长报错
    def SetPlayerName(self,Str):
        if len(Str)<=33:
            self.PlayerName = Str
        else:
            self.PlayerName = Str[:33]
# è·¨æœç«žæŠ€åœºæœªé€šçŸ¥çŽ©å®¶çš„æ¯”èµ›ç»“æžœè¡¨ #tagDBCrossPKUnNotifyOverInfo
class tagDBCrossPKUnNotifyOverInfo(Structure):
    _pack_ = 1
    _fields_ = [
        ('ZoneID', ctypes.c_ubyte),
        ('SeasonID', ctypes.c_ubyte),
        ('RoomID', ctypes.c_ushort),
        ('TimeStr', ctypes.c_char * 19),
        ('OverType', ctypes.c_ubyte),
        ('PlayerID', ctypes.c_ulong),
        ('WinnerID', ctypes.c_ulong),
        ('RoundWinnerLen', ctypes.c_ubyte),
        ('RoundWinnerInfo', ctypes.c_char_p),
        ('PKScore', ctypes.c_ulong),
        ('DanLV', ctypes.c_ubyte),
        ('CWinCount', ctypes.c_ushort),
        ('AddScore', ctypes.c_ushort),
        ('TagPlayerID', ctypes.c_ulong),
        ('TagPlayerName', ctypes.c_char * 33),
        ('ADOResult', ctypes.c_ulong),
    ]
    def __init__(self):
        Structure.__init__(self)
        self.clear()
    def clear(self):
        self.ZoneID = 0
        self.SeasonID = 0
        self.RoomID = 0
        self.TimeStr = ''
        self.OverType = 0
        self.PlayerID = 0
        self.WinnerID = 0
        self.RoundWinnerLen = 0
        self.RoundWinnerInfo = ''
        self.PKScore = 0
        self.DanLV = 0
        self.CWinCount = 0
        self.AddScore = 0
        self.TagPlayerID = 0
        self.TagPlayerName = ''
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
        self.clear()
        self.ZoneID, pos = CommFunc.ReadBYTE(buf, pos)
        self.SeasonID, pos = CommFunc.ReadBYTE(buf, pos)
        self.RoomID, pos = CommFunc.ReadWORD(buf, pos)
        self.TimeStr, pos = CommFunc.ReadString(buf, pos, 19)
        self.OverType, pos = CommFunc.ReadBYTE(buf, pos)
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.WinnerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.RoundWinnerLen, pos = CommFunc.ReadBYTE(buf, pos)
        tmp, pos = CommFunc.ReadString(buf, pos, self.RoundWinnerLen)
        self.RoundWinnerInfo = ctypes.c_char_p(tmp)
        self.PKScore, pos = CommFunc.ReadDWORD(buf, pos)
        self.DanLV, pos = CommFunc.ReadBYTE(buf, pos)
        self.CWinCount, pos = CommFunc.ReadWORD(buf, pos)
        self.AddScore, pos = CommFunc.ReadWORD(buf, pos)
        self.TagPlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.TagPlayerName, pos = CommFunc.ReadString(buf, pos, 33)
        return self.getLength()
    def getBuffer(self):
        buf = ''
        buf = CommFunc.WriteBYTE(buf, self.ZoneID)
        buf = CommFunc.WriteBYTE(buf, self.SeasonID)
        buf = CommFunc.WriteWORD(buf, self.RoomID)
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 19, self.TimeStr)
        buf = CommFunc.WriteBYTE(buf, self.OverType)
        buf = CommFunc.WriteDWORD(buf, self.PlayerID)
        buf = CommFunc.WriteDWORD(buf, self.WinnerID)
        buf = CommFunc.WriteBYTE(buf, self.RoundWinnerLen)
        buf = CommFunc.WriteString(buf, self.RoundWinnerLen, self.RoundWinnerInfo)
        buf = CommFunc.WriteDWORD(buf, self.PKScore)
        buf = CommFunc.WriteBYTE(buf, self.DanLV)
        buf = CommFunc.WriteWORD(buf, self.CWinCount)
        buf = CommFunc.WriteWORD(buf, self.AddScore)
        buf = CommFunc.WriteDWORD(buf, self.TagPlayerID)
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.TagPlayerName)
        return buf
    def getLength(self):
        length = 0
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_ushort)
        length += sizeof(ctypes.c_char) * 19
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ubyte)
        length += self.RoundWinnerLen
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_ushort)
        length += sizeof(ctypes.c_ushort)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_char) * 33
        return length
    def getRecord(self):
        '''组织存储记录'''
        rec = {}
        rec[u'ZoneID'] = self.ZoneID
        rec[u'SeasonID'] = self.SeasonID
        rec[u'RoomID'] = self.RoomID
        rec[u'TimeStr'] = fix_incomingText(self.TimeStr)
        rec[u'OverType'] = self.OverType
        rec[u'PlayerID'] = self.PlayerID
        rec[u'WinnerID'] = self.WinnerID
        rec[u'RoundWinnerLen'] = self.RoundWinnerLen
        rec[u'RoundWinnerInfo'] = fix_incomingText(self.RoundWinnerInfo)
        rec[u'PKScore'] = self.PKScore
        rec[u'DanLV'] = self.DanLV
        rec[u'CWinCount'] = self.CWinCount
        rec[u'AddScore'] = self.AddScore
        rec[u'TagPlayerID'] = self.TagPlayerID
        rec[u'TagPlayerName'] = fix_incomingText(self.TagPlayerName)
        return rec
    def readRecord(self, rec):
        '''由于MongoDB读出来是unicode,所有字符串需要进行转换'''
        self.ZoneID = rec.get(u'ZoneID', 0)
        self.SeasonID = rec.get(u'SeasonID', 0)
        self.RoomID = rec.get(u'RoomID', 0)
        self.TimeStr = fix_outgoingText(rec.get(u'TimeStr', u''))
        self.OverType = rec.get(u'OverType', 0)
        self.PlayerID = rec.get(u'PlayerID', 0)
        self.WinnerID = rec.get(u'WinnerID', 0)
        self.RoundWinnerLen = rec.get(u'RoundWinnerLen', 0)
        self.RoundWinnerInfo = fix_outgoingText(rec.get(u'RoundWinnerInfo', u''))
        self.PKScore = rec.get(u'PKScore', 0)
        self.DanLV = rec.get(u'DanLV', 0)
        self.CWinCount = rec.get(u'CWinCount', 0)
        self.AddScore = rec.get(u'AddScore', 0)
        self.TagPlayerID = rec.get(u'TagPlayerID', 0)
        self.TagPlayerName = fix_outgoingText(rec.get(u'TagPlayerName', u''))
#Can not implement adoLoadStr method:No key defined!
#Can not implement adoInsertStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoCheckUpdateStr method:No key defined!
#Can not implement adoCheckUpdateExStr method:No key defined!
    def getAdoRecords(self, resultCollection):
        '''查询结果打包成二进制流'''
        result = ''
        result = CommFunc.WriteDWORD(result, resultCollection.count())
        for rec in resultCollection:
            self.readRecord(rec)
            result += self.getBuffer()
        return result
#Can not implement adoQueryIndexStr method:No key defined!
    def adoQueryCustom(self, collection, queryDict):
        '''自定义查询'''
        resultCollection = collection.find(queryDict)
        return self.getAdoRecords(resultCollection)
    def adoQueryAll(self, collection):
        '''查询所有'''
        resultCollection = collection.find()
        return self.getAdoRecords(resultCollection)
#Can not implement adoDeleteByIndexStr method:No key defined!
    def outputString(self):
        output = '''// è·¨æœç«žæŠ€åœºæœªé€šçŸ¥çŽ©å®¶çš„æ¯”èµ›ç»“æžœè¡¨ #tagDBCrossPKUnNotifyOverInfo:
            ZoneID = %s,
            SeasonID = %s,
            RoomID = %s,
            TimeStr = %s,
            OverType = %s,
            PlayerID = %s,
            WinnerID = %s,
            RoundWinnerLen = %s,
            RoundWinnerInfo = %s,
            PKScore = %s,
            DanLV = %s,
            CWinCount = %s,
            AddScore = %s,
            TagPlayerID = %s,
            TagPlayerName = %s,
            ADOResult = %s,
            '''%(
                self.ZoneID,
                self.SeasonID,
                self.RoomID,
                self.TimeStr,
                self.OverType,
                self.PlayerID,
                self.WinnerID,
                self.RoundWinnerLen,
                self.RoundWinnerInfo,
                self.PKScore,
                self.DanLV,
                self.CWinCount,
                self.AddScore,
                self.TagPlayerID,
                self.TagPlayerName,
                self.ADOResult,
            )
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.ZoneID,
                self.SeasonID,
                self.RoomID,
                self.TimeStr,
                self.OverType,
                self.PlayerID,
                self.WinnerID,
                self.RoundWinnerLen,
                self.RoundWinnerInfo,
                self.PKScore,
                self.DanLV,
                self.CWinCount,
                self.AddScore,
                self.TagPlayerID,
                self.TagPlayerName,
            )
        return output
    #Char数组类型Set接口,使用该接口对此类型数据赋值,防止赋值的数据过长报错
    def SetTimeStr(self,Str):
        if len(Str)<=19:
            self.TimeStr = Str
        else:
            self.TimeStr = Str[:19]
    def SetTagPlayerName(self,Str):
        if len(Str)<=33:
            self.TagPlayerName = Str
        else:
            self.TagPlayerName = Str[:33]
# æ‹å–物品表 #tagDBAuctionItem
class tagDBAuctionItem(Structure):
    _pack_ = 1
    _fields_ = [
        ('ItemGUID', ctypes.c_char * 40),
        ('PlayerID', ctypes.c_ulong),
        ('FamilyID', ctypes.c_ulong),
        ('ItemID', ctypes.c_ulong),
        ('Count', ctypes.c_ushort),
        ('AuctionType', ctypes.c_ubyte),
        ('AddTime', ctypes.c_char * 19),
        ('BiddingTime', ctypes.c_char * 19),
        ('BidderID', ctypes.c_ulong),
        ('BidderName', ctypes.c_char * 33),
        ('BidderPrice', ctypes.c_ulong),
        ('ItemType', ctypes.c_ubyte),
        ('ItemJobLimit', ctypes.c_ubyte),
        ('ItemClassLV', ctypes.c_ubyte),
        ('UserDataLen', ctypes.c_ushort),
        ('UserData', ctypes.c_char_p),
        ('FamilyPlayerIDLen', ctypes.c_ushort),
        ('FamilyPlayerIDInfo', ctypes.c_char_p),
        ('BidderIDLen', ctypes.c_ubyte),
        ('BidderIDInfo', ctypes.c_char_p),
        ('ADOResult', ctypes.c_ulong),
    ]
    def __init__(self):
        Structure.__init__(self)
        self.clear()
    def clear(self):
        self.ItemGUID = ''
        self.PlayerID = 0
        self.FamilyID = 0
        self.ItemID = 0
        self.Count = 0
        self.AuctionType = 0
        self.AddTime = ''
        self.BiddingTime = ''
        self.BidderID = 0
        self.BidderName = ''
        self.BidderPrice = 0
        self.ItemType = 0
        self.ItemJobLimit = 0
        self.ItemClassLV = 0
        self.UserDataLen = 0
        self.UserData = ''
        self.FamilyPlayerIDLen = 0
        self.FamilyPlayerIDInfo = ''
        self.BidderIDLen = 0
        self.BidderIDInfo = ''
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
        self.clear()
        self.ItemGUID, pos = CommFunc.ReadString(buf, pos, 40)
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
        self.ItemID, pos = CommFunc.ReadDWORD(buf, pos)
        self.Count, pos = CommFunc.ReadWORD(buf, pos)
        self.AuctionType, pos = CommFunc.ReadBYTE(buf, pos)
        self.AddTime, pos = CommFunc.ReadString(buf, pos, 19)
        self.BiddingTime, pos = CommFunc.ReadString(buf, pos, 19)
        self.BidderID, pos = CommFunc.ReadDWORD(buf, pos)
        self.BidderName, pos = CommFunc.ReadString(buf, pos, 33)
        self.BidderPrice, pos = CommFunc.ReadDWORD(buf, pos)
        self.ItemType, pos = CommFunc.ReadBYTE(buf, pos)
        self.ItemJobLimit, pos = CommFunc.ReadBYTE(buf, pos)
        self.ItemClassLV, 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)
        self.FamilyPlayerIDLen, pos = CommFunc.ReadWORD(buf, pos)
        tmp, pos = CommFunc.ReadString(buf, pos, self.FamilyPlayerIDLen)
        self.FamilyPlayerIDInfo = ctypes.c_char_p(tmp)
        self.BidderIDLen, pos = CommFunc.ReadBYTE(buf, pos)
        tmp, pos = CommFunc.ReadString(buf, pos, self.BidderIDLen)
        self.BidderIDInfo = ctypes.c_char_p(tmp)
        return self.getLength()
    def getBuffer(self):
        buf = ''
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 40, self.ItemGUID)
        buf = CommFunc.WriteDWORD(buf, self.PlayerID)
        buf = CommFunc.WriteDWORD(buf, self.FamilyID)
        buf = CommFunc.WriteDWORD(buf, self.ItemID)
        buf = CommFunc.WriteWORD(buf, self.Count)
        buf = CommFunc.WriteBYTE(buf, self.AuctionType)
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 19, self.AddTime)
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 19, self.BiddingTime)
        buf = CommFunc.WriteDWORD(buf, self.BidderID)
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.BidderName)
        buf = CommFunc.WriteDWORD(buf, self.BidderPrice)
        buf = CommFunc.WriteBYTE(buf, self.ItemType)
        buf = CommFunc.WriteBYTE(buf, self.ItemJobLimit)
        buf = CommFunc.WriteBYTE(buf, self.ItemClassLV)
        buf = CommFunc.WriteWORD(buf, self.UserDataLen)
        buf = CommFunc.WriteString(buf, self.UserDataLen, self.UserData)
        buf = CommFunc.WriteWORD(buf, self.FamilyPlayerIDLen)
        buf = CommFunc.WriteString(buf, self.FamilyPlayerIDLen, self.FamilyPlayerIDInfo)
        buf = CommFunc.WriteBYTE(buf, self.BidderIDLen)
        buf = CommFunc.WriteString(buf, self.BidderIDLen, self.BidderIDInfo)
        return buf
    def getLength(self):
        length = 0
        length += sizeof(ctypes.c_char) * 40
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ushort)
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_char) * 19
        length += sizeof(ctypes.c_char) * 19
        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_ubyte)
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_ushort)
        length += self.UserDataLen
        length += sizeof(ctypes.c_ushort)
        length += self.FamilyPlayerIDLen
        length += sizeof(ctypes.c_ubyte)
        length += self.BidderIDLen
        return length
    def getRecord(self):
        '''组织存储记录'''
        rec = {}
        rec[u'ItemGUID'] = fix_incomingText(self.ItemGUID)
        rec[u'PlayerID'] = self.PlayerID
        rec[u'FamilyID'] = self.FamilyID
        rec[u'ItemID'] = self.ItemID
        rec[u'Count'] = self.Count
        rec[u'AuctionType'] = self.AuctionType
        rec[u'AddTime'] = fix_incomingText(self.AddTime)
        rec[u'BiddingTime'] = fix_incomingText(self.BiddingTime)
        rec[u'BidderID'] = self.BidderID
        rec[u'BidderName'] = fix_incomingText(self.BidderName)
        rec[u'BidderPrice'] = self.BidderPrice
        rec[u'ItemType'] = self.ItemType
        rec[u'ItemJobLimit'] = self.ItemJobLimit
        rec[u'ItemClassLV'] = self.ItemClassLV
        rec[u'UserDataLen'] = self.UserDataLen
        rec[u'UserData'] = fix_incomingText(self.UserData)
        rec[u'FamilyPlayerIDLen'] = self.FamilyPlayerIDLen
        rec[u'FamilyPlayerIDInfo'] = fix_incomingText(self.FamilyPlayerIDInfo)
        rec[u'BidderIDLen'] = self.BidderIDLen
        rec[u'BidderIDInfo'] = fix_incomingText(self.BidderIDInfo)
        return rec
    def readRecord(self, rec):
        '''由于MongoDB读出来是unicode,所有字符串需要进行转换'''
        self.ItemGUID = fix_outgoingText(rec.get(u'ItemGUID', u''))
        self.PlayerID = rec.get(u'PlayerID', 0)
        self.FamilyID = rec.get(u'FamilyID', 0)
        self.ItemID = rec.get(u'ItemID', 0)
        self.Count = rec.get(u'Count', 0)
        self.AuctionType = rec.get(u'AuctionType', 0)
        self.AddTime = fix_outgoingText(rec.get(u'AddTime', u''))
        self.BiddingTime = fix_outgoingText(rec.get(u'BiddingTime', u''))
        self.BidderID = rec.get(u'BidderID', 0)
        self.BidderName = fix_outgoingText(rec.get(u'BidderName', u''))
        self.BidderPrice = rec.get(u'BidderPrice', 0)
        self.ItemType = rec.get(u'ItemType', 0)
        self.ItemJobLimit = rec.get(u'ItemJobLimit', 0)
        self.ItemClassLV = rec.get(u'ItemClassLV', 0)
        self.UserDataLen = rec.get(u'UserDataLen', 0)
        self.UserData = fix_outgoingText(rec.get(u'UserData', u''))
        self.FamilyPlayerIDLen = rec.get(u'FamilyPlayerIDLen', 0)
        self.FamilyPlayerIDInfo = fix_outgoingText(rec.get(u'FamilyPlayerIDInfo', u''))
        self.BidderIDLen = rec.get(u'BidderIDLen', 0)
        self.BidderIDInfo = fix_outgoingText(rec.get(u'BidderIDInfo', u''))
#Can not implement adoLoadStr method:No key defined!
#Can not implement adoInsertStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoCheckUpdateStr method:No key defined!
#Can not implement adoCheckUpdateExStr method:No key defined!
    def getAdoRecords(self, resultCollection):
        '''查询结果打包成二进制流'''
        result = ''
        result = CommFunc.WriteDWORD(result, resultCollection.count())
        for rec in resultCollection:
            self.readRecord(rec)
            result += self.getBuffer()
        return result
#Can not implement adoQueryIndexStr method:No key defined!
    def adoQueryCustom(self, collection, queryDict):
        '''自定义查询'''
        resultCollection = collection.find(queryDict)
        return self.getAdoRecords(resultCollection)
    def adoQueryAll(self, collection):
        '''查询所有'''
        resultCollection = collection.find()
        return self.getAdoRecords(resultCollection)
#Can not implement adoDeleteByIndexStr method:No key defined!
    def outputString(self):
        output = '''// æ‹å–物品表 #tagDBAuctionItem:
            ItemGUID = %s,
            PlayerID = %s,
            FamilyID = %s,
            ItemID = %s,
            Count = %s,
            AuctionType = %s,
            AddTime = %s,
            BiddingTime = %s,
            BidderID = %s,
            BidderName = %s,
            BidderPrice = %s,
            ItemType = %s,
            ItemJobLimit = %s,
            ItemClassLV = %s,
            UserDataLen = %s,
            UserData = %s,
            FamilyPlayerIDLen = %s,
            FamilyPlayerIDInfo = %s,
            BidderIDLen = %s,
            BidderIDInfo = %s,
            ADOResult = %s,
            '''%(
                self.ItemGUID,
                self.PlayerID,
                self.FamilyID,
                self.ItemID,
                self.Count,
                self.AuctionType,
                self.AddTime,
                self.BiddingTime,
                self.BidderID,
                self.BidderName,
                self.BidderPrice,
                self.ItemType,
                self.ItemJobLimit,
                self.ItemClassLV,
                self.UserDataLen,
                self.UserData,
                self.FamilyPlayerIDLen,
                self.FamilyPlayerIDInfo,
                self.BidderIDLen,
                self.BidderIDInfo,
                self.ADOResult,
            )
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.ItemGUID,
                self.PlayerID,
                self.FamilyID,
                self.ItemID,
                self.Count,
                self.AuctionType,
                self.AddTime,
                self.BiddingTime,
                self.BidderID,
                self.BidderName,
                self.BidderPrice,
                self.ItemType,
                self.ItemJobLimit,
                self.ItemClassLV,
                self.UserDataLen,
                self.UserData,
                self.FamilyPlayerIDLen,
                self.FamilyPlayerIDInfo,
                self.BidderIDLen,
                self.BidderIDInfo,
            )
        return output
    #Char数组类型Set接口,使用该接口对此类型数据赋值,防止赋值的数据过长报错
    def SetItemGUID(self,Str):
        if len(Str)<=40:
            self.ItemGUID = Str
        else:
            self.ItemGUID = Str[:40]
    def SetAddTime(self,Str):
        if len(Str)<=19:
            self.AddTime = Str
        else:
            self.AddTime = Str[:19]
    def SetBiddingTime(self,Str):
        if len(Str)<=19:
            self.BiddingTime = Str
        else:
            self.BiddingTime = Str[:19]
    def SetBidderName(self,Str):
        if len(Str)<=33:
            self.BidderName = Str
        else:
            self.BidderName = Str[:33]
# æ‹å–记录表 #tagDBAuctionRecord
class tagDBAuctionRecord(Structure):
    _pack_ = 1
    _fields_ = [
        ('ItemGUID', ctypes.c_char * 40),
        ('PlayerID', ctypes.c_ulong),
        ('FamilyID', ctypes.c_ulong),
        ('RecordType', ctypes.c_ubyte),
        ('RecordResult', ctypes.c_ubyte),
        ('RecordTime', ctypes.c_char * 19),
        ('BidderPrice', ctypes.c_ulong),
        ('BidderName', ctypes.c_char * 33),
        ('ItemID', ctypes.c_ulong),
        ('Count', ctypes.c_ushort),
        ('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.ItemGUID = ''
        self.PlayerID = 0
        self.FamilyID = 0
        self.RecordType = 0
        self.RecordResult = 0
        self.RecordTime = ''
        self.BidderPrice = 0
        self.BidderName = ''
        self.ItemID = 0
        self.Count = 0
        self.UserDataLen = 0
        self.UserData = ''
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
        self.clear()
        self.ItemGUID, pos = CommFunc.ReadString(buf, pos, 40)
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
        self.RecordType, pos = CommFunc.ReadBYTE(buf, pos)
        self.RecordResult, pos = CommFunc.ReadBYTE(buf, pos)
        self.RecordTime, pos = CommFunc.ReadString(buf, pos, 19)
        self.BidderPrice, pos = CommFunc.ReadDWORD(buf, pos)
        self.BidderName, pos = CommFunc.ReadString(buf, pos, 33)
        self.ItemID, pos = CommFunc.ReadDWORD(buf, pos)
        self.Count, pos = CommFunc.ReadWORD(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) * 40, self.ItemGUID)
        buf = CommFunc.WriteDWORD(buf, self.PlayerID)
        buf = CommFunc.WriteDWORD(buf, self.FamilyID)
        buf = CommFunc.WriteBYTE(buf, self.RecordType)
        buf = CommFunc.WriteBYTE(buf, self.RecordResult)
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 19, self.RecordTime)
        buf = CommFunc.WriteDWORD(buf, self.BidderPrice)
        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.BidderName)
        buf = CommFunc.WriteDWORD(buf, self.ItemID)
        buf = CommFunc.WriteWORD(buf, self.Count)
        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) * 40
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_ubyte)
        length += sizeof(ctypes.c_char) * 19
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_char) * 33
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ushort)
        length += sizeof(ctypes.c_ushort)
        length += self.UserDataLen
        return length
    def getRecord(self):
        '''组织存储记录'''
        rec = {}
        rec[u'ItemGUID'] = fix_incomingText(self.ItemGUID)
        rec[u'PlayerID'] = self.PlayerID
        rec[u'FamilyID'] = self.FamilyID
        rec[u'RecordType'] = self.RecordType
        rec[u'RecordResult'] = self.RecordResult
        rec[u'RecordTime'] = fix_incomingText(self.RecordTime)
        rec[u'BidderPrice'] = self.BidderPrice
        rec[u'BidderName'] = fix_incomingText(self.BidderName)
        rec[u'ItemID'] = self.ItemID
        rec[u'Count'] = self.Count
        rec[u'UserDataLen'] = self.UserDataLen
        rec[u'UserData'] = fix_incomingText(self.UserData)
        return rec
    def readRecord(self, rec):
        '''由于MongoDB读出来是unicode,所有字符串需要进行转换'''
        self.ItemGUID = fix_outgoingText(rec.get(u'ItemGUID', u''))
        self.PlayerID = rec.get(u'PlayerID', 0)
        self.FamilyID = rec.get(u'FamilyID', 0)
        self.RecordType = rec.get(u'RecordType', 0)
        self.RecordResult = rec.get(u'RecordResult', 0)
        self.RecordTime = fix_outgoingText(rec.get(u'RecordTime', u''))
        self.BidderPrice = rec.get(u'BidderPrice', 0)
        self.BidderName = fix_outgoingText(rec.get(u'BidderName', u''))
        self.ItemID = rec.get(u'ItemID', 0)
        self.Count = rec.get(u'Count', 0)
        self.UserDataLen = rec.get(u'UserDataLen', 0)
        self.UserData = fix_outgoingText(rec.get(u'UserData', u''))
#Can not implement adoLoadStr method:No key defined!
#Can not implement adoInsertStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoCheckUpdateStr method:No key defined!
#Can not implement adoCheckUpdateExStr method:No key defined!
    def getAdoRecords(self, resultCollection):
        '''查询结果打包成二进制流'''
        result = ''
        result = CommFunc.WriteDWORD(result, resultCollection.count())
        for rec in resultCollection:
            self.readRecord(rec)
            result += self.getBuffer()
        return result
#Can not implement adoQueryIndexStr method:No key defined!
    def adoQueryCustom(self, collection, queryDict):
        '''自定义查询'''
        resultCollection = collection.find(queryDict)
        return self.getAdoRecords(resultCollection)
    def adoQueryAll(self, collection):
        '''查询所有'''
        resultCollection = collection.find()
        return self.getAdoRecords(resultCollection)
#Can not implement adoDeleteByIndexStr method:No key defined!
    def outputString(self):
        output = '''// æ‹å–记录表 #tagDBAuctionRecord:
            ItemGUID = %s,
            PlayerID = %s,
            FamilyID = %s,
            RecordType = %s,
            RecordResult = %s,
            RecordTime = %s,
            BidderPrice = %s,
            BidderName = %s,
            ItemID = %s,
            Count = %s,
            UserDataLen = %s,
            UserData = %s,
            ADOResult = %s,
            '''%(
                self.ItemGUID,
                self.PlayerID,
                self.FamilyID,
                self.RecordType,
                self.RecordResult,
                self.RecordTime,
                self.BidderPrice,
                self.BidderName,
                self.ItemID,
                self.Count,
                self.UserDataLen,
                self.UserData,
                self.ADOResult,
            )
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                self.ItemGUID,
                self.PlayerID,
                self.FamilyID,
                self.RecordType,
                self.RecordResult,
                self.RecordTime,
                self.BidderPrice,
                self.BidderName,
                self.ItemID,
                self.Count,
                self.UserDataLen,
                self.UserData,
            )
        return output
    #Char数组类型Set接口,使用该接口对此类型数据赋值,防止赋值的数据过长报错
    def SetItemGUID(self,Str):
        if len(Str)<=40:
            self.ItemGUID = Str
        else:
            self.ItemGUID = Str[:40]
    def SetRecordTime(self,Str):
        if len(Str)<=19:
            self.RecordTime = Str
        else:
            self.RecordTime = Str[:19]
    def SetBidderName(self,Str):
        if len(Str)<=33:
            self.BidderName = Str
        else:
            self.BidderName = Str[:33]
# æ‹å–关注表 #tagDBAuctionAttention
class tagDBAuctionAttention(Structure):
    _pack_ = 1
    _fields_ = [
        ('PlayerID', ctypes.c_ulong),
        ('AttentionLen', ctypes.c_ubyte),
        ('AttentionInfo', ctypes.c_char_p),
        ('ADOResult', ctypes.c_ulong),
    ]
    def __init__(self):
        Structure.__init__(self)
        self.clear()
    def clear(self):
        self.PlayerID = 0
        self.AttentionLen = 0
        self.AttentionInfo = ''
    def readData(self, buf, pos = 0, length = 0):
        if not pos <= length:
            msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
            mylog.error(msg)
            return -1
        if len(buf) < pos + self.getLength():
            msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
            mylog.error(msg)
        self.clear()
        self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
        self.AttentionLen, pos = CommFunc.ReadBYTE(buf, pos)
        tmp, pos = CommFunc.ReadString(buf, pos, self.AttentionLen)
        self.AttentionInfo = ctypes.c_char_p(tmp)
        return self.getLength()
    def getBuffer(self):
        buf = ''
        buf = CommFunc.WriteDWORD(buf, self.PlayerID)
        buf = CommFunc.WriteBYTE(buf, self.AttentionLen)
        buf = CommFunc.WriteString(buf, self.AttentionLen, self.AttentionInfo)
        return buf
    def getLength(self):
        length = 0
        length += sizeof(ctypes.c_ulong)
        length += sizeof(ctypes.c_ubyte)
        length += self.AttentionLen
        return length
    def getRecord(self):
        '''组织存储记录'''
        rec = {}
        rec[u'PlayerID'] = self.PlayerID
        rec[u'AttentionLen'] = self.AttentionLen
        rec[u'AttentionInfo'] = fix_incomingText(self.AttentionInfo)
        return rec
    def readRecord(self, rec):
        '''由于MongoDB读出来是unicode,所有字符串需要进行转换'''
        self.PlayerID = rec.get(u'PlayerID', 0)
        self.AttentionLen = rec.get(u'AttentionLen', 0)
        self.AttentionInfo = fix_outgoingText(rec.get(u'AttentionInfo', u''))
#Can not implement adoLoadStr method:No key defined!
#Can not implement adoInsertStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoUpdateStr method:No key defined!
#Can not implement adoCheckUpdateStr method:No key defined!
#Can not implement adoCheckUpdateExStr method:No key defined!
    def getAdoRecords(self, resultCollection):
        '''查询结果打包成二进制流'''
        result = ''
        result = CommFunc.WriteDWORD(result, resultCollection.count())
        for rec in resultCollection:
            self.readRecord(rec)
            result += self.getBuffer()
        return result
#Can not implement adoQueryIndexStr method:No key defined!
    def adoQueryCustom(self, collection, queryDict):
        '''自定义查询'''
        resultCollection = collection.find(queryDict)
        return self.getAdoRecords(resultCollection)
    def adoQueryAll(self, collection):
        '''查询所有'''
        resultCollection = collection.find()
        return self.getAdoRecords(resultCollection)
#Can not implement adoDeleteByIndexStr method:No key defined!
    def outputString(self):
        output = '''// æ‹å–关注表 #tagDBAuctionAttention:
            PlayerID = %s,
            AttentionLen = %s,
            AttentionInfo = %s,
            ADOResult = %s,
            '''%(
                self.PlayerID,
                self.AttentionLen,
                self.AttentionInfo,
                self.ADOResult,
            )
        return output
    def dumpString(self):
        output = '''%1s\t%1s\t%1s'''%(
                self.PlayerID,
                self.AttentionLen,
                self.AttentionInfo,
            )
        return output