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


C# Packet.ReadInt16方法代码示例

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


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

示例1: HandleVoiceRosterUpdate

        public static void HandleVoiceRosterUpdate(Packet packet)
        {
            packet.ReadGuid("Group GUID");
            packet.ReadInt16("Channel ID");
            packet.ReadByte("Channel Type"); // 0: channel, 2: party
            packet.ReadCString("Channel Name");
            packet.WriteLine("Encryption Key: " + Utilities.ByteArrayToHexString(packet.ReadBytes(16)));
            packet.WriteLine("IP: " + packet.ReadIPAddress());
            packet.ReadInt16("Voice Server Port");

            var count = packet.ReadByte("Player Count");

            packet.ReadGuid("Leader GUID");

            var leaderFlags1 = packet.ReadByte();
            packet.WriteLine("Leader Flags 1: 0x" + leaderFlags1.ToString("X2"));

            var leaderFlags2 = packet.ReadByte();
            packet.WriteLine("Leader Flags 2: 0x" + leaderFlags2.ToString("X2"));

            for (var i = 0; i < count - 1; i++)
            {
                packet.ReadGuid("Player GUID");
                packet.ReadByte("Index");
                var flags1 = packet.ReadByte();
                packet.WriteLine("Flags 1: 0x" + flags1.ToString("X2"));
                var flags2 = packet.ReadByte();
                packet.WriteLine("Flags 2: 0x" + flags2.ToString("X2"));
            }
        }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:30,代码来源:VoiceChatHandler.cs

