• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Misc.Vector4类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Vector4类属于WowPacketParser.Misc命名空间,在下文中一共展示了Vector4类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TestToString

        public void TestToString()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            var quat = new Vector4(1.1f, 2.0f, 0f, 4.0f);

            Assert.AreEqual("X: 1.1 Y: 2 Z: 0 O: 4", quat.ToString());
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:8,代码来源:Vector4Test.cs


示例2: TestGetHashCode

        public void TestGetHashCode()
        {
            var vect1 = new Vector4(1.1f, 2.0f, 0f, 4.0f);
            var vect15 = new Vector4(1.1f, 2.0f, 0f, 4.0f);
            var vect2 = new Vector4(1.1f, 2.0f, 0.0001f, 4.0f);

            Assert.AreEqual(vect1.GetHashCode(), vect15.GetHashCode());
            Assert.AreNotEqual(vect1.GetHashCode(), vect2.GetHashCode());
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:9,代码来源:Vector4Test.cs


示例3: TestConstructor

 public void TestConstructor()
 {
     var vect = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);
     Assert.IsNotNull(vect);
     Assert.AreEqual(1.0f, vect.X);
     Assert.AreEqual(2.0f, vect.Y);
     Assert.AreEqual(3.0f, vect.Z);
     Assert.AreEqual(4.0f, vect.O);
 }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:9,代码来源:Vector4Test.cs


