Beispiel #1
1
 public static void HandleActivateTaxiExpress(Packet packet)
 {
     packet.ReadGuid("GUID");
     var count = packet.ReadUInt32("Node Count");
     for (var i = 0; i < count; ++i)
         packet.ReadUInt32("Node ID", i);
 }
 public static void HandleArenaTeamCommandResult(Packet packet)
 {
     packet.ReadUInt32("Action"); // FIXME: Use enum
     packet.ReadCString("Team Name");
     packet.ReadCString("Player Name");
     packet.ReadUInt32("ErrorId"); // FIXME: Use enum
 }
 public static void HandleArchaelogySurveryCast(Packet packet)
 {
     packet.ReadUInt32("TotalFinds");
     packet.ReadUInt32("NumFindsCompleted");
     packet.ReadInt32("ResearchBranchID");
     packet.ReadBit("SuccessfulFind");
 }
        public static void HandleInitCurrency(Packet packet)
        {
            var count = packet.ReadInt32("SetupCurrencyRecord");

            // ClientSetupCurrencyRecord
            for (var i = 0; i < count; ++i)
            {
                packet.ReadUInt32("Type", i);
                packet.ReadUInt32("Quantity", i);

                var hasWeeklyQuantity = packet.ReadBit();
                var hasMaxWeeklyQuantity = packet.ReadBit();
                var hasTrackedQuantity = packet.ReadBit();
                packet.ReadBits("Flags", 5, i);

                if (hasWeeklyQuantity)
                    packet.ReadUInt32("WeeklyQuantity", i);

                if (hasMaxWeeklyQuantity)
                    packet.ReadUInt32("MaxWeeklyQuantity", i);

                if (hasTrackedQuantity)
                    packet.ReadUInt32("TrackedQuantity", i);
            }
        }
        public static void HandleVendorInventory(Packet packet)
        {
            uint entry = packet.ReadPackedGuid128("VendorGUID").GetEntry();
            packet.ReadByte("Reason");
            int count = packet.ReadInt32("VendorItems");

            for (int i = 0; i < count; ++i)
            {
                NpcVendor vendor = new NpcVendor
                {
                    Entry = entry,
                    Slot = packet.ReadInt32("Muid", i),
                    Type = (uint)packet.ReadInt32("Type", i)
                };

                int maxCount = packet.ReadInt32("Quantity", i);
                packet.ReadInt64("Price", i);
                packet.ReadInt32("Durability", i);
                int buyCount = packet.ReadInt32("StackCount", i);
                vendor.ExtendedCost = packet.ReadUInt32("ExtendedCostID", i);
                vendor.PlayerConditionID = packet.ReadUInt32("PlayerConditionFailed", i);

                vendor.Item = V6_0_2_19033.Parsers.ItemHandler.ReadItemInstance(packet, i);
                vendor.IgnoreFiltering = packet.ReadBit("DoNotFilterOnVendor", i);

                vendor.MaxCount = maxCount == -1 ? 0 : (uint)maxCount; // TDB
                if (vendor.Type == 2)
                    vendor.MaxCount = (uint)buyCount;

                Storage.NpcVendors.Add(vendor, packet.TimeSpan);
            }
        }
 public static void HandleTokenConfirmBuyToken(Packet packet)
 {
     packet.ReadUInt32("UnkInt32");
     packet.ReadUInt32("PendingBuyConfirmations");
     packet.ReadUInt64("GuaranteedPrice");
     packet.ReadBit("Confirmed");
 }
        public static void HandleAuctionListBidderItemsResult(Packet packet)
        {
            var count = packet.ReadUInt32("Count");
            for (var i = 0; i < count; ++i)
            {
                packet.ReadUInt32("Auction Id", i);
                packet.ReadUInt32<ItemId>("Item Entry", i);

                int enchantmentCount = 8;
                for (var j = 0; j < enchantmentCount; ++j)
                {
                    packet.ReadUInt32("Item Enchantment ID", i, j);
                    packet.ReadUInt32("Item Enchantment Duration", i, j);
                    packet.ReadUInt32("Item Enchantment Charges", i, j);
                }

                packet.ReadUInt32("Unk UInt32 1", i);
                packet.ReadInt32("Item Random Property ID", i);
                packet.ReadUInt32("Item Suffix", i);
                packet.ReadUInt32("Item Count", i);
                packet.ReadInt32("Item Spell Charges", i);
                packet.ReadUInt32E<ItemProtoFlags>("Item Flags", i);
                packet.ReadGuid("Owner", i);
                packet.ReadValue("Start Bid", TypeCode.UInt64, i);
                packet.ReadValue("Out Bid", TypeCode.UInt64, i);
                packet.ReadValue("Buyout ", TypeCode.UInt64, i);
                packet.ReadUInt32("Time Left", i);
                packet.ReadGuid("Bidder", i);
                packet.ReadValue("Bid", TypeCode.UInt64, i);
            }

            packet.ReadUInt32("Total item count");
            packet.ReadUInt32("Desired delay time");
        }
        public static void HandleLootResponse(Packet packet)
        {
            packet.ReadPackedGuid128("Owner");
            packet.ReadPackedGuid128("LootObj");
            packet.ReadByteE<LootError>("FailureReason");
            packet.ReadByteE<LootType>("AcquireReason");
            packet.ReadByteE<LootMethod>("LootMethod");
            packet.ReadByteE<ItemQuality>("Threshold");

            packet.ReadUInt32("Coins");

            var itemCount = packet.ReadUInt32("ItemCount");
            var currencyCount = packet.ReadUInt32("CurrencyCount");

            packet.ResetBitReader();

            packet.ReadBit("Acquired");
            packet.ReadBit("AELooting");
            packet.ReadBit("PersonalLooting");

            for (var i = 0; i < itemCount; ++i)
                ReadLootItem(packet, i, "LootItem");

            for (var i = 0; i < currencyCount; ++i)
                V6_0_2_19033.Parsers.LootHandler.ReadCurrenciesData(packet, i, "Currencies");
        }
 public static void HandleServerRealmSplit(Packet packet)
 {
     var len = packet.ReadBits(7);
     packet.ReadWoWString("Split Date", len);
     packet.ReadUInt32("Client State");
     packet.ReadUInt32("Split State");
 }
        public static void HandleAllAchievementData422(Packet packet)
        {
            var criterias = packet.ReadUInt32("Criterias Count");
            for (var i = 0; i < criterias; ++i)
                packet.ReadBits("Flag", 2, 0, i);

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

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

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

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

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

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

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

            for (var i = 0; i < criterias; ++i)
                packet.ReadUInt32("Timer 2", 0, i);
        }
        public static void HandleCalendarSendEvent(Packet packet)
        {
            packet.ReadByte("EventType");
            packet.ReadPackedGuid128("OwnerGUID");
            packet.ReadInt64("EventID");
            packet.ReadByte("GetEventType");
            packet.ReadInt32("TextureID");
            packet.ReadUInt32("Flags");
            packet.ReadUInt32("Date");
            packet.ReadUInt32("LockDate");
            packet.ReadPackedGuid128("EventGuildID");

            var inviteCount = packet.ReadInt32("InviteCount");

            packet.ResetBitReader();

            var lenEventName = packet.ReadBits(8);
            var lenDescription = packet.ReadBits(11);

            packet.ResetBitReader();

            for (int i = 0; i < inviteCount; i++)
                V6_0_2_19033.Parsers.CalendarHandler.ReadCalendarEventInviteInfo(packet, "Invites", i);

            packet.ReadWoWString("EventName", lenEventName);
            packet.ReadWoWString("Description", lenDescription);
        }
        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);
            }
        }
        public static void HandleAreaTriggerReShape(Packet packet)
        {
            packet.ReadPackedGuid128("TriggerGUID");

            packet.ResetBitReader();
            var hasAreaTriggerSpline = packet.ReadBit("HasAreaTriggerSpline");
            var hasAreaTriggerUnkType = packet.ReadBit("HasAreaTriggerUnkType");

            if (hasAreaTriggerSpline)
                ReadAreaTriggerSpline(packet);

            if (hasAreaTriggerUnkType)
            {
                packet.ResetBitReader();
                var unk1 = packet.ReadBit("AreaTriggerUnk1");
                var hasCenter = packet.ReadBit("HasCenter");
                packet.ReadBit("Unk bit 703 1");
                packet.ReadBit("Unk bit 703 2");

                packet.ReadUInt32("Unk UInt 1");
                packet.ReadInt32("Unk Int 1");
                packet.ReadUInt32("Unk UInt 2");
                packet.ReadSingle("Radius");
                packet.ReadSingle("BlendFromRadius");
                packet.ReadSingle("InitialAngel");
                packet.ReadSingle("ZOffset");

                if (unk1)
                    packet.ReadPackedGuid128("AreaTriggerUnkGUID");

                if (hasCenter)
                    packet.ReadVector3("Center");
            }
        }
