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


C# Packet.ReadBit方法代码示例

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


在下文中一共展示了Packet.ReadBit方法的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: HandlePetNameQueryResponse

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

示例3: HandleDestroyObject

        public static void HandleDestroyObject(Packet packet)
        {
            if (packet.Direction == Direction.ServerToClient)
            {
                var guid = new byte[8];

                guid[3] = packet.ReadBit();
                guid[2] = packet.ReadBit();
                guid[4] = packet.ReadBit();
                guid[1] = packet.ReadBit();

                packet.ReadBit("Despawn Animation");

                guid[7] = packet.ReadBit();
                guid[0] = packet.ReadBit();
                guid[6] = packet.ReadBit();
                guid[5] = packet.ReadBit();

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

                packet.WriteGuid("Object Guid", guid);
            }
            else
            {
                packet.WriteLine("              : CMSG_PVP_LOG_DATA");
            }
        }
开发者ID:nelegalno,项目名称:WowPacketParser,代码行数:27,代码来源:UpdateHandler.cs

示例4: HandleGuildQueryResponse

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

            var len = new uint[255];
            var count = 0u;
            var len2 = 0u;

            guid[5] = packet.ReadBit();
            var unk16 = packet.ReadBit("unk16");
            if (unk16)
            {
                count = packet.ReadBits("cnt", 21);
                guid2[5] = packet.ReadBit();
                guid2[1] = packet.ReadBit();
                guid2[4] = packet.ReadBit();
                guid2[7] = packet.ReadBit();
                for (var i = 0; i < count; i++)
                {
                    len[i] = packet.ReadBits(7);
                }
                guid2[3] = packet.ReadBit();
                guid2[2] = packet.ReadBit();
                guid2[0] = packet.ReadBit();
                guid2[6] = packet.ReadBit();

                len2 = packet.ReadBits("unk36", 7);
            }
            guid[3] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            guid[2] = packet.ReadBit();
            guid[1] = packet.ReadBit();
            guid[0] = packet.ReadBit();
            guid[4] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            if (unk16)
            {
                packet.ReadInt32("unk160");
                packet.ReadInt32("unk152");
                packet.ParseBitStream(guid2, 2, 7);
                packet.ReadInt32("unk156");
                packet.ReadInt32("unk32");
                for (var i = 0; i < count; i++)
                {
                    packet.ReadInt32("unk144", i);
                    packet.ReadInt32("unk140", i);
                    packet.ReadWoWString("str", len[i], i);
                }
                packet.ReadWoWString("str", len2);
                packet.ReadInt32("unk168");
                packet.ParseBitStream(guid2, 5, 4);
                packet.ReadInt32("unk164");
                packet.ParseBitStream(guid2, 1, 6, 0, 3);
                packet.WriteGuid("Guid2", guid2);
            }
            packet.ParseBitStream(guid, 2, 6, 4, 0, 7, 3, 5, 1);

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

示例5: HandleGroupInvite

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

            packet.ReadInt32("Int114");
            packet.ReadInt32("Int128");
            packet.ReadByte("Byte118");
            crossRealmGuid[5] = packet.ReadBit();
            var bits12C = packet.ReadBits(9);
            crossRealmGuid[2] = packet.ReadBit();
            crossRealmGuid[1] = packet.ReadBit();
            crossRealmGuid[7] = packet.ReadBit();
            crossRealmGuid[4] = packet.ReadBit();
            crossRealmGuid[3] = packet.ReadBit();
            var bits10 = packet.ReadBits(9);
            crossRealmGuid[0] = packet.ReadBit();
            crossRealmGuid[6] = packet.ReadBit();
            packet.ReadXORByte(crossRealmGuid, 0);
            packet.ReadXORByte(crossRealmGuid, 4);
            packet.ReadWoWString("string12C", bits10);
            packet.ReadXORByte(crossRealmGuid, 5);
            packet.ReadXORByte(crossRealmGuid, 6);
            packet.ReadWoWString("string10", bits12C);
            packet.ReadXORByte(crossRealmGuid, 1);
            packet.ReadXORByte(crossRealmGuid, 7);
            packet.ReadXORByte(crossRealmGuid, 3);
            packet.ReadXORByte(crossRealmGuid, 2);

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

