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


C# Packet.ReadVector2方法代码示例

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


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

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

示例2: HandleGossipPoi

        public static void HandleGossipPoi(Packet packet)
        {
            PointsOfInterest gossipPOI = new PointsOfInterest();
            gossipPOI.ID = ++LastGossipPOIEntry;

            gossipPOI.Flags = (uint)packet.ReadInt32E<UnknownFlags>("Flags");
            var pos = packet.ReadVector2("Coordinates");
            gossipPOI.Icon = packet.ReadUInt32E<GossipPOIIcon>("Icon");
            gossipPOI.Importance = packet.ReadUInt32("Importance");
            gossipPOI.Name = packet.ReadCString("Icon Name");

            gossipPOI.PositionX = pos.X;
            gossipPOI.PositionY = pos.Y;

            Storage.GossipPOIs.Add(gossipPOI, packet.TimeSpan);
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:16,代码来源:NpcHandler.cs

示例3: HandleGossipPoi

        public static void HandleGossipPoi(Packet packet)
        {
            LastGossipPOIEntry++;

            var gossipPOI = new GossipPOI();

            gossipPOI.Flags = (uint) packet.ReadEnum<UnknownFlags>("Flags", TypeCode.Int32);
            var pos = packet.ReadVector2("Coordinates");
            gossipPOI.Icon = packet.ReadEnum<GossipPOIIcon>("Icon", TypeCode.UInt32);
            gossipPOI.Data = packet.ReadUInt32("Data");
            gossipPOI.IconName = packet.ReadCString("Icon Name");

            gossipPOI.XPos = pos.X;
            gossipPOI.YPos = pos.Y;

            Storage.GossipPOIs.Add(LastGossipPOIEntry, gossipPOI, packet.TimeSpan);
        }
开发者ID:RazorCore,项目名称:WowPacketParser,代码行数:17,代码来源:NpcHandler.cs

示例4: HandleGossipPoi

        public static void HandleGossipPoi(Packet packet)
        {
            ++LastGossipPOIEntry;

            var gossipPOI = new GossipPOI {Flags = packet.ReadBits("Flags", 14)};

            var bit84 = packet.ReadBits(6);
            var pos = packet.ReadVector2("Coordinates");
            gossipPOI.Icon = packet.ReadUInt32E<GossipPOIIcon>("Icon");
            gossipPOI.Importance = packet.ReadUInt32("Importance");
            gossipPOI.Name = packet.ReadWoWString("Name", bit84);

            gossipPOI.PositionX = pos.X;
            gossipPOI.PositionY = pos.Y;

            Storage.GossipPOIs.Add(LastGossipPOIEntry, gossipPOI, packet.TimeSpan);
        }
开发者ID:rob3ns,项目名称:PacketSniffer,代码行数:17,代码来源:NpcHandler.cs

示例5: HandleGossipPoi

        public static void HandleGossipPoi(Packet packet)
        {
            var flags = packet.ReadInt32();
            packet.Writer.WriteLine("Flags: 0x" + flags.ToString("X8"));

            var pos = packet.ReadVector2();
            packet.Writer.WriteLine("Coordinates: " + pos);

            var icon = (GossipPoiIcon)packet.ReadInt32();
            packet.Writer.WriteLine("Icon: " + icon);

            var data = packet.ReadInt32();
            packet.Writer.WriteLine("Data: " + data);

            var iconName = packet.ReadCString();
            packet.Writer.WriteLine("Icon Name: " + iconName);
        }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:17,代码来源:NpcHandler.cs

示例6: HandleGossipPoi

        public static void HandleGossipPoi(Packet packet)
        {
            PointsOfInterest gossipPOI = new PointsOfInterest();
            gossipPOI.ID = ++LastGossipPOIEntry;

            gossipPOI.Flags = packet.ReadBits("Flags", 14);
            uint bit84 = packet.ReadBits(6);

            Vector2 pos = packet.ReadVector2("Coordinates");
            gossipPOI.PositionX = pos.X;
            gossipPOI.PositionY = pos.Y;

            gossipPOI.Icon = packet.ReadUInt32E<GossipPOIIcon>("Icon");
            gossipPOI.Importance = packet.ReadUInt32("Importance");
            gossipPOI.Name = packet.ReadWoWString("Name", bit84);

            Storage.GossipPOIs.Add(gossipPOI, packet.TimeSpan);
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:18,代码来源:NpcHandler.cs

示例7: HandleGossipPoi

        public static void HandleGossipPoi(Packet packet)
        {
            LastGossipPOIEntry++;

            var gossipPOI = new GossipPOI
            {
                Flags = (uint) packet.ReadInt32E<UnknownFlags>("Flags")
            };

            var pos = packet.ReadVector2("Coordinates");
            gossipPOI.Icon = packet.ReadUInt32E<GossipPOIIcon>("Icon");
            gossipPOI.Importance = packet.ReadUInt32("Data");
            gossipPOI.Name = packet.ReadCString("Icon Name");

            gossipPOI.PositionX = pos.X;
            gossipPOI.PositionY = pos.Y;

            Storage.GossipPOIs.Add(LastGossipPOIEntry, gossipPOI, packet.TimeSpan);
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:19,代码来源:NpcHandler.cs

示例8: HandleBattlegroundPlayerPositions

 public static void HandleBattlegroundPlayerPositions(Packet packet)
 {
     var battlegroundPlayerPositionCount = packet.ReadInt32("BattlegroundPlayerPositionCount");
     for (int i = 0; i < battlegroundPlayerPositionCount; i++)
     {
         packet.ReadPackedGuid128("Guid", i);
         packet.ReadVector2("Pos", i);
         packet.ReadByte("IconID", i);
         packet.ReadByte("ArenaSlot", i);
     }
 }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:11,代码来源:BattlegroundHandler.cs

示例9: HandleServerMinimapPing

        public static void HandleServerMinimapPing(Packet packet)
        {
            if (packet.Direction == Direction.ServerToClient)
                packet.ReadGuid("GUID");

            var position = packet.ReadVector2();
            packet.Writer.WriteLine("Position: " + position);
        }
开发者ID:Asdcrew,项目名称:WowPacketParser,代码行数:8,代码来源:GroupHandler.cs

示例10: HandleServerMinimapPing

 public static void HandleServerMinimapPing(Packet packet)
 {
     packet.ReadPackedGuid128("Sender");
     packet.ReadVector2("Position");
 }
开发者ID:cyberbrest,项目名称:WowPacketParser,代码行数:5,代码来源:GroupHandler.cs

示例11: HandleMoveSetCompoundState

        public static void HandleMoveSetCompoundState(Packet packet)
        {
            packet.ReadPackedGuid128("MoverGUID");

            var moveStateChangeCount = packet.ReadInt32("MoveStateChangeCount");
            for (int i = 0; i < moveStateChangeCount; i++)
            {
                packet.ReadInt16("MessageID");
                packet.ReadInt32("SequenceIndex");

                packet.ResetBitReader();

                var bit12 = packet.ReadBit("HasSpeed");
                var bit32 = packet.ReadBit("HasKnockBack");
                var bit40 = packet.ReadBit("HasVehicle");
                var bit56 = packet.ReadBit("HasCollisionHeight");
                var bit104 = packet.ReadBit("HasMovementForce");
                var bit128 = packet.ReadBit("HasMoverGUID");

                if (bit12)
                    packet.ReadSingle("Speed");

                if (bit32)
                {
                    packet.ReadSingle("HorzSpeed");
                    packet.ReadVector2("InitVertSpeed");
                    packet.ReadSingle("InitVertSpeed");
                }

                if (bit40)
                    packet.ReadInt32("VehicleRecID");

                if (bit56)
                {
                    packet.ReadSingle("Height");
                    packet.ReadSingle("Scale");
                    packet.ReadBits("UpdateCollisionHeightReason", 2);
                }

                if (bit104)
                    ReadMovementForce(packet);

                if (bit128)
                    packet.ReadPackedGuid128("MoverGUID");
            }
        }
开发者ID:cyberbrest,项目名称:WowPacketParser,代码行数:46,代码来源:MovementHandler.cs

示例12: HandleBattlegrounPlayerPositions

        public static void HandleBattlegrounPlayerPositions(Packet packet)
        {
            if (packet.Direction == Direction.ClientToServer)
                return;

            var count1 = packet.ReadInt32("Count1");
            for (var i = 0; i < count1; i++)
            {
                packet.ReadGuid("Player GUID", i);
                packet.ReadVector2("Position", i);
            }

            var count2 = packet.ReadInt32("Count2");
            for (var i = 0; i < count2; i++)
            {
                packet.ReadGuid("Player GUID", i);
                packet.ReadVector2("Position", i);
            }
        }
开发者ID:skypeak,项目名称:WowPacketParser_SkyFire,代码行数:19,代码来源:BattlegroundHandler.cs

示例13: HandleServerMinimapPing

        public static void HandleServerMinimapPing(Packet packet)
        {
            if (packet.Direction == Direction.ServerToClient)
                packet.ReadGuid("GUID");

            packet.ReadVector2("Position");
        }
开发者ID:DDuarte,项目名称:WowPacketParser,代码行数:7,代码来源:GroupHandler.cs

示例14: ReadMovementUpdateBlock

        private static MovementInfo ReadMovementUpdateBlock(Packet packet, WowGuid guid, object index)
        {
            var moveInfo = new MovementInfo();

            packet.ResetBitReader();

            packet.ReadBit("NoBirthAnim", index);
            packet.ReadBit("EnablePortals", index);
            packet.ReadBit("PlayHoverAnim", index);

            var hasMovementUpdate = packet.ReadBit("HasMovementUpdate", index);
            var hasMovementTransport = packet.ReadBit("HasMovementTransport", index);
            var hasStationaryPosition = packet.ReadBit("Stationary", index);
            var hasCombatVictim = packet.ReadBit("HasCombatVictim", index);
            var hasServerTime = packet.ReadBit("HasServerTime", index);
            var hasVehicleCreate = packet.ReadBit("HasVehicleCreate", index);
            var hasAnimKitCreate = packet.ReadBit("HasAnimKitCreate", index);
            var hasRotation = packet.ReadBit("HasRotation", index);
            var hasAreaTrigger = packet.ReadBit("HasAreaTrigger", index);
            var hasGameObject = packet.ReadBit("HasGameObject", index);
            var hasSmoothPhasing = packet.ReadBit("HasSmoothPhasing", index);

            packet.ReadBit("ThisIsYou", index);

            var sceneObjCreate = packet.ReadBit("SceneObjCreate", index);
            var playerCreateData = packet.ReadBit("HasPlayerCreateData", index);

            if (hasMovementUpdate)
            {
                packet.ResetBitReader();
                packet.ReadPackedGuid128("MoverGUID", index);

                packet.ReadUInt32("MoveTime", index);
                moveInfo.Position = packet.ReadVector3("Position", index);
                moveInfo.Orientation = packet.ReadSingle("Orientation", index);

                packet.ReadSingle("Pitch", index);
                packet.ReadSingle("StepUpStartElevation", index);

                var removeForcesIDsCount = packet.ReadInt32();
                packet.ReadInt32("MoveIndex", index);

                for (var i = 0; i < removeForcesIDsCount; i++)
                    packet.ReadPackedGuid128("RemoveForcesIDs", index, i);

                moveInfo.Flags = packet.ReadBitsE<MovementFlag>("Movement Flags", 30, index);
                moveInfo.FlagsExtra = packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 18, index);

                var hasTransport = packet.ReadBit("Has Transport Data", index);
                var hasFall = packet.ReadBit("Has Fall Data", index);
                packet.ReadBit("HasSpline", index);
                packet.ReadBit("HeightChangeFailed", index);
                packet.ReadBit("RemoteTimeValid", index);

                if (hasTransport)
                {
                    packet.ResetBitReader();
                    moveInfo.TransportGuid = packet.ReadPackedGuid128("Transport Guid", index);
                    moveInfo.TransportOffset = packet.ReadVector4("Transport Position", index);
                    packet.ReadSByte("Transport Seat", index);
                    packet.ReadInt32("Transport Time", index);

                    var hasPrevMoveTime = packet.ReadBit("HasPrevMoveTime", index);
                    var hasVehicleRecID = packet.ReadBit("HasVehicleRecID", index);

                    if (hasPrevMoveTime)
                        packet.ReadUInt32("PrevMoveTime", index);

                    if (hasVehicleRecID)
                        packet.ReadUInt32("VehicleRecID", index);
                }

                if (hasFall)
                {
                    packet.ResetBitReader();
                    packet.ReadUInt32("Fall Time", index);
                    packet.ReadSingle("JumpVelocity", index);

                    var hasFallDirection = packet.ReadBit("Has Fall Direction", index);
                    if (hasFallDirection)
                    {
                        packet.ReadVector2("Fall", index);
                        packet.ReadSingle("Horizontal Speed", index);
                    }
                }

                moveInfo.WalkSpeed = packet.ReadSingle("WalkSpeed", index) / 2.5f;
                moveInfo.RunSpeed = packet.ReadSingle("RunSpeed", index) / 7.0f;
                packet.ReadSingle("RunBackSpeed", index);
                packet.ReadSingle("SwimSpeed", index);
                packet.ReadSingle("SwimBackSpeed", index);
                packet.ReadSingle("FlightSpeed", index);
                packet.ReadSingle("FlightBackSpeed", index);
                packet.ReadSingle("TurnRate", index);
                packet.ReadSingle("PitchRate", index);

                var movementForceCount = packet.ReadInt32("MovementForceCount", index);

                packet.ResetBitReader();

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

示例15: ReadFallData

        public static void ReadFallData(Packet packet, params object[] idx)
        {
            packet.ReadUInt32("FallTime", idx);
            packet.ReadSingle("JumpVelocity", idx);

            packet.ResetBitReader();

            var bit20 = packet.ReadBit("HasFallDirection", idx);
            if (bit20)
            {
                packet.ReadVector2("Direction", idx);
                packet.ReadSingle("HorizontalSpeed", idx);
            }
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:14,代码来源:MovementHandler.cs


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