public static void HandleDestroyObject(Packet packet)
        {
            packet.ReadGuid("GUID");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
                packet.ReadBoolean("Despawn Animation");
        }
 public static void HandleBotDetected(Packet packet)
 {
     packet.ReadBoolean("Glider 1 Detected");
     packet.ReadBoolean("Glider 2 Detected");
     packet.ReadBoolean("Inner Space Detected");
     packet.ReadBytes(20); // Hash
 }
        public static void HandleInstanceLockWarningQuery(Packet packet)
        {
            packet.ReadInt32("Time");
            packet.ReadInt32("Encounters Completed Mask");
            packet.ReadBoolean("Extending");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623)) // guessing
                packet.ReadBoolean("Locked warning"); // Displays a window asking if the player choose to join an instance which is saved.
        }
        public static void HandleServerAddonsList(Packet packet)
        {
            // This packet requires _addonCount from CMSG_AUTH_SESSION to be parsed.
            if (_addonCount == -1)
            {
                packet.WriteLine("CMSG_AUTH_SESSION was not received - cannot successfully parse this packet.");
                packet.ReadToEnd();
                return;
            }

            for (var i = 0; i < _addonCount; i++)
            {
                packet.ReadByte("Addon State", i);

                var sendCrc = packet.ReadBoolean("Use CRC", i);

                if (sendCrc)
                {
                    var usePublicKey = packet.ReadBoolean("Use Public Key", i);

                    if (usePublicKey)
                    {
                        var pubKey = packet.ReadChars(256);
                        packet.Write("[{0}] Public Key: ", i);

                        foreach (var t in pubKey)
                            packet.Write(t.ToString(CultureInfo.InvariantCulture));
                    }

                    packet.ReadInt32("Unk Int32", i);
                }

                if (packet.ReadBoolean("Use URL File", i))
                    packet.ReadCString("Addon URL File", i);
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_8_9464))
            {
                var bannedCount = packet.ReadInt32("Banned Addons Count");

                for (var i = 0; i < bannedCount; i++)
                {
                    packet.ReadInt32("ID", i);

                    var unkStr2 = packet.ReadBytes(16);
                    packet.WriteLine("[{0}] Unk Hash 1: {1}", i, Utilities.ByteArrayToHexString(unkStr2));

                    var unkStr3 = packet.ReadBytes(16);
                    packet.WriteLine("[{0}] Unk Hash 2: {1}", i, Utilities.ByteArrayToHexString(unkStr3));

                    packet.ReadInt32("Unk Int32 3", i);

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
                        packet.ReadInt32("Unk Int32 4", i);
                }
            }
        }
 public static void HandleRaidInstanceMessage(Packet packet)
 {
     var type = packet.ReadEnum<RaidInstanceResetWarning>("Warning Type", TypeCode.Int32);
     packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map Id");
     packet.ReadEnum<MapDifficulty>("Difficulty", TypeCode.Int32);
     packet.ReadInt32("Reset time");
     if (type == RaidInstanceResetWarning.Welcome)
     {
         packet.ReadBoolean("Unk bool");
         packet.ReadBoolean("Is Extended");
     }
 }
        public static void HandleServerAddonsList(Packet packet)
        {
            for (var i = 0; i < _addonCount; i++)
            {
                packet.ReadByte("Addon State");

                var sendCrc = packet.ReadBoolean("Use CRC");

                if (sendCrc)
                {
                    var usePublicKey = packet.ReadBoolean("Use Public Key");

                    if (usePublicKey)
                    {
                        var pubKey = packet.ReadChars(256);
                        packet.Writer.Write("Public Key: ");

                        foreach (var t in pubKey)
                            packet.Writer.Write(t);
                    }

                    packet.ReadInt32("Unk Int32");
                }

                var unkByte2 = packet.ReadBoolean("Use URL File");

                if (!unkByte2)
                    continue;

                packet.ReadCString("Addon URL File");
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_8_9464))
            {
                var bannedCount = packet.ReadInt32("Banned Addons Count");

                for (var i = 0; i < bannedCount; i++)
                {
                    packet.ReadInt32("ID");

                    var unkStr2 = packet.ReadBytes(16);
                    packet.Writer.WriteLine("Unk Hash 1: " + Utilities.ByteArrayToHexString(unkStr2));

                    var unkStr3 = packet.ReadBytes(16);
                    packet.Writer.WriteLine("Unk Hash 2: " + Utilities.ByteArrayToHexString(unkStr3));

                    packet.ReadInt32("Unk Int32 3");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
                        packet.ReadInt32("Unk Int32 4");
                }
            }
        }
