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


C# Packet.ReadEnum方法代码示例

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


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

示例1: HandleAddCalendarEvent

        public static void HandleAddCalendarEvent(Packet packet)
        {
            packet.ReadCString("Title");
            packet.ReadCString("Description");
            packet.ReadEnum<CalendarEventType>("Event Type", TypeCode.Byte);
            packet.ReadEnum<CalendarRepeatType>("Repeat Type", TypeCode.Byte);
            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.GuildAnnouncement) != 0)
                return;

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

            for (var i = 0; i < count; i++)
            {
                packet.ReadPackedGuid("Creator GUID");
                packet.ReadEnum<CalendarEventStatus>("Status", TypeCode.Byte);
                packet.ReadEnum<CalendarModerationRank>("Moderation Rank", TypeCode.Byte);
            }
        }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:25,代码来源:CalendarHandler.cs

示例2: HandleGuildFinderBrowse

 public static void HandleGuildFinderBrowse(Packet packet)
 {
     packet.ReadEnum<GuildFinderOptionsRoles>("Class Roles", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsAvailability>("Availability", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsInterest>("Guild Interests", TypeCode.UInt32);
     packet.ReadUInt32("Player Level");
 }
开发者ID:kandera,项目名称:WowPacketParser,代码行数:7,代码来源:GuildFinderHandler.cs

示例3: HandleCalendarCommandResult

 public static void HandleCalendarCommandResult(Packet packet)
 {
     packet.ReadInt32("UnkInt1");
     packet.ReadCString("UnkString1");
     packet.ReadCString("Param 1"); // if %s is used in the error message
     packet.ReadEnum<CalendarError>("Error", TypeCode.Int32);
 }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:7,代码来源:CalendarHandler.cs

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

示例5: HandleContactList

        public static void HandleContactList(Packet packet)
        {
            packet.ReadEnum<ContactListFlag>("List Flags", TypeCode.Int32);
            var count = packet.ReadInt32("Count");

            for (var i = 0; i < count; i++)
            {
                packet.ReadGuid("GUID");
                packet.ReadInt32("Unk int1");
                packet.ReadInt32("Unk int2");
                var flag = packet.ReadEnum<ContactEntryFlag>("Flags", TypeCode.Int32);
                packet.ReadCString("Note");

                if (!flag.HasAnyFlag(ContactEntryFlag.Friend))
                    continue;

                var status = packet.ReadEnum<ContactStatus>("Status", TypeCode.Byte);
                if (status == 0) // required any flag
                    continue;

                packet.ReadEntry<Int32>(StoreNameType.Area, "Area");
                packet.ReadInt32("Level");
                packet.ReadEnum<Class>("Class", TypeCode.Int32);
            }

            // still needed?
            if (packet.CanRead())
                CoreParsers.WardenHandler.ReadCheatCheckDecryptionBlock(ref packet);
        }
开发者ID:samaelsacred,项目名称:WowPacketParser,代码行数:29,代码来源:ContactHandler.cs

示例6: HandleContactList

        public static void HandleContactList(Packet packet)
        {
            packet.ReadEnum<ContactListFlag>("List Flags", TypeCode.Int32);
            var count = packet.ReadInt32("Count");

            for (var i = 0; i < count; i++)
            {
                packet.ReadGuid("GUID");
                packet.ReadInt32("Realm Id");
                packet.ReadInt32("Realm Id");
                var flag = packet.ReadEnum<ContactEntryFlag>("Flags", TypeCode.Int32);
                packet.ReadCString("Note");

                if (!flag.HasAnyFlag(ContactEntryFlag.Friend))
                    continue;

                var status = packet.ReadEnum<ContactStatus>("Status", TypeCode.Byte);
                if (status == 0) // required any flag
                    continue;

                packet.ReadEntry<Int32>(StoreNameType.Area, "Area");
                packet.ReadInt32("Level");
                packet.ReadEnum<Class>("Class", TypeCode.Int32);
            }
        }
开发者ID:samaelsacred,项目名称:WowPacketParser,代码行数:25,代码来源:ContactHandler.cs

示例7: HandleLFGuildAddRecruit

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

            packet.ReadEnum<GuildFinderOptionsRoles>("Class Roles", TypeCode.UInt32);
            packet.ReadEnum<GuildFinderOptionsInterest>("Guild Interests", TypeCode.UInt32);
            packet.ReadEnum<GuildFinderOptionsAvailability>("Availability", TypeCode.UInt32);

            guid[3] = packet.ReadBit();
            guid[0] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            guid[1] = packet.ReadBit();
            var comment = packet.ReadBits(11);
            guid[5] = packet.ReadBit();
            guid[4] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            var player = packet.ReadBits(7);
            guid[2] = packet.ReadBit();

            packet.ReadXORByte(guid, 4);
            packet.ReadXORByte(guid, 5);
            packet.ReadWoWString("Comment", comment);
            packet.ReadWoWString("Player name", player);
            packet.ReadXORByte(guid, 7);
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 0);
            packet.ReadXORByte(guid, 6);
            packet.ReadXORByte(guid, 1);
            packet.ReadXORByte(guid, 3);

            packet.WriteGuid("Guild GUID", guid);
        }
