当前位置: 首页>>代码示例>>C#>>正文


C# Packet.ReadByte方法代码示例

本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadByte方法的具体用法?C# Packet.ReadByte怎么用?C# Packet.ReadByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WowPacketParser.Misc.Packet的用法示例。


在下文中一共展示了Packet.ReadByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleAuctionListItems

        public static void HandleAuctionListItems(Packet packet)
        {
            packet.ReadInt32("Offset");
            packet.ReadPackedGuid128("Auctioneer");

            packet.ReadByte("MinLevel");
            packet.ReadByte("MaxLevel");
            packet.ReadInt32("InvType");
            packet.ReadInt32("ItemClass");
            packet.ReadInt32("ItemSubclass");
            packet.ReadInt32("Quality");
            var sort = packet.ReadByte("SortCount");

            packet.ResetBitReader();

            var len = packet.ReadBits(8);
            packet.ReadWoWString("Name", len);

            packet.ReadBit("OnlyUsable");
            packet.ReadBit("ExactMatch");

            var size = packet.ReadInt32("DataSize");
            var data = packet.ReadBytes(size);
            var sorts = new Packet(data, packet.Opcode, packet.Time, packet.Direction, packet.Number, packet.Writer, packet.FileName);
            for (var i = 0; i < sort; ++i)
            {
                sorts.ReadByte("UnkByte1", i);
                sorts.ReadByte("UnkByte2", i);
            }
        }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:30,代码来源:AuctionHandler.cs

示例2: HandleAuthResponse434

        public static void HandleAuthResponse434(Packet packet)
        {
            var isQueued = packet.ReadBit();
            var hasAccountInfo = packet.ReadBit();

            if (isQueued)
            {
                var unkByte = packet.ReadByte();
                packet.WriteLine("Unk Byte: " + unkByte);

                var position = packet.ReadInt32();
                packet.WriteLine("Queue Position: " + position);

            }
            if (hasAccountInfo)
            {
                packet.ReadInt32("Billing Time Remaining");
                packet.ReadEnum<ClientType>("Account Expansion", TypeCode.Byte);
                packet.ReadInt32("Unknown UInt32");
                packet.ReadEnum<ClientType>("Player Expansion", TypeCode.Byte);
                packet.ReadInt32("Billing Time Rested");
                packet.ReadEnum<BillingFlag>("Billing Flags", TypeCode.Byte);
            }

            var code = (ResponseCode)packet.ReadByte();
            packet.WriteLine("Auth Code: " + code);
        }
开发者ID:skypeak,项目名称:WowPacketParser_SkyFire,代码行数:27,代码来源:SessionHandler.cs

示例3: HandleAutoStoreBagItem

 public static void HandleAutoStoreBagItem(Packet packet)
 {
     packet.ReadSByte("SrcBag");
     packet.ReadSByte("DstBag");
     packet.ReadByte("SrcSlot");
     packet.ReadByte("unk");
 }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:7,代码来源:ItemHandler.cs

示例4: HandleArenaTeamRoster

        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);
                }
            }
        }
开发者ID:Asdcrew,项目名称:WowPacketParser,代码行数:27,代码来源:BattlegroundHandler.cs

示例5: HandleCoded

 public static void HandleCoded(Packet packet)
 {
     packet.AsHex();
     var select = packet.ReadInt32("select");
     switch(select)
     {
         case 2:
         case 3:
         case 4:
             packet.ReadPackedGuid("Guid");
             packet.ReadByte("unk");
             break;
         case 1:
         case 9:
         case 10:
             break;
         case 7:
             packet.ReadByte("unk1");
             packet.ReadByte("unk2");
             break;
         case 0:
         case 5:
         case 6:
         case 8:
             packet.ReadByte("unk");
             break;
     }
 }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:28,代码来源:UnkHandler.cs