示例2: HandleVoiceRosterUpdate

        public static void HandleVoiceRosterUpdate(Packet packet)
        {
            packet.ReadGuid("Group GUID");
            packet.ReadInt16("Channel ID");
            packet.ReadByte("Channel Type"); // 0: channel, 2: party
            packet.ReadCString("Channel Name");
            packet.ReadBytes("Encryption Key", 16);
            packet.ReadIPAddress("IP");
            packet.ReadInt16("Voice Server Port");

            var count = packet.ReadByte("Player Count");

            packet.ReadGuid("Leader GUID");

            var leaderFlags1 = packet.ReadByte();
            packet.AddValue("Leader Flags 1", "0x" + leaderFlags1.ToString("X2"));

            var leaderFlags2 = packet.ReadByte();
            packet.AddValue("Leader Flags 2", "0x" + leaderFlags2.ToString("X2"));

            for (var i = 0; i < count - 1; i++)
            {
                packet.ReadGuid("Player GUID");
                packet.ReadByte("Index");
                var flags1 = packet.ReadByte();
                packet.AddValue("Flags 1", "0x" + flags1.ToString("X2"));
                var flags2 = packet.ReadByte();
                packet.AddValue("Flags 2", "0x" + flags2.ToString("X2"));
            }
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:30,代码来源:VoiceChatHandler.cs

示例3: HandlePetSpells

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

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

示例5: HandleAuthResponse

        public static void HandleAuthResponse(Packet packet)
        {
            var count = 0u;
            var count1 = 0u;
            var isQueued = packet.ReadBit("Is In Queue");

            if (isQueued)
                packet.ReadBit("unk0");

            var hasAccountData = packet.ReadBit("Has Account Data");

            if (hasAccountData)
            {
                packet.ReadBit("Unk 1");
                packet.ReadBit("Unk 2");
                count1 = packet.ReadBits("Race Activation Count", 23);
                packet.ReadBit("Unk 3");
                packet.ReadBits("Unkbits", 21);
                count = packet.ReadBits("Class Activation Count", 23);
                packet.ReadBits("Unkbits", 22);
                packet.ReadBit("Unk 4");

            }
            packet.ResetBitReader();

            if (hasAccountData)
            {
                packet.ReadByte("unk");
                for (var i = 0; i < count; ++i)
                {
                    packet.ReadEnum<ClientType>("Class Expansion", TypeCode.Byte, i);
                    packet.ReadEnum<Class>("Class", TypeCode.Byte, i);
                }

                packet.ReadInt16("UnkInt16 1");
                packet.ReadInt16("UnkInt16 2");

                for (var i = 0; i < count1; ++i)
                {
                    packet.ReadEnum<ClientType>("Race Expansion", TypeCode.Byte, i);
                    packet.ReadEnum<Race>("Race", TypeCode.Byte, i);
                }

                packet.ReadUInt32("Unk 8");
                packet.ReadUInt32("Unk 9");
                packet.ReadUInt32("Unk 10");

                packet.ReadEnum<ClientType>("Account Expansion", TypeCode.Byte);
                packet.ReadEnum<ClientType>("Player Expansion", TypeCode.Byte);

            }

            packet.ReadEnum<ResponseCode>("Auth Code", TypeCode.Byte);

            if (isQueued)
                packet.ReadUInt32("Unk 11");
        }
开发者ID:Resike,项目名称:WowPacketParser,代码行数:57,代码来源:SessionHandler.cs

示例6: HandleBattleFinalRound

        public static void HandleBattleFinalRound(Packet packet)
        {
            var bits14 = 0;
            bits14 = (int)packet.ReadBits(20);

            var bit1 = new bool[bits14];
            var bit2 = new bool[bits14];
            var bit3 = new bool[bits14];
            var bit4 = new bool[bits14];
            var bit6 = new bool[bits14];
            var bit10 = new bool[bits14];
            var battleAbandon = false;
            var bit24 = false;
            var bitEB = new bool[bits14];

            for (var i = 0; i < 2; ++i) // for win/lose
            {
                bit24 = packet.ReadBit("Win/Lose", i);
            }

            for (var i = 0; i < bits14; ++i)
            {
                bit3[i] = packet.ReadBit();
                bit1[i] = packet.ReadBit();
                bit2[i] = packet.ReadBit();
                bitEB[i] = packet.ReadBit();
                bit4[i] = !packet.ReadBit("unk4", i);
                bit6[i] = !packet.ReadBit("unk6", i);
                bit10[i] = !packet.ReadBit("unk10", i);
            }

            var bit11 = packet.ReadBit();
            battleAbandon = packet.ReadBit("battleAbandon");

            for (var i = 0; i < 2; ++i)
            {
                packet.ReadInt32("Int28", i);
            }

            for (var i = 0; i < bits14; ++i)
            {
                packet.ReadByte("Slot", i);

                if (bit4[i])
                    packet.ReadInt16("Level after fight", i);
                if (bit6[i])
                    packet.ReadInt16("Experience", i);

                packet.ReadInt32("Health after fight", i);
                packet.ReadInt32("Health", i);

                if (bit10[i])
                    packet.ReadInt16("Level before fight", i);
            }
        }
开发者ID:usernel,项目名称:WowPacketParser,代码行数:55,代码来源:BattlePetHandler.cs

示例7: HandleLoadCUFProfiles

        public static void HandleLoadCUFProfiles(Packet packet)
        {
            var count = packet.ReadBits("count", 19);

            var strlen = new uint[count];

            for (int i = 0; i < count; ++i)
            {
                packet.ReadBit("Talent spec 1", i);                         // 165
                packet.ReadBit("3 player group", i);                        // 159
                packet.ReadBit("Unk 157", i);                               // 157
                packet.ReadBit("10 player group", i);                       // 161
                packet.ReadBit("40 player group", i);                       // 164
                packet.ReadBit("Border", i);                                // 141
                packet.ReadBit("Class colors", i);                          // 142
                packet.ReadBit("Keep groups together", i);                  // 134
                packet.ReadBit("Display power bars", i);                    // 140
                strlen[i] = packet.ReadBits("String length", 7, i);         // 0
                packet.ReadBit("Pets", i);                                  // 135
                packet.ReadBit("Aggro highlight", i);                       // 138
                packet.ReadBit("Unk 145", i);                               // 145
                packet.ReadBit("PvP", i);                                   // 167
                packet.ReadBit("Unk 156", i);                               // 156
                packet.ReadBit("Main tank and assist", i);                  // 136
                packet.ReadBit("Debuffs", i);                               // 144
                packet.ReadBit("Horizontal groups", i);                     // 143
                packet.ReadBit("Talent spec 2", i);                         // 166
                packet.ReadBit("Incoming heals", i);                        // 137
                packet.ReadBit("Dispellable debuffs", i);                   // 139
                packet.ReadBit("25 player group", i);                       // 163
                packet.ReadBit("PvE", i);                                   // 168
                packet.ReadBit("5 player group", i);                        // 160
                packet.ReadBit("15 player group", i);                       // 162
                packet.ReadBit("2 player group", i);                        // 158
            }

            for (int i = 0; i < count; ++i)
            {
                packet.ReadInt16("Unk 152", i);                             // 152
                packet.ReadInt16("Unk 154", i);                             // 154
                packet.ReadByte("Health text", i); // 0 - none, 1 - remaining, 2 - lost, 3 - percentage 133
                packet.ReadWoWString("Name", (int)strlen[i], i);            // 172
                packet.ReadByte("Unk 147", i);                              // 147
                packet.ReadByte("Unk 146", i);                              // 146
                packet.ReadInt16("Frame height", i);                        // 128
                packet.ReadByte("Unk 148", i);                              // 148
                packet.ReadByte("Sort by", i); // 0 - role, 1 - group, 2 - alphabetical 132
                packet.ReadInt16("Frame width", i);                         // 130
                packet.ReadInt16("Unk 150", i);                             // 150
            }
        }
开发者ID:samaelsacred,项目名称:WowPacketParser,代码行数:51,代码来源:InstanceHandler.cs

示例8: HandleLoadCUFProfiles

        public static void HandleLoadCUFProfiles(Packet packet)
        {
            var count = packet.ReadBits("Count", 19);

            var strlen = new uint[count];

            for (var i = 0; i < count; ++i)
            {
                packet.ReadBit("Unk 1", i);
                packet.ReadBit("Unk 2", i);
                packet.ReadBit("Unk 3", i);
                packet.ReadBit("Unk 4", i);
                packet.ReadBit("Unk 5", i);
                packet.ReadBit("Unk 6", i);
                packet.ReadBit("Unk 7", i);
                packet.ReadBit("Unk 8", i);
                packet.ReadBit("Unk 9", i);
                packet.ReadBit("Unk 10", i);
                packet.ReadBit("Unk 11", i);
                packet.ReadBit("Unk 12", i);
                packet.ReadBit("Unk 13", i);
                packet.ReadBit("Unk 14", i);
                packet.ReadBit("Unk 15", i);
                packet.ReadBit("Unk 16", i);
                packet.ReadBit("Unk 17", i);
                packet.ReadBit("Unk 18", i);
                packet.ReadBit("Unk 19", i);
                packet.ReadBit("Unk 20", i);
                packet.ReadBit("Unk 21", i);
                strlen[i] = packet.ReadBits("String length", 7, i);
                packet.ReadBit("Unk 22", i);
                packet.ReadBit("Unk 23", i);
                packet.ReadBit("Unk 24", i);
                packet.ReadBit("Unk 25", i);
            }

            for (var i = 0; i < count; ++i)
            {
                packet.ReadInt16("Unk 25", i);
                packet.ReadInt16("Frame height", i);
                packet.ReadByte("Unk 26", i);
                packet.ReadInt16("Frame width", i);
                packet.ReadByte("Unk 27", i);
                packet.ReadInt16("Unk 28", i);
                packet.ReadByte("Unk 29", i);
                packet.ReadByte("Unk 27", i);
                packet.ReadByte("Unk 31", i);
                packet.ReadWoWString("Name", strlen[i], i);
                packet.ReadInt16("Unk 32", i);
            }
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:51,代码来源:InstanceHandler.cs

示例9: HandleCUFProfiles

        public static void HandleCUFProfiles(Packet packet)
        {
            var count = packet.ReadUInt32("Count");

            for (int i = 0; i < count; ++i)
            {
                var strlen = packet.ReadBits(7);

                packet.ReadBit("KeepGroupsTogether", i);
                packet.ReadBit("DisplayPets", i);
                packet.ReadBit("DisplayMainTankAndAssist", i);
                packet.ReadBit("DisplayHealPrediction", i);
                packet.ReadBit("DisplayAggroHighlight", i);
                packet.ReadBit("DisplayOnlyDispellableDebuffs", i);
                packet.ReadBit("DisplayPowerBar", i);
                packet.ReadBit("DisplayBorder", i);
                packet.ReadBit("UseClassColors", i);
                packet.ReadBit("HorizontalGroups", i);
                packet.ReadBit("DisplayNonBossDebuffs", i);
                packet.ReadBit("DynamicPosition", i);
                packet.ReadBit("Locked", i);
                packet.ReadBit("Shown", i);
                packet.ReadBit("AutoActivate2Players", i);
                packet.ReadBit("AutoActivate3Players", i);
                packet.ReadBit("AutoActivate5Players", i);
                packet.ReadBit("AutoActivate10Players", i);
                packet.ReadBit("AutoActivate15Players", i);
                packet.ReadBit("AutoActivate25Players", i);
                packet.ReadBit("AutoActivate40Players", i);
                packet.ReadBit("AutoActivateSpec1", i);
                packet.ReadBit("AutoActivateSpec2", i);
                packet.ReadBit("AutoActivatePvP", i);
                packet.ReadBit("AutoActivatePvE", i);

                packet.ReadInt16("FrameHeight", i);
                packet.ReadInt16("FrameWidth", i);

                packet.ReadByte("SortBy", i);
                packet.ReadByte("HealthText", i);
                packet.ReadByte("TopPoint", i);
                packet.ReadByte("BottomPoint", i);
                packet.ReadByte("LeftPoint", i);

                packet.ReadInt16("TopOffset", i);
                packet.ReadInt16("BottomOffset", i);
                packet.ReadInt16("LeftOffset", i);

                packet.ReadWoWString("Name", strlen, i);
            }
        }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:50,代码来源:InstanceHandler.cs

示例10: HandleInspectHonorStatsResponse

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

            // Might be swapped, unsure
            packet.ReadInt16("Yesterday Honorable Kills");
            packet.ReadByte("Lifetime Max Rank");
            packet.ReadInt32("Life Time Kills");
            packet.ReadInt16("Today Honorable Kills");

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

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

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

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

示例13: ReadPetSpellCooldownData

 public static void ReadPetSpellCooldownData(Packet packet, params object[] idx)
 {
     packet.ReadInt32("SpellID", idx);
     packet.ReadInt32("Duration", idx);
     packet.ReadInt32("CategoryDuration", idx);
     packet.ReadSingle("ModRate", idx);
     packet.ReadInt16("Category", idx);
 }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:8,代码来源:PetHandler.cs

示例14: HandleInitWorldStates

        public static void HandleInitWorldStates(Packet packet)
        {
            packet.ReadInt32<MapId>("Map ID");
            packet.ReadInt32<ZoneId>("Zone Id");
            CurrentAreaId = packet.ReadInt32<AreaId>("Area Id");

            var numFields = packet.ReadInt16("Field Count");
            for (var i = 0; i < numFields; i++)
                ReadWorldStateBlock(packet, i);
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:10,代码来源:WorldStateHandler.cs

示例15: HandleInitWorldStates

        public static void HandleInitWorldStates(Packet packet)
        {
            packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
            packet.ReadInt32("Zone ID");
            packet.ReadInt32("Area ID");

            var numFields = packet.ReadInt16("Field Count");
            for (var i = 0; i < numFields; i++)
                ReadWorldStateBlock(ref packet);
        }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:10,代码来源:WorldStateHandler.cs


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