|
1 | | -using WowPacketParser.Enums; |
| 1 | +using System; |
| 2 | +using WowPacketParser.Enums; |
2 | 3 | using WowPacketParser.Misc; |
3 | 4 | using WowPacketParser.Parsing; |
| 5 | +using WowPacketParser.Store; |
4 | 6 | using WowPacketParser.Store.Objects; |
5 | 7 |
|
6 | 8 | namespace WowPacketParserModule.V5_5_0_61735.Parsers |
@@ -41,6 +43,184 @@ public static PlayerGuidLookupData ReadPlayerGuidLookupData(Packet packet, param |
41 | 43 | return data; |
42 | 44 | } |
43 | 45 |
|
| 46 | + public static void ReadChrCustomizationChoice(Packet packet, params object[] indexes) |
| 47 | + { |
| 48 | + packet.ReadUInt32("ChrCustomizationOptionID", indexes); |
| 49 | + packet.ReadUInt32("ChrCustomizationChoiceID", indexes); |
| 50 | + } |
| 51 | + |
| 52 | + public static void ReadUnlockedConditionalAppearance(Packet packet, params object[] indexes) |
| 53 | + { |
| 54 | + packet.ReadUInt32("AchievementId", indexes); |
| 55 | + packet.ReadUInt32("Unused", indexes); |
| 56 | + } |
| 57 | + |
| 58 | + public static void ReadRaceLimitDisableInfo(Packet packet, params object[] idx) |
| 59 | + { |
| 60 | + packet.ReadSByteE<Race>("RaceID", idx); |
| 61 | + packet.ReadInt32("BlockReason", idx); |
| 62 | + } |
| 63 | + |
| 64 | + public static void ReadVisualItemInfo(Packet packet, params object[] idx) |
| 65 | + { |
| 66 | + packet.ReadUInt32("DisplayID", idx); |
| 67 | + packet.ReadByteE<InventoryType>("InvType", idx); |
| 68 | + packet.ReadUInt32("DisplayEnchantID", idx); |
| 69 | + packet.ReadByte("Subclass", idx); |
| 70 | + packet.ReadInt32("SecondaryItemModifiedAppearanceID", idx); |
| 71 | + packet.ReadInt32("ItemID", idx); |
| 72 | + packet.ReadInt32("TransmogrifiedItemID", idx); |
| 73 | + } |
| 74 | + |
| 75 | + public static void ReadCustomTabardInfo(Packet packet, params object[] idx) |
| 76 | + { |
| 77 | + packet.ReadInt32("EmblemStyle", idx); |
| 78 | + packet.ReadInt32("EmblemColor", idx); |
| 79 | + packet.ReadInt32("BorderStyle", idx); |
| 80 | + packet.ReadInt32("BorderColor", idx); |
| 81 | + packet.ReadInt32("BackgroundColor", idx); |
| 82 | + } |
| 83 | + |
| 84 | + public static void ReadBasicCharacterListEntry(Packet packet, params object[] idx) |
| 85 | + { |
| 86 | + var playerGuid = packet.ReadPackedGuid128("Guid", idx); |
| 87 | + packet.ReadUInt32("VirtualRealmAddress", idx); |
| 88 | + packet.ReadUInt16("ListPosition", idx); |
| 89 | + var race = packet.ReadByteE<Race>("RaceID", idx); |
| 90 | + packet.ReadByteE<Gender>("SexID", idx); |
| 91 | + var @class = packet.ReadByteE<Class>("ClassID", idx); |
| 92 | + packet.ReadInt16("SpecID", idx); |
| 93 | + var customizationCount = packet.ReadUInt32(); |
| 94 | + var level = packet.ReadByte("ExperienceLevel", idx); |
| 95 | + var mapId = packet.ReadInt32<MapId>("MapID", idx); |
| 96 | + var zone = packet.ReadInt32<ZoneId>("ZoneID", idx); |
| 97 | + var pos = packet.ReadVector3("PreloadPos", idx); |
| 98 | + packet.ReadUInt64("GuildClubMemberID", idx); |
| 99 | + packet.ReadPackedGuid128("GuildGUID", idx); |
| 100 | + packet.ReadUInt32("Flags", idx); |
| 101 | + packet.ReadUInt32("Flags2", idx); |
| 102 | + packet.ReadUInt32("Flags3", idx); |
| 103 | + packet.ReadUInt32("Flags4", idx); |
| 104 | + packet.ReadByte("CantLoginReason", idx); |
| 105 | + packet.ReadUInt32("PetCreatureDisplayID", idx); |
| 106 | + packet.ReadUInt32("PetExperienceLevel", idx); |
| 107 | + packet.ReadUInt32("PetCreatureFamilyID", idx); |
| 108 | + |
| 109 | + for (uint j = 0; j < 19; ++j) |
| 110 | + ReadVisualItemInfo(packet, idx, "VisualItems", j); |
| 111 | + |
| 112 | + packet.ReadInt32("SaveVersion", idx); |
| 113 | + packet.ReadTime64("LastPlayedTime", idx); |
| 114 | + packet.ReadInt32("LastLoginVersion", idx); |
| 115 | + |
| 116 | + ReadCustomTabardInfo(packet, idx, "PersonalTabard"); |
| 117 | + |
| 118 | + for (uint j = 0; j < 2; ++j) |
| 119 | + packet.ReadInt32("ProfessionIDs", idx, j); |
| 120 | + |
| 121 | + packet.ReadInt32("TimerunningSeasonID", idx); |
| 122 | + packet.ReadUInt32("OverrideSelectScreenFileDataID", idx); |
| 123 | + packet.ReadUInt32("Unused1110_1", idx); |
| 124 | + |
| 125 | + for (var j = 0u; j < customizationCount; ++j) |
| 126 | + ReadChrCustomizationChoice(packet, idx, "Customizations", j); |
| 127 | + |
| 128 | + packet.ResetBitReader(); |
| 129 | + |
| 130 | + var nameLength = packet.ReadBits(6); |
| 131 | + var firstLogin = packet.ReadBit("FirstLogin", idx); |
| 132 | + packet.ReadBit("Unused1110_2", idx); |
| 133 | + packet.ReadBit("Unused1110_3", idx); |
| 134 | + |
| 135 | + var name = packet.ReadWoWString("Character Name", nameLength, idx); |
| 136 | + |
| 137 | + if (firstLogin) |
| 138 | + { |
| 139 | + PlayerCreateInfo startPos = new PlayerCreateInfo { Race = race, Class = @class, Map = (uint)mapId, Zone = (uint)zone, Position = pos, Orientation = 0 }; |
| 140 | + Storage.StartPositions.Add(startPos, packet.TimeSpan); |
| 141 | + } |
| 142 | + |
| 143 | + var playerInfo = new Player { Race = race, Class = @class, Name = name, FirstLogin = firstLogin, Level = level, Type = ObjectType.Player }; |
| 144 | + if (Storage.Objects.ContainsKey(playerGuid)) |
| 145 | + Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan); |
| 146 | + else |
| 147 | + Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan); |
| 148 | + } |
| 149 | + |
| 150 | + public static void ReadCharacterRestrictionAndMailData(Packet packet, params object[] idx) |
| 151 | + { |
| 152 | + packet.ResetBitReader(); |
| 153 | + packet.ReadBit("BoostInProgress", idx); |
| 154 | + packet.ReadBits("Unk550", 2, idx); |
| 155 | + packet.ReadBit("RpeResetAvailable", idx); |
| 156 | + packet.ReadBit("RpeResetQuestClearAvailable", idx); |
| 157 | + |
| 158 | + packet.ReadUInt32("RestrictionFlags", idx); |
| 159 | + var mailSenderLengths = new uint[packet.ReadUInt32()]; |
| 160 | + var mailSenderTypes = packet.ReadUInt32(); |
| 161 | + |
| 162 | + for (var j = 0; j < mailSenderTypes; ++j) |
| 163 | + packet.ReadUInt32("MailSenderType", idx, j); |
| 164 | + |
| 165 | + packet.ResetBitReader(); |
| 166 | + |
| 167 | + for (var j = 0; j < mailSenderLengths.Length; ++j) |
| 168 | + mailSenderLengths[j] = packet.ReadBits(6); |
| 169 | + |
| 170 | + for (var j = 0; j < mailSenderLengths.Length; ++j) |
| 171 | + packet.ReadDynamicString("MailSender", mailSenderLengths[j], idx); |
| 172 | + } |
| 173 | + |
| 174 | + public static void ReadCharacterListEntry(Packet packet, params object[] idx) |
| 175 | + { |
| 176 | + ReadBasicCharacterListEntry(packet, idx, "Basic"); |
| 177 | + ReadCharacterRestrictionAndMailData(packet, idx, "RestrictionsAndMails"); |
| 178 | + } |
| 179 | + |
| 180 | + public static void ReadRegionwideCharacterListEntry(Packet packet, params object[] idx) |
| 181 | + { |
| 182 | + ReadBasicCharacterListEntry(packet, idx, "Basic"); |
| 183 | + packet.ReadUInt64("Money", idx); |
| 184 | + packet.ReadSingle("AvgEquippedItemLevel", idx); |
| 185 | + packet.ReadSingle("CurrentSeasonMythicPlusOverallScore", idx); |
| 186 | + packet.ReadInt32("CurrentSeasonBestPvpRating", idx); |
| 187 | + packet.ReadSByte("PvpRatingBracket", idx); |
| 188 | + packet.ReadInt16("PvpRatingAssociatedSpecID", idx); |
| 189 | + } |
| 190 | + |
| 191 | + public static void ReadRaceUnlockData(Packet packet, params object[] idx) |
| 192 | + { |
| 193 | + packet.ReadByteE<Race>("RaceID", idx); |
| 194 | + packet.ResetBitReader(); |
| 195 | + packet.ReadBit("HasExpansion", idx); |
| 196 | + packet.ReadBit("HasAchievement", idx); |
| 197 | + packet.ReadBit("HasHeritageArmor", idx); |
| 198 | + packet.ReadBit("IsLocked", idx); |
| 199 | + packet.ReadBit("Unused1027", idx); |
| 200 | + } |
| 201 | + |
| 202 | + public static void ReadWarbandGroupMember(Packet packet, params object[] idx) |
| 203 | + { |
| 204 | + packet.ReadInt32("WarbandScenePlacementID", idx); |
| 205 | + var type = packet.ReadInt32("Type", idx); |
| 206 | + if (type == 0) |
| 207 | + packet.ReadPackedGuid128("Guid", idx); |
| 208 | + } |
| 209 | + |
| 210 | + public static void ReadWarbandGroup(Packet packet, params object[] idx) |
| 211 | + { |
| 212 | + packet.ReadUInt64("GroupID", idx); |
| 213 | + packet.ReadByte("OrderIndex", idx); |
| 214 | + packet.ReadInt32("WarbandSceneID", idx); |
| 215 | + packet.ReadInt32("Flags", idx); |
| 216 | + var memberCount = packet.ReadUInt32(); |
| 217 | + for (var i = 0u; i < memberCount; ++i) |
| 218 | + ReadWarbandGroupMember(packet, idx, "Members", i); |
| 219 | + |
| 220 | + var nameLength = packet.ReadBits(9); |
| 221 | + packet.ReadWoWString("Name", nameLength, idx); |
| 222 | + } |
| 223 | + |
44 | 224 | [Parser(Opcode.SMSG_FAILED_PLAYER_CONDITION)] |
45 | 225 | public static void HandleFailedPlayerCondition(Packet packet) |
46 | 226 | { |
@@ -89,6 +269,50 @@ public static void HandleInspectHonorStats(Packet packet) |
89 | 269 | packet.ReadByte("RankProgress"); |
90 | 270 | } |
91 | 271 |
|
| 272 | + [Parser(Opcode.SMSG_ENUM_CHARACTERS_RESULT)] |
| 273 | + public static void HandleEnumCharactersResult(Packet packet) |
| 274 | + { |
| 275 | + packet.ReadBit("Success"); |
| 276 | + packet.ReadBit("Realmless"); |
| 277 | + packet.ReadBit("IsDeletedCharacters"); |
| 278 | + packet.ReadBit("IsNewPlayerRestrictionSkipped"); |
| 279 | + packet.ReadBit("IsNewPlayerRestricted"); |
| 280 | + packet.ReadBit("IsNewPlayer"); |
| 281 | + packet.ReadBit("IsTrialAccountRestricted"); |
| 282 | + var hasDisabledClassesMask = packet.ReadBit("HasDisabledClassesMask"); |
| 283 | + |
| 284 | + packet.ReadBit("DontCreateCharacterDisplays"); |
| 285 | + |
| 286 | + var charsCount = packet.ReadUInt32("CharactersCount"); |
| 287 | + var regionwideCharsCount = packet.ReadUInt32("RegionwideCharactersCount"); |
| 288 | + packet.ReadInt32("MaxCharacterLevel"); |
| 289 | + var raceUnlockCount = packet.ReadUInt32("RaceUnlockCount"); |
| 290 | + var unlockedConditionalAppearanceCount = packet.ReadUInt32("UnlockedConditionalAppearanceCount"); |
| 291 | + var raceLimitDisablesCount = packet.ReadUInt32("RaceLimitDisablesCount"); |
| 292 | + var warbandGroupsCount = packet.ReadUInt32("WarbandGroupsCount"); |
| 293 | + |
| 294 | + if (hasDisabledClassesMask) |
| 295 | + packet.ReadUInt32("DisabledClassesMask"); |
| 296 | + |
| 297 | + for (var i = 0u; i < unlockedConditionalAppearanceCount; ++i) |
| 298 | + ReadUnlockedConditionalAppearance(packet, "UnlockedConditionalAppearances", i); |
| 299 | + |
| 300 | + for (var i = 0u; i < raceLimitDisablesCount; i++) |
| 301 | + ReadRaceLimitDisableInfo(packet, "RaceLimitDisableInfo", i); |
| 302 | + |
| 303 | + for (var i = 0u; i < charsCount; ++i) |
| 304 | + ReadCharacterListEntry(packet, i, "Characters"); |
| 305 | + |
| 306 | + for (var i = 0u; i < regionwideCharsCount; ++i) |
| 307 | + ReadRegionwideCharacterListEntry(packet, i, "RegionwideCharacters"); |
| 308 | + |
| 309 | + for (var i = 0u; i < raceUnlockCount; ++i) |
| 310 | + ReadRaceUnlockData(packet, i, "RaceUnlockData"); |
| 311 | + |
| 312 | + for (var i = 0u; i < warbandGroupsCount; ++i) |
| 313 | + ReadWarbandGroup(packet, i, "WarbandGroups"); |
| 314 | + } |
| 315 | + |
92 | 316 | [Parser(Opcode.SMSG_PLAYER_CHOICE_CLEAR)] |
93 | 317 | public static void HandleEmpty(Packet packet) |
94 | 318 | { |
|
0 commit comments