示例6: HandleServerAddonInfo547

        public static void HandleServerAddonInfo547(Packet packet)
        {
            var AddonsCount = packet.ReadBits("Addons Count", 23);
            uint[,] AddonsInfo = new uint[AddonsCount, 4];

            for (var i = 0; i < AddonsCount; ++i)
            {
                AddonsInfo[i, 0] = packet.ReadBit("Use CRC", i);
                AddonsInfo[i, 2] = packet.ReadBit("Has URL", i);
                AddonsInfo[i, 1] = packet.ReadBit("Has Public Key", i);
                if (AddonsInfo[i, 2] == 1)
                {
                    AddonsInfo[i, 3] = packet.ReadBits(8);
                }
                else
                {
                    AddonsInfo[i, 3] = 0;
                }
            }

            var BannedAddonsCount = packet.ReadBits("Banned Addons Count",18);

            for (var i = 0; i < AddonsCount; ++i)
            {
                if (AddonsInfo[i, 1] == 1)
                {
                    packet.ReadBytes(256);
                    // the bytes order isn't 1,2,3,4.. they are mangled
                }

                if (AddonsInfo[i, 0] == 1)
                {
                    packet.ReadUInt32("CRC Summ", i);
                    packet.ReadByte("Unk Byte1", i);
                }

                packet.ReadByte("Addon State", i);

                if (AddonsInfo[i, 2] == 1 && AddonsInfo[i, 3] > 0)
                {
                    packet.ReadWoWString("URL path", AddonsInfo[i, 3], i);
                }
            }

            for (var i = 0; i < BannedAddonsCount; ++i)
            {
                var NameMD5 = new byte[16];
                var VersionMD5 = new byte[16];

                for (uint j = 0; j < 16; j += 4)
                {
                    Array.Copy(packet.ReadBytes(4), 0, NameMD5, j, 4);
                    Array.Copy(packet.ReadBytes(4), 0, VersionMD5, j, 4);
                }

                packet.ReadUInt32("ID", i);
                packet.ReadUInt32("Timestamp", i);
                packet.ReadUInt32("Banned", i);
            }
        }
开发者ID:Walkum,项目名称:WowPacketParser_Skyfire,代码行数:60,代码来源:AddonHandler.cs

示例7: HandleAutoStoreBagItem

        public static void HandleAutoStoreBagItem(Packet packet)
        {
            packet.ReadByte("Slot"); // 16
            packet.ReadByte("unk36"); // 36
            packet.ReadSByte("Bag"); // 17

            var bits14 = (int)packet.ReadBits(2);

            var hasSlot = new bool[bits14];
            var hasBag = new bool[bits14];

            for (var i = 0; i < bits14; i++)
            {
                hasBag[i] = !packet.ReadBit(); // 96
                hasSlot[i] = !packet.ReadBit(); // 97
            }

            for (var i = 0; i < bits14; i++)
            {
                if (hasSlot[i])
                    packet.ReadByte("Slot", i);
                if (hasBag[i])
                    packet.ReadSByte("Bag", i);
            }
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:25,代码来源:ItemHandler.cs

示例8: HandleArenaTeamRoster

        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");
                }

            }
        }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:28,代码来源:BattlegroundHandler.cs

示例9: HandleCalendarSendEvent

        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);
        }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:27,代码来源:CalendarHandler.cs

示例10: HandleGroupAssignment

        public static void HandleGroupAssignment(Packet packet)
        {
            var guid = new byte[8];

            packet.ReadByte("Byte12");
            packet.ReadByte("Byte10");
            guid[0] = packet.ReadBit();
            guid[5] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            guid[3] = packet.ReadBit();
            guid[1] = packet.ReadBit();
            guid[2] = packet.ReadBit();
            var bit11 = packet.ReadBit();
            guid[4] = packet.ReadBit();
            packet.ReadXORByte(guid, 4);
            packet.ReadXORByte(guid, 3);
            packet.ReadXORByte(guid, 1);
            packet.ReadXORByte(guid, 5);
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 6);
            packet.ReadXORByte(guid, 7);
            packet.ReadXORByte(guid, 0);

            packet.WriteGuid("Guid", guid);
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:26,代码来源:GroupHandler.cs

示例11: HandleAuraCastLog

        public static void HandleAuraCastLog(Packet packet)
        {
            packet.ReadPackedGuid("Target GUID");
            packet.ReadPackedGuid("Caster GUID");
            packet.ReadEntryWithName<Int32>(StoreNameType.Spell, "Spell ID");
            packet.ReadUInt32("Count");

            var aura = packet.ReadEnum<AuraType>("Aura Type", TypeCode.UInt32);
            switch (aura)
            {
                case AuraType.PeriodicDamage:
                case AuraType.PeriodicDamagePercent:
                {
                    packet.ReadUInt32("Damage");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
                        packet.ReadUInt32("Over damage");

                    packet.ReadUInt32("Spell Proto");
                    packet.ReadUInt32("Absorb");
                    packet.ReadUInt32("Resist");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_2_9901))
                        packet.ReadByte("Critical");

                    break;
                }
                case AuraType.PeriodicHeal:
                case AuraType.ObsModHealth:
                {
                    packet.ReadUInt32("Damage");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
                        packet.ReadUInt32("Over damage");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685)) // no idea when this was added exactly
                        packet.ReadUInt32("Absorb");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_2_9901))
                        packet.ReadByte("Critical");

                    break;
                }
                case AuraType.ObsModPower:
                case AuraType.PeriodicEnergize:
                {
                    packet.ReadEnum<PowerType>("Power type", TypeCode.Int32);
                    packet.ReadUInt32("Amount");
                    break;
                }
                case AuraType.PeriodicManaLeech:
                {
                    packet.ReadEnum<PowerType>("Power type", TypeCode.Int32);
                    packet.ReadUInt32("Amount");
                    packet.ReadSingle("Gain multiplier");
                    break;
                }
            }
        }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:59,代码来源:SpellHandler.cs

