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


C# Packet.ReadGuidByte方法代码示例

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


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

示例1: HandlePhaseShift422

        public static void HandlePhaseShift422(Packet packet)
        {
            var GuidFlag = packet.ReadEnum<BitMask>("Guid Mask Flags",TypeCode.Byte);

            if (GuidFlag.HasFlag(BitMask.Byte0))
                packet.ReadGuidByte(0);

            if (GuidFlag.HasFlag(BitMask.Byte4))
                packet.ReadGuidByte(4);// packet.ReadByte("Unk Byte 3");

            var CountOfBytes1 = packet.ReadUInt32("Count of bytes 1");
            byte[] bytes1 = null;

            if (CountOfBytes1 > 0)
            {
                packet.ReadUInt16("Map Swap 1"); // Map that is currently being loaded
                bytes1 = packet.ReadBytes((int)CountOfBytes1 - 2);
            }

            if (GuidFlag.HasFlag(BitMask.Byte3))
                packet.ReadGuidByte(3);// packet.ReadByte("Unk Byte 4");

            packet.ReadUInt32("Flag? "); // this is 0, 4 or 8, if 8 then its normal world

            if (GuidFlag.HasFlag(BitMask.Byte2))
                packet.ReadGuidByte(2);// packet.ReadByte("Unk Byte 5"); // flag Unk4

            var CountOfBytes2 = packet.ReadUInt32("Count of bytes 2");
            byte[] bytes2 = null;

            if (CountOfBytes2 > 0)
            {
                CurrentPhaseMask = packet.ReadUInt16("Current PhaseMask");
                bytes2 = packet.ReadBytes((int)CountOfBytes2 - 2);
            }

            if (!GuidFlag.HasFlag(BitMask.Byte2))
                packet.ReadGuidByte(6);// packet.ReadByte("Unk Byte 6");

            var CountOfBytes3 = packet.ReadUInt32("Count of bytes 3");
            byte[] bytes3 = null;

            if (CountOfBytes3 > 0)
            {
                packet.ReadUInt16("Map Swap 2");
                bytes3 = packet.ReadBytes((int)CountOfBytes3 - 2);
            }

            if (GuidFlag.HasFlag(BitMask.Byte7))
                packet.ReadGuidByte(7);// packet.ReadByte("Unk Byte 7");

            var CountOfBytes4 = packet.ReadUInt32("Count of bytes 4");
            byte[] bytes4 = null;

            if (CountOfBytes4 > 0)
            {
                packet.ReadUInt16("Map Swap 3"); // Should always match 'Map Swap 1'
                bytes4 = packet.ReadBytes((int)CountOfBytes4 - 2);
            }

            if (GuidFlag.HasFlag(BitMask.Byte1))
                packet.ReadGuidByte(1);// packet.ReadByte("Unk Byte 8");

            if (GuidFlag.HasFlag(BitMask.Byte5))
                packet.ReadGuidByte(5);// packet.ReadByte("Unk Byte 9");

            packet.Writer.WriteLine("Guid: " + packet.ReadBitstreamedGuid().ToString());
        }
开发者ID:Subv,项目名称:WowPacketParser,代码行数:68,代码来源:MovementHandler.cs

示例2: HandleVendorInventoryList422

        public static void HandleVendorInventoryList422(Packet packet)
        {
            var npcVendor = new NpcVendor();

            var flags = packet.ReadEnum<BitMask>("GUID Byte Mask", TypeCode.Byte);

            if (flags.HasAnyFlag(BitMask.Byte2))
                packet.ReadGuidByte(2);

            var itemCount = packet.ReadUInt32("Item Count");

            if (flags.HasAnyFlag(BitMask.Byte5))
                packet.ReadGuidByte(5);

            if (flags.HasAnyFlag(BitMask.Byte0)) // Flag?
                packet.ReadGuidByte(0);

            if (flags.HasAnyFlag(BitMask.Byte1)) // Flag?
                packet.ReadGuidByte(1);

            if (flags.HasAnyFlag(BitMask.Byte3)) // Flag?
                packet.ReadGuidByte(3);

            if (flags.HasAnyFlag(BitMask.Byte4))
                packet.ReadGuidByte(4);

            if (flags.HasAnyFlag(BitMask.Byte7)) // Flag?
                packet.ReadGuidByte(7);

            if (!flags.HasAnyFlag(BitMask.Byte2)) // Flag?
                packet.ReadGuidByte(6);

            var guid = packet.ReadBitstreamedGuid();
            packet.Writer.WriteLine("GUID: {0}", guid);

            npcVendor.VendorItems = new List<VendorItem>((int)itemCount);
            for (var i = 0; i < itemCount; i++)
            {
                var vendorItem = new VendorItem();

                packet.ReadInt32("Max Durability", i);
                vendorItem.Slot = packet.ReadUInt32("Item Position", i);
                vendorItem.ItemId = (uint)packet.ReadEntryWithName<Int32>(StoreNameType.Item, "Item ID", i);
                packet.ReadInt32("Unk Int32 1", i);
                packet.ReadInt32("Display ID", i);
                vendorItem.MaxCount = packet.ReadInt32("Max Count", i);
                vendorItem.BuyCount = packet.ReadUInt32("Buy Count", i);
                vendorItem.ExtendedCostId = packet.ReadUInt32("Extended Cost", i);
                packet.ReadInt32("Unk Int32 2", i);
                packet.ReadInt32("Price", i);

                npcVendor.VendorItems.Add(vendorItem);
            }

            Stuffing.NpcVendors.TryAdd(guid.GetEntry(), npcVendor);
        }
开发者ID:Subv,项目名称:WowPacketParser,代码行数:56,代码来源:NpcHandler.cs


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