From 1a0ad714b01722f0a1c9bc4777b8e0d11ed15e01 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期二, 04 五月 2021 23:11:13 +0800 Subject: [PATCH] 0312 同步脚本 --- Tool/数据库/ChangeAccount/Collections/DataServerPlayerData.py | 203 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 190 insertions(+), 13 deletions(-) diff --git "a/Tool/\346\225\260\346\215\256\345\272\223/ChangeAccount/Collections/DataServerPlayerData.py" "b/Tool/\346\225\260\346\215\256\345\272\223/ChangeAccount/Collections/DataServerPlayerData.py" index fe20c6a..6a28c34 100644 --- "a/Tool/\346\225\260\346\215\256\345\272\223/ChangeAccount/Collections/DataServerPlayerData.py" +++ "b/Tool/\346\225\260\346\215\256\345\272\223/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%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\t%1s\t%1s\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 @@ -15337,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), @@ -15373,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() @@ -15405,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 @@ -15440,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) @@ -15622,6 +15797,7 @@ Name = %s, Friendliness = %s, HP = %s, + HPEx = %s, MP = %s, Lv = %s, Exp = %s, @@ -15655,6 +15831,7 @@ self.Name, self.Friendliness, self.HP, + self.HPEx, self.MP, self.Lv, self.Exp, @@ -15685,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, @@ -15727,7 +15905,6 @@ else: self.Name = Str[:24] - #------------------------------------------------------ #玩家重复事件表#tagRoleRepeatTime -- Gitblit v1.8.0