Skip to content

Commit

Permalink
Fix parsing of 3_4_2 update object (TrinityCore#889)
Browse files Browse the repository at this point in the history
* Fix parsing of 3_4_2 update object create part

* Fix update part of 3.4.2
  • Loading branch information
killerwife authored Nov 3, 2024
1 parent dc84112 commit ecc6a75
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 168 deletions.
4 changes: 2 additions & 2 deletions WowPacketParserModule.V2_5_1_38707/Parsers/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ private static MovementInfo ReadMovementUpdateBlock(Packet packet, WowGuid guid,
}

var hasStandingOnGameObjectGUID = false;
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_4_3_51505))
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_4_2_50063))
hasStandingOnGameObjectGUID = packet.ReadBit("HasStandingOnGameObjectGUID", index);

var hasTransport = packet.ReadBit("Has Transport Data", index);
Expand Down Expand Up @@ -871,7 +871,7 @@ private static MovementInfo ReadMovementUpdateBlock(Packet packet, WowGuid guid,

if (hasActionButtons)
{
var actionButtonCount = (ClientVersion.AddedInVersion(ClientVersionBuild.V3_4_3_51505) ? 180 : 132);
var actionButtonCount = (ClientVersion.AddedInVersion(ClientVersionBuild.V3_4_2_50063) ? 180 : 132);
for (int i = 0; i < actionButtonCount; i++)
packet.ReadInt32("Action", index, i);
}
Expand Down
396 changes: 248 additions & 148 deletions WowPacketParserModule.V3_4_0_45166/Parsers/UpdateFieldsHandler342.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace WowPacketParserModule.V3_4_0_45166.UpdateFields.V3_4_2_50129
{
public class ActivePlayerData : IActivePlayerData
{
public WowGuid[] InvSlots { get; } = new WowGuid[129];
public WowGuid[] InvSlots { get; } = new WowGuid[141];
public WowGuid FarsightObject { get; set; }
public WowGuid ComboTarget { get; set; }
public System.Nullable<ulong> Coinage { get; set; }
Expand Down Expand Up @@ -106,20 +106,24 @@ public class ActivePlayerData : IActivePlayerData
public System.Nullable<ulong>[] QuestCompleted { get; } = new System.Nullable<ulong>[875];
public System.Nullable<int> Honor { get; set; }
public System.Nullable<int> HonorNextLevel { get; set; }
public System.Nullable<int> Field_F74 { get; set; }
public System.Nullable<int> PvpTierMaxFromWins { get; set; }
public System.Nullable<int> PvpLastWeeksTierMaxFromWins { get; set; }
public System.Nullable<byte> PvpRankProgress { get; set; }
public System.Nullable<int> PerksProgramCurrency { get; set; }
public System.Nullable<byte> NumBankSlots { get; set; }
public System.Nullable<int> TransportServerTime { get; set; }
public System.Nullable<uint> ActiveCombatTraitConfigID { get; set; }
public IGlyphInfo[] GlyphInfo { get; } = new IGlyphInfo[6];
public System.Nullable<byte> GlyphsEnabled { get; set; }
public System.Nullable<byte> Unk340 { get; set; }
public System.Nullable<byte> LfgRoles { get; set; }
public DynamicUpdateField<System.Nullable<ushort>>[] ResearchSites { get; } = new DynamicUpdateField<System.Nullable<ushort>>[1] { new DynamicUpdateField<System.Nullable<ushort>>() };
public DynamicUpdateField<System.Nullable<uint>>[] ResearchSiteProgress { get; } = new DynamicUpdateField<System.Nullable<uint>>[1] { new DynamicUpdateField<System.Nullable<uint>>() };
public DynamicUpdateField<IResearch>[] Research { get; } = new DynamicUpdateField<IResearch>[1] { new DynamicUpdateField<IResearch>() };
public DynamicUpdateField<System.Nullable<ulong>> KnownTitles { get; } = new DynamicUpdateField<System.Nullable<ulong>>();
public DynamicUpdateField<System.Nullable<uint>> ResearchSites { get; } = new DynamicUpdateField<System.Nullable<uint>>();
public DynamicUpdateField<System.Nullable<uint>> ResearchSiteProgress { get; } = new DynamicUpdateField<System.Nullable<uint>>();
public DynamicUpdateField<System.Nullable<int>> DailyQuestsCompleted { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<System.Nullable<int>> AvailableQuestLineXQuestIDs { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<System.Nullable<int>> Unk254 { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<System.Nullable<int>> Field_1000 { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<System.Nullable<int>> Heirlooms { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<System.Nullable<uint>> HeirloomFlags { get; } = new DynamicUpdateField<System.Nullable<uint>>();
public DynamicUpdateField<System.Nullable<int>> Toys { get; } = new DynamicUpdateField<System.Nullable<int>>();
Expand All @@ -128,9 +132,13 @@ public class ActivePlayerData : IActivePlayerData
public DynamicUpdateField<System.Nullable<int>> SelfResSpells { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<ISpellPctModByLabel> SpellPctModByLabel { get; } = new DynamicUpdateField<ISpellPctModByLabel>();
public DynamicUpdateField<ISpellFlatModByLabel> SpellFlatModByLabel { get; } = new DynamicUpdateField<ISpellFlatModByLabel>();
public DynamicUpdateField<IQuestLog> TaskQuests { get; } = new DynamicUpdateField<IQuestLog>();
public DynamicUpdateField<ICategoryCooldownMod> CategoryCooldownMods { get; } = new DynamicUpdateField<ICategoryCooldownMod>();
public DynamicUpdateField<IWeeklySpellUse> WeeklySpellUses { get; } = new DynamicUpdateField<IWeeklySpellUse>();
public IPVPInfo[] PvpInfo { get; } = new IPVPInfo[6];
public System.Nullable<bool> InsertItemsLeftToRight { get; set; }
public DynamicUpdateField<ICharacterRestriction> CharacterRestrictions { get; } = new DynamicUpdateField<ICharacterRestriction>();
public DynamicUpdateField<ITraitConfig> TraitConfigs { get; } = new DynamicUpdateField<ITraitConfig>();
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using WowPacketParser.Misc;
using WowPacketParser.Store.Objects.UpdateFields;

// This file is automatically generated, DO NOT EDIT

namespace WowPacketParserModule.V3_4_0_45166.UpdateFields.V3_4_2_50129
{
public class CategoryCooldownMod : ICategoryCooldownMod
{
public int SpellCategoryID { get; set; }
public int ModCooldown { get; set; }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ public class PlayerData : IPlayerData
public System.Nullable<uint> GuildRankID { get; set; }
public System.Nullable<uint> GuildDeleteDate { get; set; }
public System.Nullable<int> GuildLevel { get; set; }
public System.Nullable<byte> PartyType { get; set; }
public System.Nullable<byte>[] PartyType { get; } = new System.Nullable<byte>[2];
public System.Nullable<byte> NumBankSlots { get; set; }
public System.Nullable<byte> NativeSex { get; set; }
public System.Nullable<byte> Inebriation { get; set; }
public System.Nullable<byte> PvpTitle { get; set; }
public System.Nullable<byte> ArenaFaction { get; set; }
public System.Nullable<byte> PvpRank { get; set; }
public System.Nullable<byte> Unk254 { get; set; }
public System.Nullable<int> Unk254 { get; set; }
public System.Nullable<uint> DuelTeam { get; set; }
public System.Nullable<int> GuildTimeStamp { get; set; }
public IQuestLog[] QuestLog { get; } = new IQuestLog[25];
Expand All @@ -34,8 +35,13 @@ public class PlayerData : IPlayerData
public System.Nullable<float>[] AvgItemLevel { get; } = new System.Nullable<float>[6];
public System.Nullable<byte> CurrentBattlePetBreedQuality { get; set; }
public System.Nullable<int> HonorLevel { get; set; }
public System.Nullable<long> LogoutTime { get; set; }
public WowGuid BnetAccount { get; set; }
public System.Nullable<int> CurrentBattlePetSpeciesID { get; set; }
public System.Nullable<uint>[] Field_3120 { get; } = new System.Nullable<uint>[19];
public DynamicUpdateField<IChrCustomizationChoice> Customizations { get; } = new DynamicUpdateField<IChrCustomizationChoice>();
public DynamicUpdateField<IArenaCooldown> ArenaCooldowns { get; } = new DynamicUpdateField<IArenaCooldown>();
public DynamicUpdateField<System.Nullable<int>> VisualItemReplacements { get; } = new DynamicUpdateField<System.Nullable<int>>();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public class UnitData : IMutableUnitData
public System.Nullable<byte> Sex { get; set; }
public System.Nullable<byte> DisplayPower { get; set; }
public System.Nullable<uint> OverrideDisplayPowerID { get; set; }
public System.Nullable<float>[] Unk340 { get; } = new System.Nullable<float>[7];
public System.Nullable<float>[] Unk340_2 { get; } = new System.Nullable<float>[7];
public System.Nullable<int>[] Power { get; } = new System.Nullable<int>[7];
public System.Nullable<int>[] MaxPower { get; } = new System.Nullable<int>[7];
public System.Nullable<float>[] PowerRegenFlatModifier { get; } = new System.Nullable<float>[7];
public System.Nullable<float>[] PowerRegenFlatModifier { get; } = new System.Nullable<float>[10];
public System.Nullable<float>[] ModPowerRegen { get; } = new System.Nullable<float>[10];
public System.Nullable<int>[] Power { get; } = new System.Nullable<int>[10];
public System.Nullable<int>[] MaxPower { get; } = new System.Nullable<int>[10];
public System.Nullable<float>[] PowerRegenInterruptedFlatModifier { get; } = new System.Nullable<float>[10];
public System.Nullable<int> Level { get; set; }
public System.Nullable<int> EffectiveLevel { get; set; }
public System.Nullable<int> ContentTuningID { get; set; }
Expand Down Expand Up @@ -116,18 +116,17 @@ public class UnitData : IMutableUnitData
public System.Nullable<int> MinItemLevel { get; set; }
public System.Nullable<int> MaxItemLevel { get; set; }
public System.Nullable<int> WildBattlePetLevel { get; set; }
// public System.Nullable<uint> BattlePetCompanionNameTimestamp { get; set; }
// kind reminder this is manual herpity guessworkity
public System.Nullable<uint> BattlePetCompanionNameTimestamp { get; set; }
public System.Nullable<int> InteractSpellID { get; set; }
// System.Nullable<int> ScaleDuration { get; set; }
public System.Nullable<int> ScaleDuration { get; set; }
public System.Nullable<int> LooksLikeMountID { get; set; }
public System.Nullable<int> LooksLikeCreatureID { get; set; }
public System.Nullable<int> LookAtControllerID { get; set; }
// public System.Nullable<int> PerksVendorItemID { get; set; }
// public System.Nullable<int> TaxiNodesID { get; set; }
public System.Nullable<int> PerksVendorItemID { get; set; }
public WowGuid GuildGUID { get; set; }
public WowGuid SkinningOwnerGUID { get; set; }
public WowGuid Unk340_3 { get; set; }
public System.Nullable<int> FlightCapabilityID { get; set; }
public WowGuid ComboTarget { get; set; }
public DynamicUpdateField<IPassiveSpellHistory> PassiveSpells { get; } = new DynamicUpdateField<IPassiveSpellHistory>();
public DynamicUpdateField<System.Nullable<int>> WorldEffects { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<WowGuid> ChannelObjects { get; } = new DynamicUpdateField<WowGuid>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using WowPacketParser.Misc;
using WowPacketParser.Store.Objects.UpdateFields;

// This file is automatically generated, DO NOT EDIT

namespace WowPacketParserModule.V3_4_0_45166.UpdateFields.V3_4_2_50129
{
public class WeeklySpellUse : IWeeklySpellUse
{
public int SpellCategoryID { get; set; }
public byte Uses { get; set; }
}
}

0 comments on commit ecc6a75

Please sign in to comment.