Beispiel #14
0
        public static void HandleTradeStatusExtended(Packet packet)
        {
            packet.ReadByte("Trader");
            packet.ReadUInt32("Trade Id");
            packet.ReadUInt32("Unk Slot 1");
            packet.ReadUInt32("Unk Slot 2");
            packet.ReadUInt32("Gold");
            packet.ReadEntryWithName<Int32>(StoreNameType.Spell, "Spell ID");

            while (packet.CanRead())
            {
                var slot = packet.ReadByte("Slot Index");
                packet.ReadEntryWithName<UInt32>(StoreNameType.Item, "Item Entry", slot);
                packet.ReadUInt32("Item Display ID", slot);
                packet.ReadUInt32("Item Count", slot);
                packet.ReadUInt32("Item Wrapped", slot);
                packet.ReadUInt64("Item Gift Creator GUID", slot);
                packet.ReadUInt32("Item Perm Enchantment Id", slot);
                for (var i = 0; i < 3; ++i)
                    packet.ReadUInt32("Item Enchantment Id", slot, i);
                packet.ReadGuid("Item Creator GUID", slot);
                packet.ReadInt32("Item Spell Charges", slot);
                packet.ReadInt32("Item Suffix Factor", slot);
                packet.ReadInt32("Item Random Property ID", slot);
                packet.ReadUInt32("Item Lock ID", slot);
                packet.ReadUInt32("Item Max Durability", slot);
                packet.ReadUInt32("Item Durability", slot);
            }
        }
