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


C# Packet.ReadBits方法代码示例

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


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

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

示例2: HandleChatAddonMessageParty

 public static void HandleChatAddonMessageParty(Packet packet)
 {
     var len33 = packet.ReadBits(8);
     var len16 = packet.ReadBits(5);
     packet.ReadWoWString("Message", len33);
     packet.ReadWoWString("Prefix", len16);
 }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:7,代码来源:AddonHandler.cs

示例3: HandleChatAddonMessageInstanceChat

 public static void HandleChatAddonMessageInstanceChat(Packet packet)
 {
     var len272 = packet.ReadBits(5);
     var len16 = packet.ReadBits(8);
     packet.ReadWoWString("Message", len16);
     packet.ReadWoWString("Prefix", len272);
 }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:7,代码来源:AddonHandler.cs

示例4: HandleBattlePetModifyName

        public static void HandleBattlePetModifyName(Packet packet)
        {
            var guid = new byte[8];
            guid[5] = packet.ReadBit(); // 93
            guid[7] = packet.ReadBit(); // 95
            guid[3] = packet.ReadBit(); // 91
            guid[0] = packet.ReadBit(); // 88
            guid[6] = packet.ReadBit(); // 94
            var len = packet.ReadBits("Len", 7);
            guid[2] = packet.ReadBit(); // 90
            guid[1] = packet.ReadBit(); // 89
            var hasDeclinedNames = packet.ReadBit("hasDeclNames"); // 421
            guid[4] = packet.ReadBit(); // 92

            var declinedNamesLen = new uint[5];

            if (hasDeclinedNames)
                for ( var i = 5; i > 0; i--)
                    declinedNamesLen[i-1] = packet.ReadBits(7);

            packet.ResetBitReader();

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

            packet.ReadWoWString("Nick", len);

            if (hasDeclinedNames)
                for (var i = 5; i > 0; i--)
                    packet.ReadWoWString("declNames", declinedNamesLen[i - 1], i);
        }
开发者ID:nelegalno,项目名称:WowPacketParser,代码行数:31,代码来源:BattlePetHandlers.cs

示例5: HandleGroupInvite

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

            packet.ReadInt32("Unk Int32"); // Non-zero in cross realm parties (1383)
            packet.ReadInt32("Unk Int32"); // Always 0
            packet.ReadByte("unk");

            guid[2] = packet.ReadBit();
            var strLen = packet.ReadBits(9);
            guid[0] = packet.ReadBit();

            guid[3] = packet.ReadBit();
            guid[4] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            guid[5] = packet.ReadBit();
            guid[1] = packet.ReadBit();

            var nameLen = packet.ReadBits(9);

            packet.ResetBitReader();

            packet.ReadXORByte(guid, 5);
            packet.ReadWoWString("Realm Name", strLen); // Non-empty in cross realm parties
            packet.ReadWoWString("Name", nameLen);
            packet.ReadXORByte(guid, 4);
            packet.ReadXORByte(guid, 0);
            packet.ReadXORByte(guid, 3);
            packet.ReadXORByte(guid, 6);
            packet.ReadXORByte(guid, 1);
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 7);
            packet.WriteGuid("Guid", guid); // Non-zero in cross realm parties
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:35,代码来源:GroupHandler.cs

示例6: HandleChallengeModeAllMapStats

        public static void HandleChallengeModeAllMapStats(Packet packet)
        {
            var bits10 = 0;
            bits10 = (int)packet.ReadBits(19);

            var bits30 = new uint[bits10];
            for (var i = 0; i < bits10; ++i)
            {
                bits30[i] = packet.ReadBits(23);
            }

            for (var i = 0; i < bits10; ++i)
            {
                packet.ReadInt32("Int14", i);
                packet.ReadInt32("Int15", i);

                for (var j = 0; j < bits30[i]; ++j)
                {
                    packet.ReadInt16("Int16", i, j);
                }

                packet.ReadInt32("Int17", i);
                packet.ReadInt32("Int18", i);
            }
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:25,代码来源:ChallengeModeHandler.cs

示例7: HandleGMTicketCaseStatus

        public static void HandleGMTicketCaseStatus(Packet packet)
        {
            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V6_2_2_20444))
            {
                packet.ReadTime("OldestTicketTime");
                packet.ReadTime("UpdateTime");
            }

            var int24 = packet.ReadInt32("CasesCount");
            for (int i = 0; i < int24; i++)
            {
                packet.ReadInt32("CaseID", i);
                packet.ReadInt32("CaseOpened", i);
                packet.ReadInt32("CaseStatus", i);
                packet.ReadInt16("CfgRealmID", i);
                packet.ReadInt64("CharacterID", i);
                packet.ReadInt32("WaitTimeOverrideMinutes", i);

                packet.ResetBitReader();
                var bits12 = packet.ReadBits(11);
                var bits262 = packet.ReadBits(10);

                packet.ReadWoWString("Url", bits12, i);
                packet.ReadWoWString("WaitTimeOverrideMessage", bits262, i);
            }
        }
开发者ID:Gooyeth,项目名称:WowPacketParser,代码行数:26,代码来源:TicketHandler.cs

