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


C# Guid.GetHighType方法代码示例

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


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

示例1: ProcessExistingObject

 private static void ProcessExistingObject(ref WoWObject obj, WoWObject newObj, Guid guid)
 {
     obj.PhaseMask |= newObj.PhaseMask;
     if (guid.GetHighType() == HighGuidType.Unit) // skip if not an unit
     {
         if (!obj.Movement.HasWpsOrRandMov)
             if (obj.Movement.Position != newObj.Movement.Position)
             {
                 UpdateField uf;
                 if (obj.UpdateFields.TryGetValue(UpdateFields.GetUpdateField(UnitField.UNIT_FIELD_FLAGS), out uf))
                     if ((uf.UInt32Value & (uint) UnitFlags.IsInCombat) == 0) // movement could be because of aggro so ignore that
                         obj.Movement.HasWpsOrRandMov = true;
             }
     }
 }
开发者ID:Huri,项目名称:WowPacketParser,代码行数:15,代码来源:UpdateHandler.cs

示例2: HandlePetSpells

        public static void HandlePetSpells(Packet packet)
        {
            var guid64 = packet.ReadUInt64();
            // Equal to "Clear spells" pre cataclysm
            if (guid64 == 0)
                return;

            var guid = new Guid(guid64);
            packet.WriteLine("GUID: " + guid);
            var isPet = guid.GetHighType() == HighGuidType.Pet;

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
                packet.ReadEnum<CreatureFamily>("Pet Family", TypeCode.UInt16); // vehicles -> 0

            packet.ReadUInt32("Unknown 1");

            // Following int8,int8,int16 is sent like int32
            /*var reactState = */ packet.ReadByte("React state"); // 1
            /*var commandState = */ packet.ReadByte("Command state"); // 1
            packet.ReadUInt16("Unknown 2"); // pets -> 0, vehicles -> 0x800 (2048)

            for (var i = 1; i <= (int)MiscConstants.CreatureMaxSpells + 2; i++) // Read pet/vehicle spell ids
            {
                var spell16 = packet.ReadUInt16();
                var spell8 = packet.ReadByte();
                var slotid = packet.ReadByte();
                var spellId = spell16 + (spell8 << 16);
                if (!isPet) // cleanup vehicle spells (start at 1 instead 8,
                {           // and do not print spells with id 0)
                    slotid -= (int)MiscConstants.PetSpellsOffset - 1;
                    if (spellId == 0)
                        continue;
                }

                packet.WriteLine("Spell " + slotid + ": " + StoreGetters.GetName(StoreNameType.Spell, spellId));
            }

            var spellCount = packet.ReadByte(); // vehicles -> 0, pets -> != 0. Could this be auras?
            packet.WriteLine("Spell count: " + spellCount);

            for (var i = 0; i < spellCount; i++)
            {
                // Sent as int32
                var spellId = packet.ReadUInt16();
                var active = packet.ReadInt16();
                packet.WriteLine("Spell " + i + ": " + StoreGetters.GetName(StoreNameType.Spell, spellId) + ", active: " + active);
            }

            var cdCount = packet.ReadByte();
            packet.WriteLine("Cooldown count: " + cdCount);

            for (var i = 0; i < cdCount; i++)
            {
                var spellId = ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767) ? packet.ReadInt32() : packet.ReadUInt16();

                var category = packet.ReadUInt16();
                var cooldown = packet.ReadUInt32();
                var categoryCooldown = packet.ReadUInt32();

                packet.WriteLine("Cooldown: Spell: " + StoreGetters.GetName(StoreNameType.Spell, spellId) + " category: " + category +
                    " cooldown: " + cooldown + " category cooldown: " + categoryCooldown);
            }
        }
开发者ID:Chaplain,项目名称:WowPacketParser,代码行数:63,代码来源:PetHandler.cs

示例3: HandlePetSpells

        public static void HandlePetSpells(Packet packet)
        {
            var guid64 = packet.ReadUInt64();
            if (guid64 == 0) // Sent when player leaves vehicle - empty packet
                return;

            var guid = new Guid(guid64);
            packet.Writer.WriteLine("GUID: " + guid);
            var isPet = guid.GetHighType() == HighGuidType.Pet;

            var family = (CreatureFamily)packet.ReadUInt16();
            packet.Writer.WriteLine("Pet Family: " + family); // vehicles -> 0

            var unk1 = packet.ReadUInt32(); // 0
            packet.Writer.WriteLine("Unknown 1: " + unk1);

            // Following int8,int8,int16 is sent like int32
            var reactState = packet.ReadByte(); // 1
            packet.Writer.WriteLine("React state: " + reactState);

            var commandState = packet.ReadByte(); // 1
            packet.Writer.WriteLine("Command state: " + commandState);

            var unk2 = packet.ReadUInt16(); // pets -> 0, vehicles -> 0x800 (2048)
            packet.Writer.WriteLine("Unknown 2: " + unk2);

            for (var i = 1; i <= (int)MiscConstants.CreatureMaxSpells + 2; i++) // Read pet/vehicle spell ids
            {
                var spell16 = packet.ReadUInt16();
                var spell8 = packet.ReadByte();
                var slotid = packet.ReadSByte();
                var spellId = spell16 | spell8;
                if (!isPet) // cleanup vehicle spells (start at 1 instead 8,
                {           // and do not print spells with id 0)
                    slotid -= (int)MiscConstants.PetSpellsOffset - 1;
                    if (spellId == 0)
                        continue;
                }
                packet.Writer.WriteLine("Spell " + slotid + ": " + StoreGetters.GetName(StoreNameType.Spell, spellId));
            }

            var spellCount = packet.ReadByte(); // vehicles -> 0, pets -> != 0. Could this be auras?
            packet.Writer.WriteLine("Spell count: " + spellCount);

            for (var i = 0; i < spellCount; i++)
            {
                // Sent as int32
                var spellId = packet.ReadUInt16();
                var active = packet.ReadInt16();
                packet.Writer.WriteLine("Spell " + i + ": " + StoreGetters.GetName(StoreNameType.Spell, spellId) + ", active: " + active);
            }

            var cdCount = packet.ReadByte();
            packet.Writer.WriteLine("Cooldown count: " + cdCount);

            for (var i = 0; i < cdCount; i++)
            {
                var spellId = packet.ReadInt32();
                var category = packet.ReadUInt16();
                var cooldown = packet.ReadUInt32();
                var categoryCooldown = packet.ReadUInt32();

                packet.Writer.WriteLine("Cooldown: Spell: " + StoreGetters.GetName(StoreNameType.Spell, spellId) + " category: " + category +
                    " cooldown: " + cooldown + " category cooldown: " + categoryCooldown);
            }
        }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:66,代码来源:PetHandler.cs


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