示例4: TestEquals

        public void TestEquals()
        {
            var vect1 = new Vector4(1.1f, 2.0f, 0f, 4.0f);
            var vect15 = new Vector4(1.1f, 2.0f, 0f, 4.0f);
            var vect2 = new Vector4(1.1f, 2.0f, 3.0f, 4.0f);

            Assert.IsTrue(vect1.Equals(vect15));
            Assert.IsTrue(vect1.Equals(vect1));
            Assert.IsFalse(vect1.Equals(vect2));
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:10,代码来源:Vector4Test.cs


示例5: TestOperators

        public void TestOperators()
        {
            var vect1 = new Vector4(1.1f, 2.0f, 0f, 4.0f);
            var vect15 = new Vector4(1.1f, 2.0f, 0f, 4.0f);
            var vect2 = new Vector4(1.1f, 2.0f, 3.0f, 4.0f);

            Assert.IsTrue(vect1 == vect15);
            #pragma warning disable 1718
            Assert.IsTrue(vect1 == vect1);
            #pragma warning restore 1718
            Assert.IsFalse(vect1 == vect2);
        }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:12,代码来源:Vector4Test.cs


示例6: HandleLoginVerifyWorld

        public static void HandleLoginVerifyWorld(Packet packet)
        {
            var pos = new Vector4();

            pos.Z = packet.ReadSingle();
            packet.ReadInt32<MapId>("Map");
            pos.Y = packet.ReadSingle();
            pos.X = packet.ReadSingle();
            pos.O = packet.ReadSingle();

            packet.AddValue("Position", pos);
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:12,代码来源:MovementHandler.cs


示例7: HandleLoginVerifyWorld

        public static void HandleLoginVerifyWorld(Packet packet)
        {
            var pos = new Vector4();

            pos.X = packet.ReadSingle();
            pos.O = packet.ReadSingle();
            pos.Y = packet.ReadSingle();
            CoreParsers.MovementHandler.CurrentMapId = (uint)packet.ReadInt32<MapId>("Map");
            pos.Z = packet.ReadSingle();

            packet.AddValue("Position", pos);
            packet.AddSniffData(StoreNameType.Map, (int)CoreParsers.MovementHandler.CurrentMapId, "NEW_WORLD");
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:13,代码来源:MovementHandler.cs


示例8: ReadPlayerMovementInfo

        public static void ReadPlayerMovementInfo(Packet packet, params MovementStatusElements[] movementStatusElements)
        {
            var guid = new byte[8];
            var transportGUID = new byte[8];

            var pos = new Vector4();
            var transportPos = new Vector4();

            bool hasMovementFlags = false;
            bool hasMovementFlags2 = false;
            bool hasTimestamp = false;
            bool hasOrientation = false;
            bool hasTransportData = false;
            bool hasTransportTime2 = false;
            bool hasTransportTime3 = false;
            bool hasPitch = false;
            bool hasFallData = false;
            bool hasFallDirection = false;
            bool hasSplineElevation = false;
            bool hasUnkTime = false;
            bool hasUnkBitA = false;

            uint count = 0;

            foreach (var movementInfo in movementStatusElements)
            {
                switch (movementInfo)
                {
                    case MovementStatusElements.MSEHasGuidByte0:
                        guid[0] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasGuidByte1:
                        guid[1] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasGuidByte2:
                        guid[2] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasGuidByte3:
                        guid[3] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasGuidByte4:
                        guid[4] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasGuidByte5:
                        guid[5] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasGuidByte6:
                        guid[6] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasGuidByte7:
                        guid[7] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte0:
                        if (hasTransportData)
                            transportGUID[0] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte1:
                        if (hasTransportData)
                            transportGUID[1] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte2:
                        if (hasTransportData)
                            transportGUID[2] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte3:
                        if (hasTransportData)
                            transportGUID[3] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte4:
                        if (hasTransportData)
                            transportGUID[4] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte5:
                        if (hasTransportData)
                            transportGUID[5] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte6:
                        if (hasTransportData)
                            transportGUID[6] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEHasTransportGuidByte7:
                        if (hasTransportData)
                            transportGUID[7] = packet.ReadBit();
                        break;
                    case MovementStatusElements.MSEGuidByte0:
                        packet.ReadXORByte(guid, 0);
                        break;
                    case MovementStatusElements.MSEGuidByte1:
                        packet.ReadXORByte(guid, 1);
                        break;
                    case MovementStatusElements.MSEGuidByte2:
                        packet.ReadXORByte(guid, 2);
                        break;
                    case MovementStatusElements.MSEGuidByte3:
                        packet.ReadXORByte(guid, 3);
                        break;
                    case MovementStatusElements.MSEGuidByte4:
                        packet.ReadXORByte(guid, 4);
                        break;
                    case MovementStatusElements.MSEGuidByte5:
//.........这里部分代码省略.........
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:101,代码来源:MovementHandler.cs


示例9: HandleSubmitComplain

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

            guid[5] = packet.ReadBit();
            guid[0] = packet.ReadBit();
            guid[1] = packet.ReadBit();

            var length = packet.ReadBits(12);

            guid[3] = packet.ReadBit();
            guid[2] = packet.ReadBit();
            guid[4] = packet.ReadBit();
            guid[7] = packet.ReadBit();

            packet.ReadBits("Unk bits", 4); // ##

            guid[6] = packet.ReadBit();

            packet.ReadXORByte(guid, 3);
            packet.ReadXORByte(guid, 5);
            packet.ReadXORByte(guid, 1);
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 6);
            packet.ReadXORByte(guid, 0);

            packet.ReadWoWString("Text", length);

            packet.ReadXORByte(guid, 7);
            packet.ReadXORByte(guid, 4);

            pos.Y = packet.ReadSingle();
            pos.Z = packet.ReadSingle();
            pos.X = packet.ReadSingle();
            packet.ReadInt32("Unk Int32 1"); // ##
            pos.O = packet.ReadSingle();

            packet.ReadBit("Unk bit"); // ##

            var count = packet.ReadBits("Count", 22);
            var strLength = new uint[count];
            for (int i = 0; i < count; ++i)
                strLength[i] = packet.ReadBits(13);

            for (int i = 0; i < count; ++i)
            {
                packet.ReadTime("Time", i);
                packet.ReadWoWString("Data", strLength[i], i);
            }

            packet.ReadInt32("Unk Int32 2");  // ##

            packet.WriteGuid("Guid", guid);
            packet.AddValue("Position", pos);
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:56,代码来源:TicketHandler.cs


示例10: HandleMoveHeartbeat

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

            var pos = new Vector4();

            var hasTransportTime2 = false;
            var hasTransportTime3 = false;
            var hasFallDirection = false;

            pos.X = packet.ReadSingle();
            pos.Y = packet.ReadSingle();
            pos.Z = packet.ReadSingle();

            guid[2] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            var hasPitch = !packet.ReadBit();
            var hasFallData = packet.ReadBit();
            var bits98 = (int)packet.ReadBits(22);
            var bit95 = packet.ReadBit();
            guid[1] = packet.ReadBit();
            guid[3] = packet.ReadBit();
            var hasTrans = packet.ReadBit();
            guid[5] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            guid[4] = packet.ReadBit();
            var hasOrientation = !packet.ReadBit();
            var bit94 = packet.ReadBit();
            var bitA8 = !packet.ReadBit();
            var hasTimestamp = !packet.ReadBit();
            guid[0] = packet.ReadBit();
            var bitAC = packet.ReadBit();
            var hasMovementFlagExtra = !packet.ReadBit();
            var bit90 = !packet.ReadBit();
            var hasMovementFlag = !packet.ReadBit();

            if (hasMovementFlagExtra)
                packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 13);

            if (hasTrans)
            {
                transportGuid[3] = packet.ReadBit();
                hasTransportTime3 = packet.ReadBit();
                transportGuid[4] = packet.ReadBit();
                transportGuid[6] = packet.ReadBit();
                transportGuid[7] = packet.ReadBit();
                transportGuid[0] = packet.ReadBit();
                transportGuid[2] = packet.ReadBit();
                hasTransportTime2 = packet.ReadBit();
                transportGuid[1] = packet.ReadBit();
                transportGuid[5] = packet.ReadBit();
            }

            if (hasFallData)
                hasFallDirection = packet.ReadBit();

            if (hasMovementFlag)
                packet.ReadBitsE<MovementFlag>("Movement Flags", 30);

            packet.ReadXORByte(guid, 3);
            packet.ReadXORByte(guid, 5);
            packet.ReadXORByte(guid, 4);
            packet.ReadXORByte(guid, 6);
            packet.ReadXORByte(guid, 1);
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 7);

            for (var i = 0; i < bits98; ++i)
                packet.ReadInt32("IntED", i);

            packet.ReadXORByte(guid, 0);

            if (hasTrans)
            {
                var tpos = new Vector4();

                tpos.Y = packet.ReadSingle();
                tpos.X = packet.ReadSingle();
                packet.ReadByte("Transport Seat");
                packet.ReadXORByte(transportGuid, 7);
                tpos.O = packet.ReadSingle();
                packet.ReadXORByte(transportGuid, 1);
                packet.ReadXORByte(transportGuid, 0);
                packet.ReadXORByte(transportGuid, 2);

                if (hasTransportTime3)
                    packet.ReadUInt32("Transport Time 3");

                packet.ReadXORByte(transportGuid, 3);
                packet.ReadUInt32("Transport Time");

                if (hasTransportTime2)
                    packet.ReadUInt32("Transport Time 2");

                packet.ReadXORByte(transportGuid, 5);
                tpos.Z = packet.ReadSingle();
                packet.ReadXORByte(transportGuid, 4);
                packet.ReadXORByte(transportGuid, 6);

//.........这里部分代码省略.........
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:101,代码来源:MovementHandler.cs


示例11: HandleMoveTeleport434

        public static void HandleMoveTeleport434(Packet packet)
        {
            var guid = new byte[8];
            var transGuid = new byte[8];
            var pos = new Vector4();

            guid[6] = packet.ReadBit();
            guid[0] = packet.ReadBit();
            guid[3] = packet.ReadBit();
            guid[2] = packet.ReadBit();
            var bit48 = packet.ReadBit();
            if (bit48)
            {
                packet.ReadBit("Unk bit 50");
                packet.ReadBit("Unk bit 51");
            }

            var onTransport = packet.ReadBit("On transport");
            guid[1] = packet.ReadBit();
            if (onTransport)
                transGuid = packet.StartBitStream(1, 3, 2, 5, 0, 7, 6, 4);

            guid[4] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            guid[5] = packet.ReadBit();
            if (onTransport)
            {
                packet.ParseBitStream(transGuid, 5, 6, 1, 7, 0, 2, 4, 3);
                packet.WriteGuid("Transport Guid", transGuid);
            }

            packet.ReadUInt32("Time");
            packet.ReadXORByte(guid, 1);
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 3);
            packet.ReadXORByte(guid, 5);
            pos.X = packet.ReadSingle();
            packet.ReadXORByte(guid, 4);
            pos.O = packet.ReadSingle();
            packet.ReadXORByte(guid, 7);
            pos.Z = packet.ReadSingle();
            if (bit48)
                packet.ReadUInt32("Unk int");

            packet.ReadXORByte(guid, 0);
            packet.ReadXORByte(guid, 6);
            pos.Y = packet.ReadSingle();

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


示例12: HandleMoveUpdateRunSpeed

        public static void HandleMoveUpdateRunSpeed(Packet packet)
        {
            var guid = new byte[8];
            var transportGuid = new byte[8];
            var pos = new Vector4();

            var hasTransportTime3 = false;
            var hasTransportTime2 = false;

            guid[7] = packet.ReadBit();

            var hasPitch = !packet.ReadBit();

            guid[0] = packet.ReadBit();
            var hasFallData = packet.ReadBit();
            packet.StartBitStream(guid, 1, 4, 5);

            var hasMovementFlags = !packet.ReadBit();

            var hasFallDirection = false;
            if (hasFallData)
                hasFallDirection = packet.ReadBit();

            guid[2] = packet.ReadBit();

            packet.ReadBit("Has spline data");

            var hasMovementFlagsExtra = !packet.ReadBit();
            var hasTransport = packet.ReadBit();
            var hasSplineElevation = !packet.ReadBit();
            var bitA8 = !packet.ReadBit();
            var hasTime = !packet.ReadBit();

            if (hasTransport)
            {
                hasTransportTime3 = packet.ReadBit();
                hasTransportTime2 = packet.ReadBit();
                packet.StartBitStream(transportGuid, 4, 5, 3, 2, 7, 0, 1, 6);
            }

            var bit95 = packet.ReadBit();

            if (hasMovementFlagsExtra)
                packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 13);

            if (hasMovementFlags)
                packet.ReadBitsE<MovementFlag>("Movement flags", 30);

            var hasO = !packet.ReadBit();

            guid[3] = packet.ReadBit();

            var counter = packet.ReadBits(22);
            var bit94 = packet.ReadBit();

            guid[6] = packet.ReadBit();
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 4);

            if (hasTransport)
            {
                var tpos = new Vector4();

                packet.ReadXORByte(transportGuid, 7);

                if (hasTransportTime3)
                    packet.ReadUInt32("Transport Time 3");

                tpos.O = packet.ReadSingle();

                packet.ReadXORByte(transportGuid, 1);
                packet.ReadXORByte(transportGuid, 6);
                packet.ReadXORByte(transportGuid, 0);

                if (hasTransportTime2)
                    packet.ReadUInt32("Transport Time 2");

                packet.ReadSByte("Transport Seat");
                tpos.Z = packet.ReadSingle();
                tpos.Y = packet.ReadSingle();

                packet.ReadXORByte(transportGuid, 2);

                tpos.X = packet.ReadSingle();
                packet.ReadUInt32("Transport Time");

                packet.ReadXORByte(transportGuid, 4);
                packet.ReadXORByte(transportGuid, 5);
                packet.ReadXORByte(transportGuid, 3);

                packet.WriteGuid("Transport GUID", transportGuid);
                packet.AddValue("Transport Position", tpos);
            }

            if (hasFallData)
            {
                if (hasFallDirection)
                {
                    packet.ReadSingle("Fall Cos");
                    packet.ReadSingle("Fall Sin");
//.........这里部分代码省略.........
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:101,代码来源:MovementHandler.cs


示例13: HandleUnknown6754

        public static void HandleUnknown6754(Packet packet)
        {
            var guid1 = new byte[8];
            var guid2 = new byte[8];

            var bit64 = false;
            var bit6C = false;
            var bit90 = false;

            var pos = new Vector4();

            pos.O = packet.ReadSingle();
            pos.X = packet.ReadSingle();
            packet.ReadSingle("Float10");
            pos.X = packet.ReadSingle();
            pos.Z = packet.ReadSingle();

            var hasMovementFlags = !packet.ReadBit();
            guid1[1] = packet.ReadBit();
            var bit70 = packet.ReadBit();
            guid1[0] = packet.ReadBit();
            var bit94 = packet.ReadBit();

            if (hasMovementFlags)
                packet.ReadBitsE<MovementFlag>("Movement flags", 30);

            var bitB4 = packet.ReadBit();
            if (bit70)
            {
                bit6C = packet.ReadBit();
                packet.StartBitStream(guid2, 2, 7);
                bit64 = packet.ReadBit();
                packet.StartBitStream(guid2, 5, 4, 6, 0, 1, 3);
            }

            var bit98 = !packet.ReadBit();
            var bit9C = packet.ReadBit();
            packet.StartBitStream(guid1, 3, 5, 4);
            var bit78 = !packet.ReadBit();
            var bit38 = !packet.ReadBit();
            if (bit94)
                bit90 = packet.ReadBit();
            guid1[6] = packet.ReadBit();
            var bitsA0 = packet.ReadBits(22);
            var bit9D = packet.ReadBit();
            guid1[7] = packet.ReadBit();
            var bitB0 = !packet.ReadBit();
            guid1[2] = packet.ReadBit();
            var hasExtraMovementFlags = !packet.ReadBit();
            var bit28 = !packet.ReadBit();

            if (hasExtraMovementFlags)
                packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 13);

            if (bit70)
            {
                packet.ReadXORByte(guid2, 0);
                packet.ReadXORByte(guid2, 6);
                if (bit64)
                    packet.ReadInt32("Int60");
                packet.ReadXORByte(guid2, 1);
                packet.ReadXORByte(guid2, 4);
                packet.ReadInt32("Int5C");
                packet.ReadSingle("Float54");
                packet.ReadXORByte(guid2, 3);
                packet.ReadSingle("Float50");
                packet.ReadByte("Byte58");
                packet.ReadXORByte(guid2, 7);
                packet.ReadXORByte(guid2, 2);
                if (bit6C)
                    packet.ReadInt32("Int68");
                packet.ReadSingle("Float4C");
                packet.ReadXORByte(guid2, 5);
                packet.ReadSingle("Float48");
                packet.WriteGuid("Guid8", guid2);
            }

            packet.ReadXORByte(guid1, 1);
            packet.ReadXORByte(guid1, 6);
            if (bit38)
                packet.ReadSingle("Float38");
            packet.ReadXORByte(guid1, 0);
            if (bit78)
                packet.ReadSingle("Float78");
            packet.ReadXORByte(guid1, 4);
            packet.ReadXORByte(guid1, 5);
            if (bit98)
                packet.ReadSingle("Float98");
            if (bit94)
            {
                packet.ReadSingle("Float80");
                packet.ReadInt32("Int7C");
                if (bit90)
                {
                    packet.ReadSingle("Float88");
                    packet.ReadSingle("Float84");
                    packet.ReadSingle("Float8C");
                }

            }
//.........这里部分代码省略.........
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:101,代码来源:MovementHandler.cs


示例14: HandleMoveForceFlightSpeedChangeAck434

        public static void HandleMoveForceFlightSpeedChangeAck434(Packet packet)
        {
            var guid = new byte[8];
            var transportGuid = new byte[8];
            var hasTransTime2 = false;
            var hasTransTime3 = false;
            var hasFallDirection = false;
            var pos = new Vector4();

            packet.ReadInt32("Unk Int32 1"); // ##
            pos.Z = packet.ReadSingle();
            pos.X = packet.ReadSingle();
            pos.Y = packet.ReadSingle();
            packet.ReadSingle("Speed");
            guid[4] = packet.ReadBit();
            guid[5] = packet.ReadBit();
            packet.ReadBit();
            var hasMovementFlags = !packet.ReadBit();
            var hasSplineElev = !packet.ReadBit("Has Spline Elevation");
            guid[3] = packet.ReadBit();
            var hasMovementFlags2 = !packet.ReadBit();
            guid[7] = packet.ReadBit();
            var hasTrans = packet.ReadBit("Has transport");
            guid[0] = packet.ReadBit();
            var hasFallData = packet.ReadBit("Has fall data");
            var hasTime = !packet.ReadBit("Has timestamp");
            var hasPitch = !packet.ReadBit("Has pitch");
            packet.ReadBit("Has Spline");
            var hasO = !packet.ReadBit();
            guid[6] = packet.ReadBit();
            guid[2] = packet.ReadBit();
            guid[1] = packet.ReadBit();

            if (hasTrans)
            {
                transportGuid[6] = packet.ReadBit();
                transportGuid[1] = packet.ReadBit();
                transportGuid[7] = packet.ReadBit();
                hasTransTime2 = packet.ReadBit();
                transportGuid[0] = packet.ReadBit();
                hasTransTime3 = packet.ReadBit();
                transportGuid[3] = packet.ReadBit();
                transportGuid[2] = packet.ReadBit();
                transportGuid[5] = packet.ReadBit();
                transportGuid[4] = packet.ReadBit();
            }

            if (hasFallData)
                hasFallDirection = packet.ReadBit();

            if (hasMovementFlags2)
                packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 12);

            if (hasMovementFlags)
                packet.ReadBitsE<MovementFlag>("Movement Flags", 30);

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

            if (hasTrans)
            {
                var tpos = new Vector4();

                packet.ReadXORByte(transportGuid, 6);
                packet.ReadXORByte(transportGuid, 0);
                packet.ReadSByte("Transport Seat");

                if (hasTransTime2)
                    packet.ReadUInt32("Transport Time 2");

                tpos.O = packet.ReadSingle();
                packet.ReadXORByte(transportGuid, 1);
                packet.ReadXORByte(transportGuid, 5);

                if (hasTransTime3)
                    packet.ReadUInt32("Transport Time 3");

                packet.ReadXORByte(transportGuid, 2);
                tpos.Z = packet.ReadSingle();
                packet.ReadXORByte(transportGuid, 7);
                packet.ReadXORByte(transportGuid, 3);
                packet.ReadXORByte(transportGuid, 4);
                tpos.X = packet.ReadSingle();
                packet.ReadUInt32("Transport Time");
                tpos.Y = packet.ReadSingle();

                packet.WriteGuid("Transport Guid", transportGuid);
                packet.AddValue("Transport Position", tpos);
            }

            if (hasTime)
                packet.ReadUInt32("Timestamp");
            if (hasSplineElev)
                packet.ReadSingle("Spline elevation");

            if (hasFallData)
            {
                if (hasFallDirection)
                {
                    packet.ReadSingle("Fall Cos");
                    packet.ReadSingle("Fall Sin");
//.........这里部分代码省略.........
开发者ID:horn,项目名称:WowPacketParser,代码行数:101,代码来源:MovementHandler.cs


示例15: HandlePlayerMove434

        public static void HandlePlayerMove434(Packet packet)
        {
            var guid = new byte[8];
            var transportGuid = new byte[8];
            var hasFallDirection = false;
            var pos = new Vector4();

            var hasFallData = packet.ReadBit();
            guid[3] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            var hasMovementFlagsExtra = !packet.ReadBit();
            packet.ReadBit("Has spline data");
            var hasTime = !packet.ReadBit();
            guid[0] = packet.ReadBit();
            guid[1] = packet.ReadBit();
            if (hasMovementFlagsExtra)
                packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 12);

            guid[7] = packet.ReadBit();
            var hasMovementFlags = !packet.ReadBit();
            var hasO = !packet.ReadBit();
            guid[2] = packet.ReadBit();
            var hasSplineElevation = !packet.ReadBit();
            packet.ReadBit();
            guid[4] = packet.ReadBit();
            if (hasFallData)
                hasFallDirection = packet.ReadBit();

            guid[5] = packet.ReadBit();
            var hasTransport = packet.ReadBit();
            if (hasMovementFlags)
                packet.ReadBitsE<MovementFlag>("Movement flags", 30);

            var hasTransportTime3 = false;
            var hasTransportTime2 = false;
            if (hasTransport)
            {
                transportGuid[3] = packet.ReadBit();
                hasTransportTime3 = packet.ReadBit();
                transportGuid[6] = packet.ReadBit();
                transportGuid[1] = packet.ReadBit();
                transportGuid[7] = packet.ReadBit();
                transportGuid[0] = packet.ReadBit();
                transportGuid[4] = packet.ReadBit();
                hasTransportTime2 = packet.ReadBit();
                transportGuid[5] = packet.ReadBit();
                transportGuid[2] = packet.ReadBit();
            }

            var hasPitch = !packet.ReadBit();
            packet.ReadXORByte(guid, 5);
            if (hasFallData)
            {
                if (hasFallDirection)
                {
                    packet.ReadSingle("Horizontal speed");
                    packet.ReadSingle("Fall Cos");
                    packet.ReadSingle("Fall Sin");
                }

                packet.ReadSingle("Vertical speed");
                packet.ReadUInt32("Fall time");
            }

            if (hasSplineElevation)
                packet.ReadSingle("Spline elevation");

            packet.ReadXORByte(guid, 7);
            pos.Y = packet.ReadSingle();
            packet.ReadXORByte(guid, 3);
            if (hasTransport)
            {
                var tpos = new Vector4();
                if (hasTransportTime3)
                    packet.ReadUInt32("Transport Time 3");

                packet.ReadXORByte(transportGuid, 6);
                packet.ReadSByte("Transport Seat");
                packet.ReadXORByte(transportGuid, 5);
                tpos.X = packet.ReadSingle();
                packet.ReadXORByte(transportGuid, 1);
                tpos.O = packet.ReadSingle();
                packet.ReadXORByte(transportGuid, 2);
                if (hasTransportTime2)
                    packet.ReadUInt32("Transport Time 2");

                packet.ReadXORByte(transportGuid, 0);
                tpos.Z = packet.ReadSingle();
                packet.ReadXORByte(transportGuid, 7);
                packet.ReadXORByte(transportGuid, 4);
                packet.ReadXORByte(transportGuid, 3);
                tpos.Y = packet.ReadSingle();
                packet.ReadUInt32("Transport Time");

                packet.WriteGuid("Transport Guid", transportGuid);
                packet.AddValue("Transport Position", tpos);
            }

            packet.ReadXORByte(guid, 4);
            pos.X = packet.ReadSingle();
//.........这里部分代码省略.........
开发者ID:horn,项目名称:WowPacketParser,代码行数:101,代码来源:MovementHandler.cs


示例16: HandleSpellMove

        public static void HandleSpellMove(Packet packet)
        {
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
            {
                HandleSpellMove510(packet);
                return;
            }

            var hasMovement = packet.ReadBool("Has Movement Data");
            if (hasMovement)
            {
                var guid = new byte[8];
                var transportGuid = new byte[8];
                var hasTransTime2 = false;
                var hasTransTime3 = false;
                var hasFallDirection = false;
                var pos = new Vector4();

                pos.Z = packet.ReadSingle();
                pos.Y = packet.ReadSingle();
                pos.X = packet.ReadSingle();

                var bytes = new byte[8];
                var hasFallData = packet.ReadBit("Has fall data");
                var hasTime = !packet.ReadBit("Has timestamp");
                var hasO = !packet.ReadBit("Has O");
                packet.ReadBit("Has Spline");
                packet.ReadBit();
                guid[6] = bytes[4] = packet.ReadBit(); //6
                guid[4] = bytes[5] = packet.ReadBit(); //4
                var hasMovementFlags2 = !packet.ReadBit();
                var bytes2 = new byte[8];
                guid[3] = bytes2[0] = packet.ReadBit(); //3
                guid[5] = bytes2[1] = packet.ReadBit(); //5
                var hasSplineElev = !packet.ReadBit("Has Spline Elevation");
                var hasPitch = !packet.ReadBit("Has Pitch");
                guid[7] = bytes2[6] = packet.ReadBit(); //7
                var hasTrans = packet.ReadBit("Has transport");
                guid[2] = bytes2[5] = packet.ReadBit(); //2
                var hasMovementFlags = !packet.ReadBit();
                guid[1] = packet.ReadBit();
                guid[0] = packet.ReadBit();
                if (hasTrans)
                {
                    transportGuid[6] = packet.ReadBit();//54
                    transportGuid[2] = packet.ReadBit();//50
                    transportGuid[5] = packet.ReadBit();//53
                    hasTransTime2 = packet.ReadBit();
                    transportGuid[7] = packet.ReadBit();//55
                    transportGuid[4] = packet.ReadBit();//52
                    hasTransTime3 = packet.ReadBit();
                    transportGuid[0] = packet.ReadBit();//48
                    transportGuid[1] = packet.ReadBit();//49
                    transportGuid[3] = packet.ReadBit();//51
                }

                if (hasMovementFlags2)
                    packet.ReadBitsE<MovementFlagExtra>("Movement flags extra", 12);

                if (hasMovementFlags)
                    packet.ReadBitsE<MovementFlag>("Movement flags", 30);

                if (hasFallData)
                    hasFallDirection = packet.ReadBit("hasFallDirection");

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

                if (hasTrans)
                {
                    var tpos = new Vector4();
                    packet.ReadSByte("Transport Seat");
                    tpos.O = packet.ReadSingle();
                    packet.ReadUInt32("Transport Time");

                    packet.ReadXORByte(transportGuid, 6);
                    packet.ReadXORByte(transportGuid, 5);

                    if (hasTransTime2)
                        packet.ReadUInt32("Transport Time 2");

                    tpos.X = packet.ReadSingle();

                    packet.ReadXORByte(transportGuid, 4);

                    tpos.Z = packet.ReadSingle();

                    packet.ReadXORByte(transportGuid, 2);
                    packet.ReadXORByte(transportGuid, 0);

                    if (hasTransTime3)
                        packet.ReadUInt32("Transport Time 3");

                    packet.ReadXORByte(transportGuid, 1);
                    packet.ReadXORByte(transportGuid, 3);

                    tpos.Y = packet.ReadSingle();

                    packet.ReadXORByte(transportGuid, 7);

                    packet.WriteGuid("Transport Guid", transportGuid);
//.........这里部分代码省略.........
开发者ID:horn,项目名称:WowPacketParser,代码行数:101,代码来源:SpellHandler.cs


示例17: HandlePlayerMove

        public static void HandlePlayerMove(Packet packet)
        {
            var guid = new byte[8];
            var transportGUID = new byte[8];
            var pos = new Vector4();

            var bit95 = packet.ReadBit();
            var hasPitch = !packet.ReadBit();
            guid[4] = packet.ReadBit();
            guid[2] = packet.ReadBit();
            var bitAC = packet.ReadBit();
            var hasFallData = packet.ReadBit();
            guid[7] = packet.ReadBit();
            var counter2 = (int)packet.ReadBits(22);
            guid[5] = packet.ReadBit();
            guid[3] = packet.ReadBit();
            var hasTimeStamp = !packet.ReadBit();
            var hasTransportData = packet.ReadBit();
            var hasTransportTime2 = false;
            var hasTransportTime3 = false;

            if (hasTransportData)
            {
                packet.StartBitStream(transportGUID, 1, 2, 3, 4, 5);
                hasTransportTime3 = packet.ReadBit();
                hasTransportTime2 = packet.ReadBit();
                packet.StartBitStream(transportGUID, 0, 7, 6);
            }

            var hasMovementFlags = !packet.ReadBit();

            if (hasMovementFlags)
                packet.ReadBitsE<MovementFlag>("Movement Flags", 30);

            var hasOrientation = !packet.ReadBit();
            var isAlive = !packet.ReadBit();
            var hasFallDirection = false;
            if (hasFallData)
                hasFallDirection = packet.ReadBit();

            var hasExtraMovementFlags = !packet.ReadBit();
            guid[6] = packet.ReadBit();
            guid[0] = packet.ReadBit();
            guid[1] = packet.ReadBit();
            var bit94 = packet.ReadBit();

            if (hasExtraMovementFlags)
                packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 13);

            var hasSplineElevation = !packet.ReadBit();

            pos.X = packet.ReadSingle();

            if (hasFallData)
            {
                if (hasFallDirection)
                {
                    packet.ReadSingle("Fall Sin");
                    packet.ReadSingle("Horizontal Speed");
                    packet.ReadSingle("Fall Cos");
                }

                packet.ReadInt32("Fall Time");
                packet.ReadSingle("Velocity Speed");
            }

            packet.ReadXORByte(guid, 3);

            if (hasTransportData)
            {
                var transPos = new Vector4();

                packet.ReadXORByte(transportGUID, 2);
                packet.ReadXORByte(transportGUID, 0);
                packet.ReadXORByte(transportGUID, 5);
                packet.ReadByte("Seat");
                packet.ReadXORByte(transportGUID, 4);
                packet.ReadXORByte(transportGUID, 3);
                if (hasTransportTime2)
                    packet.ReadInt32("Transport Time 2");

                packet.ReadXORByte(transportGUID, 6);
                packet.ReadXORByte(transportGUID, 7);
                transPos.X = packet.ReadSingle();
                if (hasTransportTime3)
                    packet.ReadInt32("Transport Time 3");

                packet.ReadInt32("Transport Time");
                transPos.Z = packet.ReadSingle();
                packet.ReadXORByte(transportGUID, 1);
                transPos.Y = packet.ReadSingle();
                transPos.O = packet.ReadSingle();

                packet.WriteGuid("Transport Guid", transportGUID);
                packet.AddValue("Transport Position", transPos);
            }

            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 6);

//.........这里部分代码省略.........
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:101,代码来源:MovementHandler.cs


示例18: HandleMoveSetFacing

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

            var pos = new Vector4();

            var bit5C = false;
            var bit64 = false;
            var hasFallDirection = false;

            pos.Y = packet.ReadSingle();
            pos.X = packet.ReadSingle();
            pos.Z = packet.ReadSingle();

            var hasSplineElevation  = !packet.ReadBit();

            guid[6] = packet.ReadBit();
            guid[0] = packet.ReadBit();

            var hasRotation = packet.ReadBit();
            var hasTime = !packet.ReadBit();
            var bit20 = !packet.ReadBit();
            var hasTrans = packet.ReadBit();
            var bits98 = (int 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Misc.WowGuid类代码示例发布时间:2022-05-26
下一篇:
C# Misc.Packet类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap