Skip to content

Commit

Permalink
Add multiple 4.4.0 handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
funjoker committed Jun 5, 2024
1 parent db4e68a commit 62baead
Show file tree
Hide file tree
Showing 14 changed files with 294 additions and 0 deletions.
27 changes: 27 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/AddonHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class AddonHandler
{
[Parser(Opcode.CMSG_CHAT_REGISTER_ADDON_PREFIXES)]
public static void HandleChatRegisterAddonPrefixes(Packet packet)
{
var count = packet.ReadInt32("Count");

for (var i = 0; i < count; ++i)
{
packet.ResetBitReader();
var lengths = (int)packet.ReadBits(5);
packet.ReadWoWString("Addon", lengths, i);
}
}

[Parser(Opcode.CMSG_CHAT_UNREGISTER_ALL_ADDON_PREFIXES)]
public static void HandleAddonZero(Packet packet)
{
}
}
}
65 changes: 65 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/BattlePetHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class BattlePetHandler
{
public static void ReadClientBattlePet(Packet packet, params object[] idx)
{
packet.ReadPackedGuid128("BattlePetGUID", idx);

packet.ReadInt32("SpeciesID", idx);
packet.ReadInt32("CreatureID", idx);
packet.ReadInt32("DisplayID", idx);

packet.ReadInt16("BreedID", idx);
packet.ReadInt16("Level", idx);
packet.ReadInt16("Xp", idx);
packet.ReadInt16("BattlePetDBFlags", idx);

packet.ReadInt32("Power", idx);
packet.ReadInt32("Health", idx);
packet.ReadInt32("MaxHealth", idx);
packet.ReadInt32("Speed", idx);

packet.ReadByte("BreedQuality", idx);

packet.ResetBitReader();

var customNameLength = packet.ReadBits(7);
var hasOwnerInfo = packet.ReadBit("HasOwnerInfo", idx);
packet.ReadBit("NoRename", idx);

packet.ReadWoWString("CustomName", customNameLength, idx);

if (hasOwnerInfo)
V6_0_2_19033.Parsers.BattlePetHandler.ReadClientBattlePetOwnerInfo(packet, "OwnerInfo", idx);
}

[Parser(Opcode.SMSG_BATTLE_PET_JOURNAL)]
public static void HandleBattlePetJournal(Packet packet)
{
packet.ReadInt16("TrapLevel");

var slotsCount = packet.ReadInt32("SlotsCount");
var petsCount = packet.ReadInt32("PetsCount");

packet.ReadBit("HasJournalLock");
packet.ResetBitReader();

for (var i = 0; i < slotsCount; i++)
V6_0_2_19033.Parsers.BattlePetHandler.ReadClientPetBattleSlot(packet, i);

for (var i = 0; i < petsCount; i++)
ReadClientBattlePet(packet, i);
}

[Parser(Opcode.SMSG_BATTLE_PET_JOURNAL_LOCK_ACQUIRED)]
[Parser(Opcode.CMSG_BATTLE_PET_REQUEST_JOURNAL)]
public static void HandleBattlePetZero(Packet packet)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class BattlegroundHandler
{
[Parser(Opcode.CMSG_ARENA_TEAM_ROSTER)]
public static void HandleArenaTeamQuery(Packet packet)
{
packet.ReadUInt32("TeamID");
}

[Parser(Opcode.CMSG_REQUEST_BATTLEFIELD_STATUS)]
[Parser(Opcode.CMSG_REQUEST_RATED_PVP_INFO)]
public static void HandleBattlegroundZero(Packet packet)
{
Expand Down
14 changes: 14 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/CalenderHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class CalenderHandler
{
[Parser(Opcode.CMSG_CALENDAR_GET_NUM_PENDING)]
public static void HandleCalenderZero(Packet packet)
{
}
}
}
15 changes: 15 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/CharacterHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,20 @@ public static void HandleLevelUpInfo(Packet packet)
packet.ReadInt32("NumNewTalents");
packet.ReadInt32("NumNewPvpTalentSlots");
}

[Parser(Opcode.CMSG_REQUEST_PLAYED_TIME)]
public static void HandleClientPlayedTime(Packet packet)
{
packet.ReadBit("TriggerScriptEvent");
}

[Parser(Opcode.SMSG_PLAYED_TIME)]
public static void HandleServerPlayedTime(Packet packet)
{
packet.ReadInt32("TotalTime");
packet.ReadInt32("LevelTime");

packet.ReadBit("TriggerEvent");
}
}
}
41 changes: 41 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/ContactHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class ContactHandler
{
public static void ReadContactInfo(Packet packet, params object[] index)
{
packet.ReadPackedGuid128("Guid", index);
packet.ReadPackedGuid128("WowAccount", index);

packet.ReadUInt32("VirtualRealmAddr", index);
packet.ReadUInt32("NativeRealmAddr", index);
packet.ReadUInt32("TypeFlags", index);

packet.ReadByte("Status", index);

packet.ReadUInt32<AreaId>("AreaID", index);
packet.ReadUInt32("Level", index);
packet.ReadUInt32("ClassID", index);

packet.ResetBitReader();

var notesLen = packet.ReadBits(10);
packet.ReadBit("Mobile");
packet.ReadWoWString("Notes", notesLen);
}

[Parser(Opcode.SMSG_CONTACT_LIST)]
public static void HandleContactList(Packet packet)
{
packet.ReadInt32E<ContactListFlag>("List Flags");
var contactInfoCount = packet.ReadBits("ContactInfoCount", 8);

for (var i = 0; i < contactInfoCount; i++)
ReadContactInfo(packet, i);
}
}
}
14 changes: 14 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/GuildHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class GuildHandler
{
[Parser(Opcode.CMSG_GUILD_BANK_REMAINING_WITHDRAW_MONEY_QUERY)]
public static void HandleGuildZero(Packet packet)
{
}
}
}
39 changes: 39 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/LfgHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class LfgHandler
{
public static void ReadLFGListBlacklistEntry(Packet packet, params object[] indexes)
{
packet.ReadInt32("ActivityID", indexes);
packet.ReadInt32("Reason", indexes);
}

[Parser(Opcode.CMSG_DF_GET_SYSTEM_INFO)]
public static void HandleLFGLockInfoRequest(Packet packet)
{
packet.ReadBit("Player");
if (packet.ReadBit())
packet.ReadByte("PartyIndex");
}

[Parser(Opcode.SMSG_LFG_LIST_UPDATE_BLACKLIST)]
public static void HandleLFGListUpdateBlacklist(Packet packet)
{
var count = packet.ReadInt32("BlacklistEntryCount");
for (int i = 0; i < count; i++)
ReadLFGListBlacklistEntry(packet, i, "ListBlacklistEntry");
}

[Parser(Opcode.CMSG_LFG_LIST_GET_STATUS)]
[Parser(Opcode.CMSG_REQUEST_LFG_LIST_BLACKLIST)]
[Parser(Opcode.CMSG_DF_GET_JOIN_STATUS)]
public static void HandleLfgZero(Packet packet)
{
}
}
}
14 changes: 14 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/MailHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class MailHandler
{
[Parser(Opcode.CMSG_QUERY_NEXT_MAIL_TIME)]
public static void HandleNullMail(Packet packet)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,16 @@ public static void HandleFeatureSystemStatus(Packet packet)
}
}

[Parser(Opcode.CMSG_QUERY_COUNTDOWN_TIMER)]
public static void HandleQueryCountdownTimer(Packet packet)
{
packet.ReadInt32("TimerType");
}

[Parser(Opcode.SMSG_RESUME_COMMS)]
[Parser(Opcode.CMSG_SOCIAL_CONTRACT_REQUEST)]
[Parser(Opcode.CMSG_SERVER_TIME_OFFSET_REQUEST)]
[Parser(Opcode.CMSG_QUERY_TIME)]
public static void HandleZeroLengthPackets(Packet packet)
{
}
Expand Down
6 changes: 6 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/MovementHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,11 @@ public static void HandlePhaseShift(Packet packet)

CoreParsers.MovementHandler.WritePhaseChanges(packet);
}

[Parser(Opcode.CMSG_MOVE_INIT_ACTIVE_MOVER_COMPLETE)]
public static void HandleMoveInitActiveMoverComplete(Packet packet)
{
packet.ReadUInt32("Ticks");
}
}
}
17 changes: 17 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/ReputationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,22 @@ public static void HandleInitializeFactions(Packet packet)
for (var i = 0; i < FactionCount; i++)
packet.ReadBit("FactionHasBonus", i);
}

[Parser(Opcode.SMSG_SET_FORCED_REACTIONS)]
public static void HandleForcedReactions(Packet packet)
{
var counter = packet.ReadUInt32("ForcedReactionCount");

for (var i = 0; i < counter; i++)
{
packet.ReadUInt32("Faction");
packet.ReadUInt32("Reaction");
}
}

[Parser(Opcode.CMSG_REQUEST_FORCED_REACTIONS)]
public static void HandleReputationZero(Packet packet)
{
}
}
}
6 changes: 6 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/SessionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ public static void HandlePlayerLogin(Packet packet)
WowPacketParser.Parsing.Parsers.SessionHandler.LoginGuid = guid;
}

[Parser(Opcode.SMSG_QUERY_TIME_RESPONSE)]
public static void HandleQueryTimeResponse(Packet packet)
{
packet.ReadTime64("CurrentTime");
}

[Parser(Opcode.CMSG_ENTER_ENCRYPTED_MODE_ACK)]
public static void HandleSessionZero(Packet packet)
{
Expand Down
22 changes: 22 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/TokenHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class TokenHandler
{
[Parser(Opcode.SMSG_COMMERCE_TOKEN_UPDATE)]
public static void HandleCommerceTokenUpdate(Packet packet)
{
var count1 = packet.ReadInt32("DistributionCount1");
var count2 = packet.ReadInt32("DistributionCount2");

for (int i = 0; i < count1; i++)
packet.ReadInt64("DistributionID", i);

for (int i = 0; i < count2; i++)
packet.ReadInt64("DistributionID", i);
}
}
}

0 comments on commit 62baead

Please sign in to comment.