示例12: HandleUseItem

        public static void HandleUseItem(Packet packet)
        {
            packet.ReadByte("PackSlot");
            packet.ReadByte("Slot");
            packet.ReadPackedGuid128("CastItem");

            SpellHandler.ReadSpellCastRequest(packet, "Cast");
        }
开发者ID:jackpoz,项目名称:WowPacketParser,代码行数:8,代码来源:ItemHandler.cs

示例13: HandleMailListResult

 public static void HandleMailListResult(Packet packet)
 {
     packet.ReadUInt32("Total Mails");
     var count = packet.ReadByte("Shown Mails");
     for (var i = 0; i < count; ++i)
     {
         packet.ReadUInt16("Message Size", i);
         packet.ReadUInt32("Mail Id", i);
         var mailType = packet.ReadEnum<MailType>("Message Type", TypeCode.Byte, i);
         switch (mailType) // Read GUID if MailType.Normal, int32 (entry) if not
         {
             case MailType.Normal:
                 packet.ReadGuid("Player GUID", i);
                 break;
             case MailType.Creature:
                 packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.Unit, packet.ReadInt32()));
                 break;
             case MailType.GameObject:
                 packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.GameObject, packet.ReadInt32()));
                 break;
             case MailType.Item:
                 packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.Item, packet.ReadInt32()));
                 break;
             default:
                 packet.ReadInt32("Entry", i);
                 break;
         }
         packet.ReadUInt32("COD", i);
         packet.ReadUInt32("Unk uint32", i);
         packet.ReadUInt32("Stationery", i);
         packet.ReadUInt32("Money", i);
         packet.ReadUInt32("Flags", i);
         packet.ReadSingle("Time?", i);
         packet.ReadUInt32("Template Id", i);
         packet.ReadCString("Subject", i);
         packet.ReadCString("Body", i);
         var items = packet.ReadByte("Item Count", i);
         for (var j = 0; j < items; ++j)
         {
             packet.ReadByte("Item Index", i, j);
             packet.ReadUInt32("Item GuidLow", i, j);
             packet.ReadEntryWithName<UInt32>(StoreNameType.Item, "Item Id", i, j);
             for (var k = 0; k < 7; ++k)
             {
                 packet.ReadUInt32("Item Enchantment Id", i, j, k);
                 packet.ReadUInt32("Item Enchantment Duration", i, j, k);
                 packet.ReadUInt32("Item Enchantment Charges", i, j, k);
             }
             packet.ReadInt32("Item Random Property Id", i, j);
             packet.ReadUInt32("Item Suffix Factor", i, j);
             packet.ReadUInt32("Item Count", i, j);
             packet.ReadUInt32("Item SpellCharges", i, j);
             packet.ReadUInt32("Item Max Durability", i, j);
             packet.ReadUInt32("Item Durability", i, j);
             packet.ReadByte("Unk byte", i, j);
         }
     }
 }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:58,代码来源:MailHandler.cs

示例14: HandlePetAction

 public static void HandlePetAction(Packet packet)
 {
     packet.ReadPackedGuid128("PetGUID");
     var action = (uint)packet.ReadUInt16() + (packet.ReadByte() << 16);
     packet.AddValue("Action", action);
     packet.ReadByte("Slot");
     packet.ReadPackedGuid128("TargetGUID");
     packet.ReadVector3("ActionPosition");
 }
开发者ID:rob3ns,项目名称:PacketSniffer,代码行数:9,代码来源:PetHandler.cs

示例15: HandleAuraPointsDepleted

 public static void HandleAuraPointsDepleted(Packet packet)
 {
     var guid = packet.StartBitStream(2, 4, 0, 3, 6, 7, 5, 1);
     packet.ParseBitStream(guid, 1, 3, 5);
     packet.ReadByte("unk24"); // 24
     packet.ParseBitStream(guid, 0, 2, 7, 6, 4);
     packet.ReadByte("unk25"); // 25
     packet.WriteGuid("Guid", guid);
 }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:9,代码来源:SpellHandler.cs


注:本文中的WowPacketParser.Misc.Packet.ReadByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。