Beispiel #15
0
        public static void HandleItemEnchantTimeUpdate(Packet packet)
        {
            var itemGuid = new byte[8];
            var playerGuid = new byte[8];
            packet.StartBitStream(itemGuid, 2, 4);
            playerGuid[4] = packet.ReadBit();
            itemGuid[5] = packet.ReadBit();
            packet.StartBitStream(playerGuid, 3, 5);
            packet.StartBitStream(itemGuid, 7, 0, 6);
            packet.StartBitStream(playerGuid, 6, 2, 0, 1);
            itemGuid[1] = packet.ReadBit();
            playerGuid[7] = packet.ReadBit();
            itemGuid[3] = packet.ReadBit();
            packet.ResetBitReader();

            packet.ReadXORBytes(playerGuid, 1, 7);
            packet.ReadXORBytes(itemGuid, 4, 7);
            packet.ReadXORByte(playerGuid, 5);
            packet.ReadXORBytes(itemGuid, 1, 2);
            packet.ReadXORBytes(playerGuid, 4, 2, 0);
            packet.ReadXORBytes(itemGuid, 0, 5);
            packet.ReadUInt32("Duration");
            packet.ReadUInt32("Slot");
            packet.ReadXORByte(playerGuid, 3);
            packet.ReadXORBytes(itemGuid, 3, 6);
            packet.ReadXORByte(playerGuid, 6);

            packet.WriteGuid("Player GUID", playerGuid);
            packet.WriteGuid("Item GUID", itemGuid);
        }
Beispiel #16
0
 public static void HandleBuyItemResponse(Packet packet)
 {
     packet.ReadGuid("Vendor GUID");
     packet.ReadUInt32("Slot");
     packet.ReadInt32("New Count");
     packet.ReadUInt32("Count");
 }
        public static void HandleAuctionListBidderResult(Packet packet)
        {
            var count = packet.ReadUInt32("Count");
            for (var i = 0; i < count; ++i)
            {
                packet.ReadUInt32("Auction Id", i);
                packet.ReadEntryWithName<UInt32>(StoreNameType.Item, "Item Entry", i);

                int enchantmentCount = ClientVersion.AddedInVersion(ClientVersionBuild.V4_3_0_15005) ? 10 : ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545) ? 9 : ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing) ? 7 : 6;
                for (var j = 0; j < enchantmentCount; ++j)
                {
                    packet.ReadUInt32("Item Enchantment ID", i, j);
                    packet.ReadUInt32("Item Enchantment Duration", i, j);
                    packet.ReadUInt32("Item Enchantment Charges", i, j);
                }

                packet.ReadInt32("Item Random Property ID", i);
                packet.ReadUInt32("Item Suffix", i);
                packet.ReadUInt32("Item Count", i);
                packet.ReadInt32("Item Spell Charges", i);
                //packet.ReadEnum<ItemFlag>("Item Flags", TypeCode.UInt32, i);
                packet.ReadUInt32("Unk UInt32 1", i);
                packet.ReadGuid("Owner", i);
                packet.ReadValue("Start Bid", _auctionSize, i);
                packet.ReadValue("Out Bid", _auctionSize, i);
                packet.ReadValue("Buyout ", _auctionSize, i);
                packet.ReadUInt32("Time Left", i);
                packet.ReadGuid("Bidder", i);
                packet.ReadValue("Bid", _auctionSize, i);
            }

            packet.ReadUInt32("Own Count");
            packet.ReadUInt32("Unk UInt32 1");
        }