示例6: 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

示例7: HandleLootResponse

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

示例8: HandleInitCurrency

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

示例9: HandleTradeStatus

 public static void HandleTradeStatus(Packet packet)
 {
     packet.ReadBit("Unk Bit");
     var status = packet.ReadEnum<TradeStatus530>("Status", 5);
     switch (status)
     {
         case TradeStatus530.BeginTrade:
             var guid = packet.StartBitStream(0, 3, 2, 4, 1, 6, 7, 5);
             packet.ParseBitStream(guid, 5, 7, 3, 6, 4, 2, 0, 1);
             packet.WriteGuid("GUID", guid);
             break;
         case TradeStatus530.CloseWindow:
             packet.ReadBit("Unk Bit");
             packet.ReadInt32("Unk Int32");
             packet.ReadInt32("Unk Int32");
             break;
         case TradeStatus530.TradeCurrency:
         case TradeStatus530.CurrencyNotTradable:
             packet.ReadInt32("Unk Int32 1");
             packet.ReadInt32("Unk Int32 2");
             break;
         case TradeStatus530.NotEligible:
         case TradeStatus530.OnlyConjured:
             packet.ReadByte("Unk Byte");
             break;
         case TradeStatus530.OpenWindow:
             packet.ReadInt32("Trade Id");
             break;
     }
 }
开发者ID:Resike,项目名称:WowPacketParser,代码行数:30,代码来源:TradeHandler.cs

示例10: 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