Beispiel #7
0
 public static void HandleLfgBootProposalUpdate(Packet packet)
 {
     packet.ReadBoolean("In Progress");
     packet.ReadBoolean("Did Vote");
     packet.ReadBoolean("Vote");
     packet.ReadGuid("Victim GUID");
     packet.ReadInt32("Total Votes");
     packet.ReadInt32("Agree Count");
     packet.ReadInt32("Time Left");
     packet.ReadInt32("Needed Votes");
     packet.ReadCString("Comment");
 }
Beispiel #8
0
        public static void HandleNpcGossip(Packet packet)
        {
            var gossip = new Gossip();

            var guid = packet.ReadGuid("GUID");

            gossip.ObjectType = guid.GetObjectType();
            gossip.ObjectEntry = guid.GetEntry();

            var menuId = packet.ReadUInt32("Menu Id");

            if (ClientVersion.AddedInVersion(ClientType.MistsOfPandaria))
                packet.ReadUInt32("Unk int32");

            var textId = packet.ReadUInt32("Text Id");

            if (guid.GetObjectType() == ObjectType.Unit)
                if (Storage.Objects.ContainsKey(guid))
                        ((Unit) Storage.Objects[guid].Item1).GossipId = menuId;

            var count = packet.ReadUInt32("Amount of Options");

            gossip.GossipOptions = new List<GossipOption>((int) count);
            for (var i = 0; i < count; i++)
            {
                var gossipOption = new GossipOption
                {
                    Index = packet.ReadUInt32("Index", i),
                    OptionIcon = packet.ReadEnum<GossipOptionIcon>("Icon", TypeCode.Byte, i),
                    Box = packet.ReadBoolean("Box", i),
                    RequiredMoney = packet.ReadUInt32("Required money", i),
                    OptionText = packet.ReadCString("Text", i),
                    BoxText = packet.ReadCString("Box Text", i)
                };

                gossip.GossipOptions.Add(gossipOption);
            }
            Storage.Gossips.Add(Tuple.Create(menuId, textId), gossip, packet.TimeSpan);
            packet.AddSniffData(StoreNameType.Gossip, (int)menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));

            var questgossips = packet.ReadUInt32("Amount of Quest gossips");
            for (var i = 0; i < questgossips; i++)
            {
                packet.ReadEntryWithName<UInt32>(StoreNameType.Quest, "Quest ID", i);

                packet.ReadUInt32("Icon", i);
                packet.ReadInt32("Level", i);
                packet.ReadEnum<QuestFlags>("Flags", TypeCode.UInt32, i);
                packet.ReadBoolean("Unk Bool", i);
                packet.ReadCString("Title", i);
            }
        }
 public static void HandleRaidInstanceInfo(Packet packet)
 {
     var counter = packet.ReadInt32("Counter");
     for (var i = 0; i < counter; ++i)
     {
         packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID", i);
         packet.ReadEnum<MapDifficulty>("Map Difficulty", TypeCode.UInt32, i);
         packet.ReadGuid("Instance GUID", i);
         packet.ReadBoolean("Expired", i);
         packet.ReadBoolean("Extended", i);
         packet.ReadUInt32("Reset Time", i);
     }
 }
Beispiel #10
0
 public static void HandleLfgBootProposalUpdate(Packet packet)
 {
     packet.ReadBoolean("In Progress");
     packet.ReadBoolean("Did Vote");
     packet.ReadBoolean("Vote");
     if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545))
         packet.ReadByte("Unk");
     packet.ReadGuid("Victim GUID");
     packet.ReadInt32("Total Votes");
     packet.ReadInt32("Agree Count");
     packet.ReadInt32("Time Left");
     packet.ReadInt32("Needed Votes");
     packet.ReadCString("Comment");
 }
