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


C# Guid.GetLow方法代码示例

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


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

示例1: HandleNameQueryResponse

        public static void HandleNameQueryResponse(Packet packet)
        {
            var guid = packet.StartBitStream(3, 6, 7, 2, 5, 4, 0, 1);
            packet.ParseBitStream(guid, 5, 4, 7, 6, 1, 2);

            var nameData = !packet.ReadBoolean("not nameData");
            if (nameData)
            {
                packet.ReadInt32("unk108");
                packet.ReadInt32("unk36");
                packet.ReadEnum<Class>("Class", TypeCode.Byte);
                packet.ReadEnum<Race>("Race", TypeCode.Byte);
                packet.ReadByte("Level");
                packet.ReadEnum<Gender>("Gender", TypeCode.Byte);
            }
            packet.ParseBitStream(guid, 0, 3);

            packet.WriteGuid("Guid", guid);

            if (!nameData)
                return;

            var guid2 = new byte[8];
            var guid3 = new byte[8];

            guid2[2] = packet.ReadBit();
            guid2[7] = packet.ReadBit();
            guid3[7] = packet.ReadBit();
            guid3[2] = packet.ReadBit();
            guid3[0] = packet.ReadBit();
            var unk32 = packet.ReadBit();
            guid2[4] = packet.ReadBit();
            guid3[5] = packet.ReadBit();
            guid2[1] = packet.ReadBit();
            guid2[3] = packet.ReadBit();
            guid2[0] = packet.ReadBit();

            var len = new uint[5];
            for (var i = 5; i > 0; i--)
                len[i - 1] = packet.ReadBits(7);

            guid3[6] = packet.ReadBit();
            guid3[3] = packet.ReadBit();
            guid2[5] = packet.ReadBit();
            guid3[1] = packet.ReadBit();
            guid3[4] = packet.ReadBit();

            var len56 = packet.ReadBits(6);

            guid2[6] = packet.ReadBit();

            packet.ReadXORByte(guid3, 6);
            packet.ReadXORByte(guid3, 0);

            var name = packet.ReadWoWString("Name", len56);
            var playerGuid = new Guid(BitConverter.ToUInt64(guid, 0));
            StoreGetters.AddName(playerGuid, name);

            packet.ReadXORByte(guid2, 5);
            packet.ReadXORByte(guid2, 2);
            packet.ReadXORByte(guid3, 3);
            packet.ReadXORByte(guid2, 4);
            packet.ReadXORByte(guid2, 3);
            packet.ReadXORByte(guid3, 4);
            packet.ReadXORByte(guid3, 2);
            packet.ReadXORByte(guid2, 7);

            for (var i = 5; i > 0; i--)
                packet.ReadWoWString("str", len[i - 1], i);

            packet.ReadXORByte(guid2, 6);
            packet.ReadXORByte(guid3, 7);
            packet.ReadXORByte(guid3, 1);
            packet.ReadXORByte(guid2, 1);
            packet.ReadXORByte(guid3, 5);
            packet.ReadXORByte(guid2, 0);

            packet.WriteGuid("Guid2", guid2);
            packet.WriteGuid("Guid3", guid3);

            var objectName = new ObjectName
            {
                ObjectType = ObjectType.Player,
                Name = name,
            };
            Storage.ObjectNames.Add((uint)playerGuid.GetLow(), objectName, packet.TimeSpan);
        }
开发者ID:nelegalno,项目名称:WowPacketParser,代码行数:87,代码来源:QueryHandler.cs


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