Beispiel #18
0
        public static void HandlePetSpells(Packet packet)
        {
            packet.ReadPackedGuid128("PetGUID");
            packet.ReadInt16("CreatureFamily");
            packet.ReadInt16("Specialization");
            packet.ReadInt32("TimeLimit");

            ReadPetFlags(packet, "PetModeAndOrders");

            const int maxCreatureSpells = 10;
            for (var i = 0; i < maxCreatureSpells; i++) // Read pet / vehicle spell ids
                V6_0_2_19033.Parsers.PetHandler.ReadPetAction(packet, "ActionButtons", i);

            var actionsCount = packet.ReadInt32("ActionsCount");
            var cooldownsCount = packet.ReadUInt32("CooldownsCount");
            var spellHistoryCount = packet.ReadUInt32("SpellHistoryCount");

            for (int i = 0; i < actionsCount; i++)
                V6_0_2_19033.Parsers.PetHandler.ReadPetAction(packet, i, "Actions");

            for (int i = 0; i < cooldownsCount; i++)
                V6_0_2_19033.Parsers.PetHandler.ReadPetSpellCooldownData(packet, i, "PetSpellCooldown");

            for (int i = 0; i < spellHistoryCount; i++)
                V6_0_2_19033.Parsers.PetHandler.ReadPetSpellHistoryData(packet, i, "PetSpellHistory");
        }
        public static void HandleQuestPoiQueryResponse(Packet packet)
        {
            packet.ReadInt32("Count?");

            var count = packet.ReadBits("Count", 20);

            var POIcounter = new uint[count];
            var pointsSize = new uint[count][];

            for (var i = 0; i < count; ++i)
            {
                POIcounter[i] = packet.ReadBits("POI Counter", 18, i);
                pointsSize[i] = new uint[POIcounter[i]];

                for (var j = 0; j < POIcounter[i]; ++j)
                    pointsSize[i][j] = packet.ReadBits("Points Counter", 21, i, j);
            }

            for (var i = 0; i < count; ++i)
            {
                var questPOIs = new List<QuestPOI>();

                for (var j = 0; j < POIcounter[i]; ++j)
                {
                    var questPoi = new QuestPOI();
                    questPoi.Points = new List<QuestPOIPoint>((int)pointsSize[i][j]);

                    for (var k = 0u; k < pointsSize[i][j]; ++k)
                    {
                        var questPoiPoint = new QuestPOIPoint
                        {
                            Index = k,
                            X = packet.ReadInt32("Point X", i, j, (int)k),
                            Y = packet.ReadInt32("Point Y", i, j, (int)k)
                        };
                        questPoi.Points.Add(questPoiPoint);
                    }

                    packet.ReadInt32("Unk Int32 1", i, j);
                    packet.ReadInt32("Unk Int32 2", i, j);
                    packet.ReadInt32("Unk Int32 3", i, j);
                    questPoi.Map = (uint)packet.ReadEntry<UInt32>(StoreNameType.Map, "Map Id", i, j);
                    questPoi.ObjectiveIndex = packet.ReadInt32("Objective Index", i, j);
                    questPoi.WorldMapAreaId = packet.ReadUInt32("World Map Area ID", i, j);
                    packet.ReadInt32("Unk Int32 4", i, j);
                    packet.ReadInt32("World Effect ID", i, j);
                    questPoi.Idx = (uint)packet.ReadInt32("POI Index", i, j);
                    packet.ReadInt32("Player Condition ID", i, j);
                    questPoi.FloorId = packet.ReadUInt32("Floor Id", i, j);

                    questPOIs.Add(questPoi);
                }

                var questId = packet.ReadEntry<Int32>(StoreNameType.Quest, "Quest ID", i);
                packet.ReadInt32("POI Counter?", i);

                foreach (var questpoi in questPOIs)
                    Storage.QuestPOIs.Add(new Tuple<uint, uint>((uint)questId, questpoi.Idx), questpoi, packet.TimeSpan);
            }
        }
 public static void HandleBug(Packet packet)
 {
     packet.ReadUInt32("Suggestion");
     packet.ReadUInt32("Content Lenght");
     packet.ReadCString("Content");
     packet.ReadUInt32("Text Lenght");
     packet.ReadCString("Text");
 }
 public static void HandleLoginSetTimeSpeed(Packet packet)
 {
     packet.ReadPackedTime("Game Time");
     packet.ReadUInt32("bit5");
     packet.ReadUInt32("bit7");
     packet.ReadUInt32("bit6");
     packet.ReadSingle("Game Speed");
 }