示例8: HandleChannelBan

 public static void HandleChannelBan(Packet packet)
 {
     var channelLength = packet.ReadBits(8);
     var nameLength = packet.ReadBits(7);
     packet.ReadWoWString("Channel", channelLength);
     packet.ReadWoWString("Player to ban", nameLength);
 }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:7,代码来源:ChannelHandler.cs

示例9: HandleServerAddonInfo

 public static void HandleServerAddonInfo(Packet packet)
 {
     var BannedAddonsCount = packet.ReadBits("Banned Addons Count", 18);
     var AddonsCount = packet.ReadBits("Addons Count", 23);
     uint[,] AddonsInfo = new uint[AddonsCount, 4];
     packet.ReadToEnd();
 }
开发者ID:samaelsacred,项目名称:WowPacketParser,代码行数:7,代码来源:AddonHandler.cs

示例10: HandleContactList

        public static void HandleContactList(Packet packet)
        {
            packet.ReadInt32E<ContactListFlag>("List Flags");
            var bits6 = packet.ReadBits("ContactInfoCount", 8);

            for (var i = 0; i < bits6; i++)
            {
                packet.ReadPackedGuid128("Guid", i);
                packet.ReadPackedGuid128("WowAccount", i);

                packet.ReadInt32("VirtualRealmAddr", i);
                packet.ReadInt32("NativeRealmAddr", i);
                packet.ReadInt32("TypeFlags", i);

                packet.ReadByte("Status", i);

                packet.ReadInt32("AreaID", i);
                packet.ReadInt32("Level", i);
                packet.ReadInt32("ClassID", i);

                packet.ResetBitReader();

                var bits44 = packet.ReadBits(10);
                packet.ReadWoWString("Notes", bits44, i);
            }
        }
开发者ID:rob3ns,项目名称:PacketSniffer,代码行数:26,代码来源:ContactHandler.cs

示例11: HandleGuildQueryResponse

        public static void HandleGuildQueryResponse(Packet packet)
        {
            packet.ReadPackedGuid128("Guild Guid");

            var hasData = packet.ReadBit();
            if (hasData)
            {
                packet.ReadPackedGuid128("GuildGUID");
                packet.ReadInt32("VirtualRealmAddress");
                var rankCount = packet.ReadInt32("RankCount");
                packet.ReadInt32("EmblemColor");
                packet.ReadInt32("EmblemStyle");
                packet.ReadInt32("BorderColor");
                packet.ReadInt32("BorderStyle");
                packet.ReadInt32("BackgroundColor");

                packet.ResetBitReader();
                var nameLen = packet.ReadBits(7);

                for (var i = 0; i < rankCount; i++)
                {
                    packet.ReadInt32("RankID", i);
                    packet.ReadInt32("RankOrder", i);

                    packet.ResetBitReader();
                    var rankNameLen = packet.ReadBits(7);
                    packet.ReadWoWString("Rank Name", rankNameLen, i);
                }

                packet.ReadWoWString("Guild Name", nameLen);
            }
        }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:32,代码来源:GuildHandler.cs

示例12: HandleSetTimeZoneInformation

 public static void HandleSetTimeZoneInformation(Packet packet)
 {
     var len1 = packet.ReadBits(7);
     var len2 = packet.ReadBits(7);
     packet.ReadWoWString("Server Location", len2);
     packet.ReadWoWString("Server Location", len1);
 }
开发者ID:horn,项目名称:WowPacketParser,代码行数:7,代码来源:MiscellaneousHandler.cs

示例13: HandleGroupInvite

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

            packet.ReadInt32("Int114");
            packet.ReadByte("Byte118");
            packet.ReadInt32("Int128");
            crossRealmGuid[7] = packet.ReadBit();
            var realmNameLen = packet.ReadBits(9);
            crossRealmGuid[3] = packet.ReadBit();
            var nameLen = packet.ReadBits(9);
            crossRealmGuid[2] = packet.ReadBit();
            crossRealmGuid[5] = packet.ReadBit();
            crossRealmGuid[4] = packet.ReadBit();
            crossRealmGuid[0] = packet.ReadBit();
            crossRealmGuid[1] = packet.ReadBit();
            crossRealmGuid[6] = packet.ReadBit();

            packet.ReadXORByte(crossRealmGuid, 7);
            packet.ReadXORByte(crossRealmGuid, 6);
            packet.ReadXORByte(crossRealmGuid, 0);
            packet.ReadXORByte(crossRealmGuid, 4);
            packet.ReadWoWString("Name", nameLen);
            packet.ReadXORByte(crossRealmGuid, 1);
            packet.ReadXORByte(crossRealmGuid, 2);
            packet.ReadXORByte(crossRealmGuid, 3);
            packet.ReadWoWString("Realm Name", realmNameLen);
            packet.ReadXORByte(crossRealmGuid, 5);

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

示例14: HandleEquipmentSetList

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

示例15: HandleClientChatMessageAddon434

 public static void HandleClientChatMessageAddon434(Packet packet)
 {
     var length1 = (int)packet.ReadBits(9);
     var length2 = (int)packet.ReadBits(5);
     packet.ReadWoWString("Message", length1);
     packet.ReadWoWString("Prefix", length2);
 }
开发者ID:Kinzcool,项目名称:WowPacketParser,代码行数:7,代码来源:ChatHandler.cs


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