Beispiel #11
0
        public static void HandleNpcGossip(Packet packet)
        {
            var guid = packet.ReadGuid("GUID");
            var menuid = packet.ReadUInt32("Menu id");
            var textid = packet.ReadUInt32("Text id");

            GossipMenu gossip = new GossipMenu
            {
                MenuId = menuid,
                GossipOptions = new List<GossipOption>(),
                NpcTextId = textid
            };

            gossip = Stuffing.Gossips.GetOrAdd(Tuple.Create<uint,uint>(guid.GetEntry(),menuid), gossip);

            var count = packet.ReadUInt32("Amount of Options");

            for (var i = 0; i < count; i++)
            {
                GossipOption opt = new GossipOption
                {
                    Index = packet.ReadUInt32("Index", i),
                    OptionIcon = packet.ReadByte("Icon", i),
                    Box = packet.ReadBoolean("Box", i),
                    RequiredMoney = packet.ReadUInt32("Required money", i),
                    OptionText = packet.ReadCString("Text", i),
                    BoxText = packet.ReadCString("Box Text", i)
                };
                gossip.GossipOptions.Add(opt);
            }

            Stuffing.Gossips.AddOrUpdate(Tuple.Create<uint,uint>(guid.GetEntry(),menuid), gossip, (a,b) =>
            {
                b.GossipOptions = gossip.GossipOptions;
                b.NpcTextId = gossip.NpcTextId;
                return b;
            });

            var questgossips = packet.ReadUInt32("Amount of Quest gossips");
            for (var i = 0; i < questgossips; i++)
            {
                packet.ReadEntryWithName<UInt32>(StoreNameType.Quest, "Quest ID", i);

                packet.ReadUInt32("Icon", i);
                packet.ReadInt32("Level", i);
                packet.ReadEnum<QuestFlags>("Flags", TypeCode.UInt32, i);
                packet.ReadBoolean("Unk Bool", i);
                packet.ReadCString("Title", i);
            }
        }
        public static void HandleGetGMTicket(Packet packet)
        {
            var unk = packet.ReadInt32("Unk UInt32");
            if (unk != 6)
                return;

            packet.ReadInt32("TicketID");
            packet.ReadCString("Description");
            packet.ReadByte("Category");
            packet.ReadSingle("Ticket Age");
            packet.ReadSingle("Oldest Ticket Time");
            packet.ReadSingle("Update Time");
            packet.ReadBoolean("Assigned to GM");
            packet.ReadBoolean("Opened by GM");
        }
        public static void HandleAddCalendarEvent(Packet packet)
        {
            packet.ReadCString("Title");
            packet.ReadCString("Description");
            packet.ReadEnum<CalendarEventType>("Event Type", TypeCode.Byte);
            packet.ReadBoolean("Repeatable");
            packet.ReadInt32("Max Invites");
            packet.ReadEntryWithName<Int32>(StoreNameType.LFGDungeon, "Dungeon ID");
            packet.ReadPackedTime("Event Time");
            packet.ReadPackedTime("Unk PackedTime");

            var flags = packet.ReadEnum<CalendarFlag>("Event Flags", TypeCode.Int32);

            if ((flags & CalendarFlag.WithoutInvites) != 0)
                return;

            var count = packet.ReadInt32("Invite Count");

            if (count <= 0)
                return;

            packet.ReadPackedGuid("Creator GUID");
            packet.ReadEnum<CalendarEventStatus>("Status", TypeCode.Byte);
            packet.ReadEnum<CalendarModerationRank>("Moderation Rank", TypeCode.Byte);
        }