开发者ID:samaelsacred,项目名称:WowPacketParser,代码行数:32,代码来源:GuildFinderHandler.cs

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

示例9: HandleGossipPoi

 public static void HandleGossipPoi(Packet packet)
 {
     packet.ReadEnum<UnknownFlags>("Flags", TypeCode.Int32);
     packet.ReadVector2("Coordinates");
     packet.ReadEnum<GossipPoiIcon>("Icon", TypeCode.UInt32);
     packet.ReadInt32("Data");
     packet.ReadCString("Icon Name");
 }
开发者ID:Machiavell1,项目名称:WowPacketParser,代码行数:8,代码来源:NpcHandler.cs

示例10: HandleAddCalendarEventInvite

 public static void HandleAddCalendarEventInvite(Packet packet)
 {
     packet.ReadInt64("Event ID");
     packet.ReadInt64("Invite ID");
     packet.ReadCString("Name");
     packet.ReadEnum<CalendarEventStatus>("Status", TypeCode.Byte);
     packet.ReadEnum<CalendarModerationRank>("Moderation Rank", TypeCode.Byte);
 }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:8,代码来源:CalendarHandler.cs

示例11: HandleAuctionCommandResult

 public static void HandleAuctionCommandResult(Packet packet)
 {
     packet.ReadUInt32("Auction ID");
     var action = packet.ReadEnum<AuctionHouseAction>("Action", TypeCode.UInt32);
     var error = packet.ReadEnum<AuctionHouseAction>("Error", TypeCode.UInt32);
     if (error == 0 && action > 0)
         packet.ReadUInt32("Bid Error");
 }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:8,代码来源:AuctionHouseHandler.cs

示例12: HandleAttackerStateUpdate

        public static void HandleAttackerStateUpdate(Packet packet)
        {
            var hitInfo = packet.ReadEnum<SpellHitInfo>("HitInfo", TypeCode.Int32);
            packet.ReadPackedGuid("AttackerGUID");
            packet.ReadPackedGuid("TargetGUID");
            packet.ReadInt32("Damage");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_3_9183))
                packet.ReadInt32("OverDamage");

            var subDmgCount = packet.ReadByte();
            for (var i = 0; i < subDmgCount; ++i)
            {
                packet.ReadInt32("SchoolMask", i);
                packet.ReadSingle("Float Damage", i);
                packet.ReadInt32("Int Damage", i);

                if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                    hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_ABSORB | SpellHitInfo.HITINFO_FULL_ABSORB))
                    packet.ReadInt32("Damage Absorbed", i);

                if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                    hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_RESIST | SpellHitInfo.HITINFO_FULL_RESIST))
                    packet.ReadInt32("Damage Resisted", i);
            }

            var victimStateTypeCode = ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_3_9183) ? TypeCode.Byte : TypeCode.Int32;
            packet.ReadEnum<VictimStates>("VictimState", victimStateTypeCode);
            packet.ReadInt32("Unk Attacker State 0");

            packet.ReadEntryWithName<Int32>(StoreNameType.Spell, "Melee Spell ID ");

            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_BLOCK))
                packet.ReadInt32("Block Amount");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_RAGE_GAIN))
                packet.ReadInt32("Rage Gained");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_UNK0))
            {
                packet.ReadInt32("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadInt32("Unk Attacker State 3");
                packet.ReadInt32("Unk Attacker State 3");
                packet.ReadInt32("Unk Attacker State 3");
            }
        }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:57,代码来源:CombatHandler.cs

示例13: HandleGuildFinderSetGuildPost422

 public static void HandleGuildFinderSetGuildPost422(Packet packet)
 {
     packet.ReadBit("Join");
     packet.ReadEnum<GuildFinderOptionsAvailability>("Availability", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsRoles>("Class Roles", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsInterest>("Guild Interests", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsLevel>("Level", TypeCode.UInt32);
     packet.ReadCString("Comment");
 }
开发者ID:kandera,项目名称:WowPacketParser,代码行数:9,代码来源:GuildFinderHandler.cs

示例14: HandleInitializeFactions

 public static void HandleInitializeFactions(Packet packet)
 {
     var count = packet.ReadInt32("Count");
     for (var i = 0; i < count; i++)
     {
         packet.ReadEnum<FactionFlag>("Faction Flags", TypeCode.Byte, i);
         packet.ReadEnum<ReputationRank>("Faction Standing", TypeCode.UInt32, i);
     }
 }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:9,代码来源:ReputationHandler.cs

示例15: HandleGuildFinderSetGuildPost434

 public static void HandleGuildFinderSetGuildPost434(Packet packet)
 {
     packet.ReadEnum<GuildFinderOptionsLevel>("Level", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsAvailability>("Availability", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsInterest>("Guild Interests", TypeCode.UInt32);
     packet.ReadEnum<GuildFinderOptionsRoles>("Class Roles", TypeCode.UInt32);
     var length = packet.ReadBits(11);
     packet.ReadBit("Listed");
     packet.ReadWoWString("Comment", length);
 }
开发者ID:samaelsacred,项目名称:WowPacketParser,代码行数:10,代码来源:GuildFinderHandler.cs


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