Beispiel #22
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 HandleAlterAppearance(Packet packet)
 {
     packet.ReadUInt32("NewHairStyle");
     packet.ReadUInt32("NewHairColor");
     packet.ReadUInt32("NewFacialHair");
     packet.ReadUInt32("NewSkinColor");
     packet.ReadUInt32("NewFace");
 }
Beispiel #24
0
 public static void HandleLootAllPassed(Packet packet)
 {
     packet.ReadGuid("GUID");
     packet.ReadUInt32("Slot");
     packet.ReadUInt32<ItemId>("Entry");
     packet.ReadInt32("Random Property Id");
     packet.ReadInt32("Random Suffix");
 }
Beispiel #25
0
 public static void HandleBuyItem(Packet packet)
 {
     packet.ReadGuid("Vendor GUID");
     packet.ReadUInt32("Item ID");
     packet.ReadUInt32("Slot");
     packet.ReadUInt32("Count");
     packet.ReadByte("Unk");
 }
Beispiel #26
0
 public static void HandleGMResponseReceived(Packet packet)
 {
     packet.ReadUInt32("Response ID");
     packet.ReadUInt32("Ticket ID");
     packet.ReadCString("Description");
     for (var i = 1; i <= 4; i++)
         packet.ReadCString("Response", i);
 }
 public static void HandleAuctionCommandResult(Packet packet)
 {
     packet.ReadUInt32("Auction ID");
     var action = packet.ReadEnum<AuctionHouseAction>("Action", TypeCode.UInt32);
     var error = packet.ReadEnum<AuctionHouseAction>("Error", TypeCode.UInt32);
     if (error == 0 && action > 0)
         packet.ReadUInt32("Bid Error");
 }
Beispiel #28
0
 public static void HandleActivateTaxi(Packet packet)
 {
     packet.ReadUInt32("Node 2 ID"); // 28
     packet.ReadUInt32("Node 1y ID"); // 24
     var guid = packet.StartBitStream(4, 0, 1, 2, 5, 6, 7, 3);
     packet.ReadXORBytes(guid, 1, 0, 6, 5, 2, 4, 3, 7);
     packet.WriteGuid("Guid", guid);
 }
Beispiel #29
0
        public static void HandleActivateTaxiExpress(Packet packet)
        {
            packet.ReadPackedGuid128("Unit");

            var count = packet.ReadUInt32("PathNodesCount");
            for (var i = 0; i < count; ++i)
                packet.ReadUInt32("PathNodes", i);
        }
 public static void HandleGMResponseReceived(Packet packet)
 {
     packet.ReadUInt32("Unk 1");
     packet.ReadUInt32("Unk 2");
     packet.ReadCString("Text");
     for (var i = 1; i <= 4; i++)
         packet.ReadCString("Response", i);
 }
        public T Read <T>()
        {
            var    type = typeof(T).IsEnum ? typeof(T).GetEnumUnderlyingType() : typeof(T);
            object value;

            switch (Type.GetTypeCode(type))
            {
            case TypeCode.Boolean:
                value = Stream.ReadBoolean();
                break;

            case TypeCode.SByte:
                value = Stream.ReadSByte();
                break;

            case TypeCode.Byte:
                value = Stream.ReadByte();
                break;

            case TypeCode.Char:
                value = Stream.ReadChar();
                break;

            case TypeCode.Int16:
                value = Stream.ReadInt16();
                break;

            case TypeCode.UInt16:
                value = Stream.ReadUInt16();
                break;

            case TypeCode.Int32:
                value = Stream.ReadInt32();
                break;

            case TypeCode.UInt32:
                value = Stream.ReadUInt32();
                break;

            case TypeCode.Int64:
                value = Stream.ReadInt64();
                break;

            case TypeCode.UInt64:
                value = Stream.ReadUInt64();
                break;

            case TypeCode.Single:
                value = Stream.ReadSingle();
                break;

            case TypeCode.Double:
                value = Stream.ReadDouble();
                break;

            default:
                throw new InvalidCastException("");
            }

            return((T)value);
        }