Beispiel #14
0
        public static void HandleLootMoneyNotify(Packet packet)
        {
            packet.ReadUInt32("Gold");

            if (ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing)) // no idea when this was added, doesn't exist in 2.4.1
                packet.ReadBoolean("Solo Loot");
        }
        public static void HandleArenaTeamRoster(Packet packet)
        {
            packet.ReadUInt32("Team Id");
            var unk = packet.ReadByte("Unk Byte");
            var count = packet.ReadUInt32("Member count");
            packet.ReadUInt32("Type");

            for (var i = 0; i < count; i++)
            {
                packet.ReadGuid("[" + i + "] GUID");
                packet.ReadBoolean("[" + i + "] Online");
                packet.ReadCString("[" + i + "] Name");
                packet.ReadUInt32("[" + i + "] Captain");
                packet.ReadByte("[" + i + "] Level");
                packet.ReadByte("[" + i + "] Class");
                packet.ReadUInt32("[" + i + "] Week Games");
                packet.ReadUInt32("[" + i + "] Week Win");
                packet.ReadUInt32("[" + i + "] Seasonal Games");
                packet.ReadUInt32("[" + i + "] Seasonal Wins");
                packet.ReadUInt32("[" + i + "] Personal Rating");
                if (unk > 0)
                {
                    packet.ReadSingle("[" + i + "] Unk float 1");
                    packet.ReadSingle("[" + i + "] Unk float 2");
                }

            }
        }
        public static void HandleArenaTeamRoster(Packet packet)
        {
            packet.ReadUInt32("Team Id");
            var unk = packet.ReadByte("Unk Byte");
            var count = packet.ReadUInt32("Member count");
            packet.ReadUInt32("Type");

            for (var i = 0; i < count; i++)
            {
                packet.ReadGuid(" GUID", i);
                packet.ReadBoolean("Online", i);
                packet.ReadCString("Name", i);
                packet.ReadUInt32("Captain", i);
                packet.ReadByte("Level", i);
                packet.ReadByte("Class", i);
                packet.ReadUInt32("Week Games", i);
                packet.ReadUInt32("Week Win", i);
                packet.ReadUInt32("Seasonal Games", i);
                packet.ReadUInt32("Seasonal Wins", i);
                packet.ReadUInt32("Personal Rating", i);
                if (unk > 0)
                {
                    packet.ReadSingle("Unk float 1", i);
                    packet.ReadSingle("Unk float 2", i);
                }
            }
        }
