public static void HandlePetNameQueryResponse(Packet packet)
        {
            var hasData = packet.ReadBit();
            if (!hasData)
            {
                packet.ReadUInt64("Pet number");
                return;
            }

            packet.ReadBit("Declined");

            const int maxDeclinedNameCases = 5;
            var declinedNameLen = new int[maxDeclinedNameCases];
            for (var i = 0; i < maxDeclinedNameCases; ++i)
                declinedNameLen[i] = (int)packet.ReadBits(7);

            var len = packet.ReadBits(8);

            for (var i = 0; i < maxDeclinedNameCases; ++i)
                if (declinedNameLen[i] != 0)
                    packet.ReadWoWString("Declined name", declinedNameLen[i], i);

            var petName = packet.ReadWoWString("Pet name", len);
            packet.ReadTime("Time");
            var number = packet.ReadUInt64("Pet number");

            var guidArray = (from pair in StoreGetters.NameDict where Equals(pair.Value, number) select pair.Key).ToList();
            foreach (var guid in guidArray)
                StoreGetters.NameDict[guid] = petName;
        }
Example #2
1
 public static void HandleTradeGold(Packet packet)
 {
     if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6_13596)) // Need correct version
         packet.ReadUInt64("Gold");
     else
         packet.ReadUInt32("Gold");
 }
        public static void HandleCalendarEventInviteAlert(Packet packet)
        {
            // TODO: find unks

            packet.ReadUInt64("EventID");
            packet.ReadPackedTime("Date");
            packet.ReadInt32E<CalendarFlag>("Flags");

            packet.ReadByteE<CalendarEventType>("EventType");

            packet.ReadInt32("TextureID");

            packet.ReadPackedGuid128("EventGuildID");

            packet.ReadUInt64("InviteID");

            packet.ReadByteE<CalendarEventStatus>("Status");
            packet.ReadByteE<CalendarModerationRank>("ModeratorStatus");

            packet.ReadPackedGuid128("OwnerGUID | InvitedByGUID");
            packet.ReadPackedGuid128("OwnerGUID | InvitedByGUID");

            var eventNameLength = packet.ReadBits("EventNameLength", 8);
            packet.ResetBitReader();

            packet.ReadWoWString("EventName", eventNameLength);
        }
 public static void HandleCalendarEventInvite(Packet packet)
 {
     packet.ReadPackedGuid128("InviteGUID");
     packet.ReadUInt64("EventID");
     packet.ReadUInt64("InviteID");
     packet.ReadByte("Level");
     packet.ReadByteE<CalendarEventStatus>("Status");
     packet.ReadByteE<CalendarEventType>("Type");
     packet.ReadPackedTime("ResponseTime");
     packet.ReadBit("ClearPending");
 }
        public static void HandleAuctionCommandResult(Packet packet)
        {
            packet.ReadUInt32("AuctionItemID");
            packet.ReadUInt32E<AuctionHouseAction>("Command");
            packet.ReadUInt32E<AuctionHouseError>("ErrorCode");
            packet.ReadUInt32("BagResult");
            packet.ReadPackedGuid128("Guid");

            // One of the following is MinIncrement and the other is Money, order still unknown
            packet.ReadUInt64("MinIncrement");
            packet.ReadUInt64("Money");
        }
 public static void ReadBlackMarketItem(Packet packet, params object[] idx)
 {
     packet.ReadInt32("MarketID", idx);
     packet.ReadInt32<UnitId>("SellerNPC", idx);
     ItemHandler.ReadItemInstance(packet, "Item", idx);
     packet.ReadInt32("Quantity", idx);
     packet.ReadUInt64("MinBid", idx);
     packet.ReadUInt64("MinIncrement", idx);
     packet.ReadUInt64("CurrentBid", idx);
     packet.ReadInt32("SecondsRemaining", idx);
     packet.ReadInt32("NumBids", idx);
     packet.ReadBit("HighBid", idx);
     packet.ResetBitReader();
 }