示例11: HandleLootMasterList

        public static void HandleLootMasterList(Packet packet)
        {
            var guid = new byte[8];
            guid[1] = packet.ReadBit();
            var count = packet.ReadBits("count", 24);
            var guids = new byte[count][];
            guid[5] = packet.ReadBit();
            for (var i = 0; i < count; i++)
                guids[i] = packet.StartBitStream(4, 1, 2, 5, 3, 7, 0, 6);
            guid[2] = packet.ReadBit();
            guid[0] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            guid[3] = packet.ReadBit();
            guid[4] = packet.ReadBit();

            packet.ParseBitStream(guid, 3, 0, 2);

            for (var i = 0; i < count; i++)
            {
                packet.ParseBitStream(guids[i], 1, 3, 7, 2, 0, 6, 4, 5);
                packet.WriteGuid("guids", guids[i]);
            }
            packet.ParseBitStream(guid, 7, 1, 6, 4, 5);
            packet.WriteGuid("Guid", guid);
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:26,代码来源:LootHandler.cs

示例12: HandleLootList

        public static void HandleLootList(Packet packet)
        {
            var guid48 = new byte[8];
            guid48[5] = packet.ReadBit();
            var unk24 = packet.ReadBit("unk24"); // 24
            var guid16 = new byte[8];
            if (unk24)
                guid16 = packet.StartBitStream(4, 6, 0, 7, 5, 2, 3, 1);
            guid48[1] = packet.ReadBit();
            var unk40 = packet.ReadBit("unk40"); // 40
            guid48[4] = packet.ReadBit();
            guid48[3] = packet.ReadBit();
            guid48[2] = packet.ReadBit();
            var guid32 = new byte[8];
            if (unk40)
                guid32 = packet.StartBitStream(2, 3, 4, 5, 6, 0, 1, 7);
            guid48[7] = packet.ReadBit();
            guid48[0] = packet.ReadBit();
            guid48[6] = packet.ReadBit();
            if (unk40)
            {
                packet.ParseBitStream(guid32, 7, 1, 0, 6, 5, 3, 4, 2);
                packet.WriteGuid("guid32", guid32);
            }
            if (unk24)
            {
                packet.ParseBitStream(guid16, 4, 5, 6, 3, 2, 7, 0, 1);
                packet.WriteGuid("guid16", guid16);
            }
            packet.ParseBitStream(guid48, 5, 1, 6, 2, 3, 0, 7, 4);

            packet.WriteGuid("guid48", guid48);
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:33,代码来源:LootHandler.cs

示例13: HandleItemPushResult

        public static void HandleItemPushResult(Packet packet)
        {
            packet.ReadPackedGuid128("PlayerGUID");

            packet.ReadByte("Slot");

            packet.ReadInt32("SlotInBag");

            packet.ReadUInt32("QuestLogItemID");
            packet.ReadUInt32("Quantity");
            packet.ReadUInt32("QuantityInInventory");
            packet.ReadInt32("DungeonEncounterID");

            packet.ReadUInt32("BattlePetBreedID");
            packet.ReadUInt32("BattlePetBreedQuality");
            packet.ReadUInt32("BattlePetSpeciesID");
            packet.ReadUInt32("BattlePetLevel");

            packet.ReadPackedGuid128("ItemGUID");

            packet.ResetBitReader();

            packet.ReadBit("Pushed");
            packet.ReadBit("Created");
            packet.ReadBits("DisplayText", 3);
            packet.ReadBit("IsBonusRoll");
            packet.ReadBit("IsEncounterLoot");

            V6_0_2_19033.Parsers.ItemHandler.ReadItemInstance(packet, "ItemInstance");
        }
开发者ID:jackpoz,项目名称:WowPacketParser,代码行数:30,代码来源:ItemHandler.cs

示例14: HandleMailQueryNextTimeResult60x

        public static void HandleMailQueryNextTimeResult60x(Packet packet)
        {
            packet.ReadSingle("NextMailTime");

            var int5 = packet.ReadInt32("NextCount");

            for (int i = 0; i < int5; i++)
            {
                packet.ReadPackedGuid128("SenderGUID", i);

                // PlayerGuidLookupHint
                packet.ResetBitReader();

                var bit4 = packet.ReadBit("HasVirtualRealmAddress", i);
                var bit12 = packet.ReadBit("HasNativeRealmAddress", i);

                if (bit4)
                    packet.ReadInt32("VirtualRealmAddress", i);

                if (bit12)
                    packet.ReadInt32("NativeRealmAddress", i);

                packet.ReadSingle("TimeLeft", i);
                packet.ReadInt32("AltSenderID", i);
                packet.ReadByte("AltSenderType", i);
                packet.ReadInt32("StationeryID", i);
            }
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:28,代码来源:MailHandler.cs

示例15: ReadClientBattlePet

        public static void ReadClientBattlePet(Packet packet, params object[] idx)
        {
            packet.ReadPackedGuid128("BattlePetGUID", idx);

            packet.ReadInt32("SpeciesID", idx);
            packet.ReadInt32("DisplayID", idx);
            packet.ReadInt32("CollarID", idx);

            packet.ReadInt16("BreedID", idx);
            packet.ReadInt16("Level", idx);
            packet.ReadInt16("Xp", idx);
            packet.ReadInt16("BattlePetDBFlags", idx);

            packet.ReadInt32("Power", idx);
            packet.ReadInt32("Health", idx);
            packet.ReadInt32("MaxHealth", idx);
            packet.ReadInt32("Speed", idx);

            packet.ReadByte("BreedQuality", idx);

            packet.ResetBitReader();

            var customNameLength = packet.ReadBits(7);
            var hasOwnerInfo = packet.ReadBit("HasOwnerInfo", idx);
            packet.ReadBit("NoRename", idx);

            packet.ReadWoWString("CustomName", customNameLength, idx);

            if (hasOwnerInfo)
                V6_0_2_19033.Parsers.BattlePetHandler.ReadClientBattlePetOwnerInfo(packet, "OwnerInfo", idx);
        }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:31,代码来源:BattlePetHandler.cs


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