Beispiel #17
0
        public static void HandleUpdateObject(Packet packet)
        {
            uint map = MovementHandler.CurrentMapId;
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_1_13164))
                map = packet.ReadUInt16("Map");

            var count = packet.ReadUInt32("Count");

            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_2_9056))
                packet.ReadBoolean("Has Transport");

            for (var i = 0; i < count; i++)
            {
                var type = packet.ReadByte();
                var typeString = ClientVersion.AddedInVersion(ClientType.Cataclysm) ? ((UpdateTypeCataclysm)type).ToString() : ((UpdateType)type).ToString();

                packet.WriteLine("[" + i + "] UpdateType: " + typeString);
                switch (typeString)
                {
                    case "Values":
                    {
                        var guid = packet.ReadPackedGuid("GUID", i);

                        WoWObject obj;
                        var updates = ReadValuesUpdateBlock(ref packet, guid.GetObjectType(), i, false);

                        if (Storage.Objects.TryGetValue(guid, out obj))
                        {
                            if (obj.ChangedUpdateFieldsList == null)
                                obj.ChangedUpdateFieldsList = new List<Dictionary<int, UpdateField>>();
                            obj.ChangedUpdateFieldsList.Add(updates);
                        }

                        break;
                    }
                    case "Movement":
                    {
                        var guid = ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_2_9901) ? packet.ReadPackedGuid("GUID", i) : packet.ReadGuid("GUID", i);
                        ReadMovementUpdateBlock(ref packet, guid, i);
                        // Should we update Storage.Object?
                        break;
                    }
                    case "CreateObject1":
                    case "CreateObject2": // Might != CreateObject1 on Cata
                    {
                        var guid = packet.ReadPackedGuid("GUID", i);
                        ReadCreateObjectBlock(ref packet, guid, map, i);
                        break;
                    }
                    case "FarObjects":
                    case "NearObjects":
                    case "DestroyObjects":
                    {
                        ReadObjectsBlock(ref packet, i);
                        break;
                    }
                }
            }
        }
        public static void HandleCharEnum(Packet packet)
        {
            var count = packet.ReadByte("Count");

            for (var i = 0; i < count; i++)
            {
                var guid = packet.ReadGuid("GUID");
                var name = packet.ReadCString("Name");
                var race = packet.ReadEnum<Race>("Race", TypeCode.Byte);
                var clss = packet.ReadEnum<Class>("Class", TypeCode.Byte);
                packet.ReadEnum<Gender>("Gender", TypeCode.Byte);

                packet.ReadByte("Skin");
                packet.ReadByte("Face");
                packet.ReadByte("Hair Style");
                packet.ReadByte("Hair Color");
                packet.ReadByte("Facial Hair");

                var level = packet.ReadByte("Level");
                var zone = packet.ReadEntryWithName<UInt32>(StoreNameType.Zone, "Zone Id");
                var mapId = packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map Id");

                var pos = packet.ReadVector3("Position");
                packet.ReadInt32("Guild Id");
                packet.ReadEnum<CharacterFlag>("Character Flags", TypeCode.Int32);

                if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
                    packet.ReadEnum<CustomizationFlag>("Customization Flags", TypeCode.Int32);

                var firstLogin = packet.ReadBoolean("First Login");
                packet.ReadInt32("Pet Display Id");
                packet.ReadInt32("Pet Level");
                packet.ReadEnum<CreatureFamily>("Pet Family", TypeCode.Int32);

                for (var j = 0; j < 19; j++)
                {
                    packet.ReadInt32("Equip Display Id");
                    packet.ReadEnum<InventoryType>("Equip Inventory Type", TypeCode.Byte);
                    packet.ReadInt32("Equip Aura Id");
                }

                int bagCount = ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685) ? 4 : 1;
                for (var j = 0; j < bagCount; j++)
                {
                    packet.ReadInt32("Bag Display Id");
                    packet.ReadEnum<InventoryType>("Bag Inventory Type", TypeCode.Byte);
                    packet.ReadInt32("Bag Aura Id");
                }

                if (firstLogin)
                {
                    var startPos = new StartPosition {Map = mapId, Position = pos, Zone = zone};
                    packet.SniffFileInfo.Storage.StartPositions.TryAdd(new Tuple<Race, Class>(race, clss), startPos);
                }

                var playerInfo = new Player {Race = race, Class = clss, Name = name, FirstLogin = firstLogin, Level = level};
                packet.SniffFileInfo.Storage.Objects.AddOrUpdate(guid, playerInfo);
            }
        }
        public static void HandleServerAddonsList(Packet packet)
        {
            // This packet requires _addonCount from CMSG_AUTH_SESSION to be parsed.
            if (_addonCount == -1)
            {
                packet.AddValue("Error", "CMSG_AUTH_SESSION was not received - cannot successfully parse this packet.");
                packet.ReadToEnd();
                return;
            }

            for (var i = 0; i < _addonCount; i++)
            {
                packet.ReadByte("Addon State", i);

                var sendCrc = packet.ReadBoolean("Use CRC", i);

                if (sendCrc)
                {
                    var usePublicKey = packet.ReadBoolean("Use Public Key", i);

                    if (usePublicKey)
                        packet.ReadBytes("Name MD5", 256);

                    packet.ReadInt32("Unk Int32", i);
                }

                if (packet.ReadBoolean("Use URL File", i))
                    packet.ReadCString("Addon URL File", i);
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_8_9464))
            {
                var bannedCount = packet.ReadInt32("Banned Addons Count");

                for (var i = 0; i < bannedCount; i++)
                {
                    packet.ReadInt32("ID", i);
                    packet.ReadBytes("Name MD5", 16);
                    packet.ReadBytes("Version MD5", 16);
                    packet.ReadTime("Time", i);

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
                        packet.ReadInt32("Is banned", i);
                }
            }
        }
        public static void HandleChannelJoin(Packet packet)
        {
            packet.ReadInt32("Channel Id");
            packet.ReadBoolean("Has Voice");
            packet.ReadBoolean("Joined by zone update");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_1_13164))
            {
                packet.ReadCString("Channel Pass");
                packet.ReadCString("Channel Name");
            }
            else
            {
                packet.ReadCString("Channel Name");
                packet.ReadCString("Channel Pass");
            }
        }
 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 HandleNpcGossip(Packet packet)
        {
            var gossip = new Gossip();

            var guid = packet.ReadGuid("GUID"); // TODO: Use this to assign npc entries with gossip ids

            gossip.ObjectType = guid.GetObjectType();
            gossip.ObjectEntry = guid.GetEntry();

            var menuId = packet.ReadUInt32("Menu Id");
            var textId = packet.ReadUInt32("Text Id");

            var count = packet.ReadUInt32("Amount of Options");

            gossip.GossipOptions = new List<GossipOption>((int) count);
            for (var i = 0; i < count; i++)
            {
                var gossipOption = new GossipOption();

                gossipOption.Index = packet.ReadUInt32("Index", i);
                gossipOption.OptionIcon = packet.ReadByte("Icon", i);
                gossipOption.Box = packet.ReadBoolean("Box", i);
                gossipOption.RequiredMoney = packet.ReadUInt32("Required money", i);
                gossipOption.OptionText = packet.ReadCString("Text", i);
                gossipOption.BoxText = packet.ReadCString("Box Text", i);

                gossip.GossipOptions.Add(gossipOption);
            }

            packet.AddSniffData(StoreNameType.Gossip, (int)menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));

            Storage.Gossips.TryAdd(new Tuple<uint, uint>(menuId, textId), gossip);

            var questgossips = packet.ReadUInt32("Amount of Quest gossips");
            for (var i = 0; i < questgossips; i++)
            {
                packet.ReadEntryWithName<UInt32>(StoreNameType.Quest, "Quest ID", i);

                packet.ReadUInt32("Icon", i);
                packet.ReadInt32("Level", i);
                packet.ReadEnum<QuestFlags>("Flags", TypeCode.UInt32, i);
                packet.ReadBoolean("Unk Bool", i);
                packet.ReadCString("Title", i);
            }
        }
        public static void HandleAuctionHello(Packet packet)
        {
            packet.ReadGuid("GUID");
            if (packet.Direction == Direction.ClientToServer)
                return;

            packet.ReadUInt32("AuctionHouse ID");
            packet.ReadBoolean("Enabled");
        }
        public static void HandleLootMoneyNotify(Packet packet)
        {
            packet.ReadUInt32("Gold");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
                packet.ReadUInt32("Guild Gold");

            if (ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing)) // no idea when this was added, doesn't exist in 2.4.1
                packet.ReadBoolean("Solo Loot"); // true = YOU_LOOT_MONEY, false = LOOT_MONEY_SPLIT
        }
 public static void HandleComplain(Packet packet)
 {
     packet.ReadBoolean("Unk bool");
     packet.ReadGuid("Guid");
     packet.ReadInt32("Unk Int32");
     packet.ReadInt32("Unk Int32");
     packet.ReadInt32("Unk Int32");
     packet.ReadInt32("Unk Int32");
     packet.ReadCString("Complain");
 }
 public static void HandleGMTicketCreate(Packet packet)
 {
     packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
     var vector = packet.ReadVector3();
     packet.Writer.WriteLine("Position: {0}", vector);
     packet.ReadCString("Text");
     packet.ReadUInt32("Unk UInt32 1");
     packet.ReadBoolean("Need Response");
     // FIXME: 3.3.3a has many more data here..
 }
        public static void HandleAuctionHello(Packet packet)
        {
            packet.ReadGuid("GUID");
            if (packet.Direction == Direction.ClientToServer)
                return;

            packet.ReadUInt32("AuctionHouse ID");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_0_10958))
                packet.ReadBoolean("Enabled");
        }
        public static void HandleGetGMTicket(Packet packet)
        {
            var unk = packet.ReadInt32("Unk UInt32");
            if (unk != 6)
                return;

            packet.ReadInt32("TicketID");
            packet.ReadCString("Description");
            packet.ReadByte("Category");
            packet.ReadSingle("Ticket Age");
            packet.ReadSingle("Oldest Ticket Time");
            packet.ReadSingle("Update Time");
            packet.ReadBoolean("Assigned to GM");
            packet.ReadBoolean("Opened by GM");
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_3_4_15595))
            {
                packet.ReadCString("Average wait time Text");
                packet.ReadUInt32("Average wait time");
            }
        }
Beispiel #29
0
        public static void HandleGetGMTicket(Packet packet)
        {
            var ticketStatus = packet.ReadEnum<GMTicketStatus>("TicketStatus", TypeCode.Int32);
            if (ticketStatus != GMTicketStatus.HasText)
                return;

            packet.ReadInt32("TicketID");
            packet.ReadCString("Description");
            packet.ReadByte("Category");
            packet.ReadSingle("Ticket Age");
            packet.ReadSingle("Oldest Ticket Time");
            packet.ReadSingle("Update Time");
            packet.ReadBoolean("Assigned to GM");
            packet.ReadBoolean("Opened by GM");
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_3_4_15595))
            {
                packet.ReadCString("Average wait time Text");
                packet.ReadUInt32("Average wait time");
            }
        }
Beispiel #30
0
        public static void HandleGroupInviteResponse(Packet packet)
        {
            packet.ReadBoolean("invited/already in group flag?");
            packet.ReadCString("Name");
            packet.ReadInt32("Unk Int32 1");
            var count = packet.ReadByte("Count");
            for (var i = 0; i < count; ++i)
                packet.ReadUInt32("Unk Uint32", i);

            packet.ReadInt32("Unk Int32 2");
        }
        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);
        }