Example #7
0
 public static void HandleTokenConfirmBuyToken(Packet packet)
 {
     packet.ReadUInt32("UnkInt32");
     packet.ReadUInt32("PendingBuyConfirmations");
     packet.ReadUInt64("GuaranteedPrice");
     packet.ReadBit("Confirmed");
 }
        public static void HandleAllAchievementData422(Packet packet)
        {
            var count1 = packet.ReadUInt32("Count1");
            for (var i = 0; i < count1; ++i)
                packet.ReadBits("Flag", 2, 0, i);

            for (var i = 0; i < count1; ++i)
                packet.ReadUInt64("Counter", 0, i);

            var count2 = packet.ReadUInt32("Count2");
            for (var i = 0; i < count2; ++i)
                packet.ReadPackedTime("Achievement Time", 1, i);

            for (var i = 0; i < count1; ++i)
                packet.ReadGuid("Player GUID", 0, i);

            for (var i = 0; i < count1; ++i)
                packet.ReadPackedTime("Criteria Time", 0, i);

            for (var i = 0; i < count1; ++i)
                packet.ReadUInt32("Timer 1", 0, i);

            for (var i = 0; i < count2; ++i)
                packet.ReadUInt32("Achievement Id", 1, i);

            for (var i = 0; i < count1; ++i)
                packet.ReadUInt32("Criteria Id", 0, i);

            for (var i = 0; i < count1; ++i)
                packet.ReadUInt32("Timer 2", 0, i);
        }
 public static void HandleBlackMarketBidOnItem(Packet packet)
 {
     packet.ReadPackedGuid128("NpcGUID");
     packet.ReadInt32("MarketID");
     packet.ReadUInt64("BidAmount");
     V6_0_2_19033.Parsers.ItemHandler.ReadItemInstance(packet, "Item");
 }
 public static void HandleBlackMarketBidOnItem(Packet packet)
 {
     packet.ReadPackedGuid128("NpcGUID");
     packet.ReadInt32("MarketID");
     ItemHandler.ReadItemInstance(packet);
     packet.ReadUInt64("BidAmount");
 }
 public static void HandleCalendarEventInviteModeratorStatus(Packet packet)
 {
     packet.ReadPackedGuid128("InviteGUID");
     packet.ReadUInt64("EventID");
     packet.ReadByteE<CalendarModerationRank>("Status"); // enum NC
     packet.ReadBit("ClearPending");
 }
        public static void HandleAllAchievementData406(Packet packet)
        {
            var achievements = packet.ReadUInt32("Achievement count");
            var criterias = packet.ReadUInt32("Criterias count");

            for (var i = 0; i < achievements; ++i)
                packet.ReadUInt32("Achievement Id", i);

            for (var i = 0; i < achievements; ++i)
                packet.ReadPackedTime("Achievement Time", i);

            for (var i = 0; i < criterias; ++i)
                packet.ReadUInt64("Counter", i);

            for (var i = 0; i < criterias; ++i)
                packet.ReadUInt32("Criteria Timer 1", i);

            for (var i = 0; i < criterias; ++i)
                packet.ReadPackedTime("Criteria Time", i);

            for (var i = 0; i < criterias; ++i)
                packet.ReadGuid("Player GUID", i);

            for (var i = 0; i < criterias; ++i)
                packet.ReadUInt32("Criteria Timer 2", i);

            for (var i = 0; i < criterias; ++i)
                packet.ReadBits("Flag", 2, i);

            for (var i = 0; i < criterias; ++i)
                packet.ReadUInt32("Criteria Id", i);
        }
        public static void HandleEquipmentSetList(Packet packet)
        {
            var count = packet.ReadInt32("Count");

            for (var i = 0; i < count; i++)
            {
                packet.ReadInt32("Type", i);
                packet.ReadUInt64("Guid", i);
                packet.ReadUInt32("SetID", i);
                uint ignoreMask = packet.ReadUInt32("IgnoreMask");

                for (var j = 0; j < NumSlots; j++)
                {
                    bool ignore = (ignoreMask & (1 << j)) != 0;
                    packet.ReadPackedGuid128("Pieces" + (ignore ? " (Ignored)" : ""), i, j);
                    packet.ReadInt32("Appearances", i);
                }

                for (var j = 0; j < 2; j++)
                    packet.ReadInt32("Enchants", i);

                packet.ResetBitReader();
                var setNameLen = packet.ReadBits(8);
                var setIconLen = packet.ReadBits(9);

                packet.ReadWoWString("SetName", setNameLen, i);
                packet.ReadWoWString("SetIcon", setIconLen, i);
            }
        }
Example #14
0
 public static void HandleGuildBankDepositMoney(Packet packet)
 {
     packet.ReadGuid("GUID");
     if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
         packet.ReadUInt64("Money");
     else
         packet.ReadUInt32("Money");
 }
Example #15
0
 public static void HandleConirmRedeemToken(Packet packet)
 {
     packet.ReadUInt32("UnkInt32");
     packet.ReadUInt64("Count");
     packet.ReadPackedGuid128("TokenGuid");
     packet.ReadUInt32("UnkInt32");
     packet.ReadBit("Confirm");
 }
        public static void HandleCalendarEventInviteNotesAlert(Packet packet)
        {
            packet.ReadUInt64("EventID");

            var notesLength = packet.ReadBits(8);
            packet.ResetBitReader();

            packet.ReadWoWString("Notes", notesLength);
        }
Example #17
0
        public static void HandleGuildBankDepositMoney(Packet packet)
        {
            packet.ReadUInt64("Money");

            var guid = packet.StartBitStream(2, 7, 6, 4, 0, 1, 5, 3);
            packet.ParseBitStream(guid, 1, 4, 5, 0, 2, 7, 6, 3);

            packet.WriteGuid("Guid", guid);
        }
        public static void HandleBlackMarketRequestItemsResult(Packet packet)
        {
            packet.ReadTime("LastUpdateID");
            var count = packet.ReadInt32("ItemsCount");

            for (int i = 0; i < count; i++)
            {
                packet.ReadInt32("MarketID", i);
                packet.ReadInt32("SellerNPC", i);
                ItemHandler.ReadItemInstance(packet, i);
                packet.ReadInt32("Quantity", i);
                packet.ReadUInt64("MinBid", i);
                packet.ReadUInt64("MinIncrement", i);
                packet.ReadUInt64("CurrentBid", i);
                packet.ReadInt32("SecondsRemaining", i);
                packet.ReadBit("HighBid", i);
                packet.ReadInt32("NumBids", i);
            }
        }
        public static void HandleCalendarEventInviteNotes(Packet packet)
        {
            packet.ReadPackedGuid128("InviteGUID");
            packet.ReadUInt64("EventID");

            var notesLength = packet.ReadBits(8);
            packet.ReadBit("ClearPending");
            packet.ResetBitReader();

            packet.ReadWoWString("Notes", notesLength);
        }
Example #20
0
 public static void HandleShowTaxiNodes(Packet packet)
 {
     var u = packet.ReadUInt32("Unk UInt32 1");
     if (u != 0)
     {
         packet.ReadGuid("GUID");
         packet.ReadUInt32("Node ID");
     }
     var i = 0;
     while (packet.CanRead())
         packet.ReadUInt64("NodeMask", i++);
 }
        public static void ReadCriteriaProgress(Packet packet, params object[] idx)
        {
            packet.ReadInt32("Id", idx);
            packet.ReadUInt64("Quantity", idx);
            packet.ReadPackedGuid128("Player", idx);
            packet.ReadPackedTime("Date", idx);
            packet.ReadTime("TimeFromStart", idx);
            packet.ReadTime("TimeFromCreate", idx);

            packet.ResetBitReader();
            packet.ReadBits("Flags", 4, idx); // some flag... & 1 -> delete
        }
Example #22
0
        public static void HandleInspectTalent(Packet packet)
        {
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
                packet.ReadGuid("GUID");
            else
                packet.ReadPackedGuid("GUID");

            if (packet.Opcode == Opcodes.GetOpcode(Opcode.SMSG_INSPECT_TALENT))
                ReadTalentInfo(ref packet);

            var slotMask = packet.ReadUInt32("Slot Mask");
            var slot = 0;
            while (slotMask > 0)
            {
                if ((slotMask & 0x1) > 0)
                {
                    var name = "[" + (EquipmentSlotType)slot + "] ";
                    packet.ReadEntryWithName<UInt32>(StoreNameType.Item, name + "Item Entry");
                    var enchantMask = packet.ReadUInt16();
                    if (enchantMask > 0)
                    {
                        var enchantName = name + "Item Enchantments: ";
                        while (enchantMask > 0)
                        {
                            if ((enchantMask & 0x1) > 0)
                            {
                                enchantName += packet.ReadUInt16();
                                if (enchantMask > 1)
                                        enchantName += ", ";
                            }
                            enchantMask >>= 1;
                        }
                        packet.WriteLine(enchantName);
                    }
                    packet.ReadUInt16(name + "Unk Uint16");
                    packet.ReadPackedGuid(name + "Creator GUID");
                    packet.ReadUInt32(name + "Unk Uint32");
                }
                ++slot;
                slotMask >>= 1;
            }

            if (packet.Opcode == Opcodes.GetOpcode(Opcode.SMSG_INSPECT_TALENT)
                && packet.CanRead()) // otherwise it would fail for players without a guild
            {
                packet.ReadGuid("Guild GUID");
                packet.ReadUInt32("Guild Level");
                packet.ReadUInt64("Guild Xp");
                packet.ReadUInt32("Guild Members");
            }
        }
Example #23
0
        public static void HandleGuildBankList(Packet packet)
        {
            packet.ReadUInt64("Money");
            packet.ReadInt32("Tab");
            packet.ReadInt32("WithdrawalsRemaining");

            var int36 = packet.ReadInt32("TabInfoCount");
            var int16 = packet.ReadInt32("ItemInfoCount");

            for (int i = 0; i < int36; i++)
            {
                packet.ReadInt32("TabIndex", i);

                packet.ResetBitReader();

                var bits1 = packet.ReadBits(7);
                var bits69 = packet.ReadBits(9);

                packet.ReadWoWString("Name", bits1, i);
                packet.ReadWoWString("Icon", bits69, i);
            }

            for (int i = 0; i < int16; i++)
            {
                packet.ReadInt32("Slot", i);
                ItemHandler.ReadItemInstance(packet, i);

                packet.ReadInt32("Count", i);
                packet.ReadInt32("EnchantmentID", i);
                packet.ReadInt32("Charges", i);
                packet.ReadInt32("OnUseEnchantmentID", i);
                var int76 = packet.ReadInt32("SocketEnchant", i);
                packet.ReadInt32("Flags", i);

                for (int j = 0; j < int76; j++)
                {
                    packet.ReadInt32("SocketIndex", i, j);
                    packet.ReadInt32("SocketEnchantID", i, j);
                }

                packet.ResetBitReader();
                packet.ReadBit("Locked");
            }

            packet.ResetBitReader();
            packet.ReadBit("FullUpdate");
        }
 public static void HandleRaidInstanceInfo(Packet packet)
 {
     var counter = packet.ReadInt32("Counter");
     for (var i = 0; i < counter; ++i)
     {
         packet.ReadEntry<Int32>(StoreNameType.Map, "Map ID", i);
         packet.ReadEnum<MapDifficulty>("Map Difficulty", TypeCode.UInt32, i);
         if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
             packet.ReadUInt32("Heroic", i);
         //packet.ReadGuid("Instance GUID", i);
         packet.ReadUInt64("InstanceGUID");
         packet.ReadBoolean("Expired", i);
         packet.ReadBoolean("Extended", i);
         packet.ReadUInt32("Reset Time", i);
         packet.ReadUInt32("Completed Encounters Mask", i);
     }
 }
        public static void HandleInspectTalent(Packet packet)
        {
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
                packet.ReadGuid("GUID");
            else
                packet.ReadPackedGuid("GUID");

            ReadTalentInfo(ref packet);
            ReadInspectPart(ref packet);

            if (packet.CanRead()) // otherwise it would fail for players without a guild
            {
                packet.ReadGuid("Guild GUID");
                packet.ReadUInt32("Guild Level");
                packet.ReadUInt64("Guild Xp");
                packet.ReadUInt32("Guild Members");
            }
        }
Example #26
0
        public static void HandleGuildBankList(Packet packet)
        {
            packet.ReadUInt64("Money");
            var tabId = packet.ReadByte("Tab Id");
            packet.ReadInt32("Remaining Withdraw");
            if (packet.ReadBool("Full Slot List") && tabId == 0)
            {
                var size = packet.ReadByte("Number of Tabs");
                for (var i = 0; i < size; i++)
                {
                    packet.ReadCString("Tab Name", i);
                    packet.ReadCString("Tab Icon", i);
                }
            }

            var slots = packet.ReadByte("Number of Slots");
            for (var i = 0; i < slots; i++)
            {
                packet.ReadByte("Slot Id", i);
                var entry = packet.ReadInt32<ItemId>("Item Entry", i);
                if (entry > 0)
                {
                    packet.ReadUInt32E<UnknownFlags>("Unk mask", i);
                    var ramdonEnchant = packet.ReadInt32("Random Item Property Id", i);
                    if (ramdonEnchant != 0)
                        packet.ReadUInt32("Item Suffix Factor", i);
                    packet.ReadUInt32("Stack Count", i);
                    packet.ReadUInt32("Unk Uint32 2", i); // Only seen 0
                    packet.ReadByte("Spell Charges", i);
                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
                    {
                        packet.ReadInt32("Unk 1 Int32", i);
                        packet.ReadInt32("Unk 2 Int32", i);
                    }

                    var enchantment = packet.ReadByte("Number of Enchantments", i);
                    for (var j = 0; j < enchantment; j++)
                    {
                        packet.ReadByte("Enchantment Slot Id", i, j);
                        packet.ReadUInt32("Enchantment Id", i, j);
                    }
                }
            }
        }
        public static void HandleEquipmentSetSave(Packet packet)
        {
            packet.ReadUInt64("Set Guid");
            packet.ReadInt32("Set ID");
            int ignoreMask = packet.ReadInt32("IgnoreMask");

            for (var i = 0; i < NumSlots; i++)
            {
                bool ignore = (ignoreMask & (1 << i)) != 0;
                packet.ReadPackedGuid128("Item Guid" + (ignore ? " (Ignored)" : ""), i);
            }

            packet.ResetBitReader();
            var bits12 = packet.ReadBits(8);
            var bits141 = packet.ReadBits(9);

            packet.ReadWoWString("Set Name", bits12);
            packet.ReadWoWString("Set Icon", bits141);
        }
Example #28
0
        public static void HandleGuildBankList(Packet packet)
        {
            packet.ReadUInt64("Money");
            var tabId = packet.ReadByte("Tab Id");
            packet.ReadInt32("Remaining Withdraw");
            if (packet.ReadBoolean("Full Slot List") && tabId == 0)
            {
                var size = packet.ReadByte("Number of Tabs");
                for (var i = 0; i < size; i++)
                {
                    packet.ReadCString("Tab Name", i);
                    packet.ReadCString("Tab Icon", i);
                }
            }

            var slots = packet.ReadByte("Number of Slots");
            for (var i = 0; i < slots; i++)
            {
                packet.ReadByte("Slot Id", i);
                var entry = packet.ReadEntryWithName<Int32>(StoreNameType.Item, "Item Entry", i);
                if (entry > 0)
                {
                    packet.ReadEnum<ItemFlag>("Item Flags?", TypeCode.UInt32, i);
                    var ramdonEnchant = packet.ReadInt32("Random Item Property Id", i);
                    if (ramdonEnchant != 0)
                        packet.ReadUInt32("Item Suffix Factor", i);
                    packet.ReadUInt32("Stack Count", i);
                    packet.ReadUInt32("Unk Uint32 2", i); // Only seen 0
                    packet.ReadByte("Spell Charges", i);
                    var enchantment = packet.ReadByte("Number of Enchantments", i);
                    for (var j = 0; j < enchantment; j++)
                    {
                        packet.ReadByte("Enchantment Slot Id", i, j);
                        packet.ReadUInt32("Enchantment Id", i, j);
                    }
                }
            }
        }
        public static void HandleDisplayToast(Packet packet)
        {
            packet.ReadUInt64("Quantity");

            packet.ReadByte("DisplayToastMethod");
            packet.ReadUInt32("QuestID");

            packet.ResetBitReader();

            packet.ReadBit("Mailed");

            var type = packet.ReadBits("Type", 2);
            if (type == 0)
            {
                packet.ReadBit("BonusRoll");
                V6_0_2_19033.Parsers.ItemHandler.ReadItemInstance(packet);
                packet.ReadInt32("SpecializationID");
                packet.ReadInt32("ItemQuantity?");
            }

            if (type == 1)
                packet.ReadInt32("CurrencyID");
        }
        public static void HandleEquipmentSetList(Packet packet)
        {
            var count = packet.ReadInt32("Count");

            for (var i = 0; i < count; i++)
            {
                packet.ReadUInt64("Set Guid", i);
                packet.ReadInt32("Set ID", i);
                int ignoreMask = packet.ReadInt32("IgnoreMask");

                for (var j = 0; j < NumSlots; j++)
                {
                    bool ignore = (ignoreMask & (1 << j)) != 0;
                    packet.ReadPackedGuid128("Item Guid" + (ignore ? " (Ignored)" : ""), i, j);
                }

                packet.ResetBitReader();
                var bits12 = packet.ReadBits(8);
                var bits141 = packet.ReadBits(9);

                packet.ReadWoWString("Set Name", bits12, i);
                packet.ReadWoWString("Set Icon", bits141, i);
            }
        }