本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadVector4方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadVector4方法的具体用法?C# Packet.ReadVector4怎么用?C# Packet.ReadVector4使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.ReadVector4方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleEnterWorld
public static void HandleEnterWorld(Packet packet)
{
CurrentMapId = (uint) packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
packet.ReadVector4("Position");
packet.AddSniffData(StoreNameType.Map, (int) CurrentMapId, "NEW_WORLD");
}
示例2: HandleEnterWorld
public static void HandleEnterWorld(Packet packet)
{
CurrentMapId = (uint) packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
packet.ReadVector4("Position");
WoWObject character;
if (Storage.Objects.TryGetValue(SessionHandler.LoginGuid, out character))
SessionHandler.LoggedInCharacter = (Player) character;
packet.AddSniffData(StoreNameType.Map, (int) CurrentMapId, "NEW_WORLD");
}
示例3: HandleMovementHeartbeat433
public static void HandleMovementHeartbeat433(Packet packet)
{
packet.ReadEnum<MovementFlag>("Movement flags", 30);
packet.ReadBit("HasSplineData");
var guidBytes = new byte[8];
guidBytes[0] = packet.ReadBit();
guidBytes[6] = packet.ReadBit();
guidBytes[1] = packet.ReadBit();
guidBytes[7] = packet.ReadBit();
guidBytes[2] = packet.ReadBit();
guidBytes[4] = packet.ReadBit();
guidBytes[3] = packet.ReadBit();
packet.ReadEnum<MovementFlagExtra>("Movement flags extra", 12);
guidBytes[5] = packet.ReadBit();
var splineElevation = packet.ReadBit("SplineElevation"); // OR Swimming
var onTransport = packet.ReadBit("OnTransport");
var transportBytes = new byte[8];
var hasInterpolatedMovement = false;
var time3 = false;
if (onTransport)
{
transportBytes = packet.StartBitStream(0, 6, 2, 5, 4, 1, 3, 7);
hasInterpolatedMovement = packet.ReadBit("HasInterpolatedMovement");
time3 = packet.ReadBit("Time3");
}
var swimming = packet.ReadBit("Swimming"); // OR SplineElevation
var interPolatedTurning = packet.ReadBit("InterPolatedTurning");
var jumping = false;
if (interPolatedTurning)
jumping = packet.ReadBit("Jumping");
packet.ReadInt32("Time");
packet.ReadVector4("Position");
packet.ReadXORByte(guidBytes, 7);
packet.ReadXORByte(guidBytes, 5);
if (splineElevation)
packet.ReadSingle("Spline Elevation");
packet.ReadXORByte(guidBytes, 1);
packet.ReadXORByte(guidBytes, 6);
packet.ReadXORByte(guidBytes, 4);
packet.ReadXORByte(guidBytes, 3);
if (onTransport)
{
packet.ReadByte("Transport Seat");
packet.ReadSingle("Transport Orientation");
packet.ReadVector3("Transport Position");
packet.ReadInt32("Transport Time");
if (hasInterpolatedMovement)
packet.ReadInt32("Transport Time 2");
packet.ReadXORByte(transportBytes, 3);
packet.ReadXORByte(transportBytes, 6);
if (time3)
packet.ReadInt32("Transport Time 3");
packet.ReadXORByte(transportBytes, 7);
packet.ReadXORByte(transportBytes, 5);
packet.ReadXORByte(transportBytes, 2);
packet.ReadXORByte(transportBytes, 1);
packet.ReadXORByte(transportBytes, 0);
packet.ReadXORByte(transportBytes, 4);
packet.WriteGuid("Transport Guid", transportBytes);
}
if (swimming)
packet.ReadSingle("Swim Pitch");
if (interPolatedTurning)
{
packet.ReadInt32("Time Fallen");
packet.ReadSingle("Fall Start Velocity");
if (jumping)
{
packet.ReadSingle("Jump Velocity");
packet.ReadSingle("Jump Cos");
packet.ReadSingle("Jump Sin");
}
}
packet.ReadXORByte(guidBytes, 2);
packet.ReadXORByte(guidBytes, 0);
packet.WriteGuid("Guid", guidBytes);
}
示例4: HandleEnterWorld
public static void HandleEnterWorld(Packet packet)
{
var mapId = packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
CurrentMapId = (uint)mapId;
var position = packet.ReadVector4();
packet.Writer.WriteLine("Position: " + position);
CurrentPosition = position;
UpdateHandler.Objects[CurrentMapId] = new Dictionary<Guid, WoWObject>();
if (packet.Opcode != Opcodes.GetOpcode(Opcode.SMSG_LOGIN_VERIFY_WORLD))
return;
Player chInfo;
if (!CharacterHandler.Characters.TryGetValue(SessionHandler.LoginGuid, out chInfo))
return;
SessionHandler.LoggedInCharacter = chInfo;
}
示例5: ReadMovementInfo
public static MovementInfo ReadMovementInfo(ref Packet packet, Guid guid, int index)
{
string prefix = index < 0 ? string.Empty : "[" + index + "] ";
var info = new MovementInfo();
info.Flags = packet.ReadEnum<MovementFlag>(prefix + "Movement Flags", TypeCode.Int32);
var flagsTypeCode = ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056) ? TypeCode.Int16 : TypeCode.Byte;
var flags = packet.ReadEnum<MovementFlagExtra>(prefix + "Extra Movement Flags", flagsTypeCode);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545))
if (packet.ReadGuid(prefix + "GUID 2") != guid)
packet.Writer.WriteLine("GUIDS NOT EQUAL"); // Fo debuggingz
packet.ReadInt32(prefix + "Time");
var pos = packet.ReadVector4(prefix + "Position");
info.Position = new Vector3(pos.X, pos.Y, pos.Z);
info.Orientation = pos.O;
if (info.Flags.HasAnyFlag(MovementFlag.OnTransport))
{
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
packet.ReadPackedGuid(prefix + "Transport GUID");
else
packet.ReadGuid(prefix + "Transport GUID");
packet.ReadVector4(prefix + "Transport Position");
packet.ReadInt32(prefix + "Transport Time");
if (ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing))
packet.ReadByte(prefix + "Transport Seat");
if (flags.HasAnyFlag(MovementFlagExtra.InterpolateMove))
packet.ReadInt32(prefix + "Transport Time");
}
if (info.Flags.HasAnyFlag(MovementFlag.Swimming | MovementFlag.Flying) ||
flags.HasAnyFlag(MovementFlagExtra.AlwaysAllowPitching))
packet.ReadSingle(prefix + "Swim Pitch");
if (ClientVersion.RemovedInVersion(ClientType.Cataclysm))
packet.ReadInt32(prefix + "Fall Time");
if (info.Flags.HasAnyFlag(MovementFlag.Falling))
{
if (ClientVersion.AddedInVersion(ClientType.Cataclysm))
packet.ReadInt32(prefix + "Fall Time");
packet.ReadSingle(prefix + "Fall Velocity");
packet.ReadSingle(prefix + "Fall Sin angle");
packet.ReadSingle(prefix + "Fall Cos angle");
packet.ReadSingle(prefix + "Fall Speed");
}
if (info.Flags.HasAnyFlag(MovementFlag.SplineElevation))
packet.ReadSingle(prefix + "Spline Elevation");
return info;
}
示例6: HandleUnk5
public static void HandleUnk5(Packet packet)
{
packet.ReadVector4("Position");
}
示例7: ReadMovementUpdateBlock
public static MovementInfo ReadMovementUpdateBlock(ref Packet packet, Guid guid, int index)
{
var moveInfo = new MovementInfo();
var flagsTypeCode = ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767) ? TypeCode.UInt16 : TypeCode.Byte;
var flags = packet.ReadEnum<UpdateFlag>("[" + index + "] Update Flags", flagsTypeCode);
if (flags.HasAnyFlag(UpdateFlag.Living))
{
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_0_14333))
moveInfo = MovementHandler.ReadMovementInfo420(ref packet, guid, index);
else
moveInfo = MovementHandler.ReadMovementInfo(ref packet, guid, index);
var moveFlags = moveInfo.Flags;
var speedCount = ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056) ? 9 : 8;
int speedShift;
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_1_0_13914) &&
ClientVersion.RemovedInVersion(ClientVersionBuild.V4_2_2_14545))
speedShift = 1; // enums shifted by one
else speedShift = 0;
for (var i = 0; i < speedCount - speedShift; i++)
{
var speedType = (SpeedType)(i + speedShift);
var speed = packet.ReadSingle("["+ index + "] " + speedType + " Speed");
switch (speedType)
{
case SpeedType.Walk:
{
moveInfo.WalkSpeed = speed / 2.5f;
break;
}
case SpeedType.Run:
{
moveInfo.RunSpeed = speed / 7.0f;
break;
}
}
}
if (moveFlags.HasAnyFlag(MovementFlag.SplineEnabled))
{
var splineFlags = packet.ReadEnum<SplineFlag>("Spline Flags", TypeCode.Int32, index);
if (splineFlags.HasAnyFlag(SplineFlag.FinalTarget))
packet.ReadGuid("Final Spline Target GUID", index);
else if (splineFlags.HasAnyFlag(SplineFlag.FinalOrientation))
{
if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_2_9056))
packet.ReadInt32(); // not sure, orientation is incorrect in 2.4.1, this int is probably involved
packet.ReadSingle("Final Spline Orientation", index);
}
else if (splineFlags.HasAnyFlag(SplineFlag.FinalPoint))
packet.ReadVector3("Final Spline Coords", index);
packet.ReadInt32("Spline Time", index);
packet.ReadInt32("Spline Full Time", index);
packet.ReadInt32("Spline Unk Int32 1", index);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
{
packet.ReadSingle("Spline Duration Multiplier", index);
packet.ReadSingle("Spline Unit Interval", index);
packet.ReadSingle("Spline Unk Float 2", index);
packet.ReadInt32("Spline Height Time", index);
}
var splineCount = packet.ReadInt32();
for (var i = 0; i < splineCount; i++)
packet.ReadVector3("Spline Waypoint", index, i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
packet.ReadEnum<SplineMode>("Spline Mode", TypeCode.Byte, index);
packet.ReadVector3("Spline Endpoint", index);
}
}
else // !UpdateFlag.Living
{
if (flags.HasAnyFlag(UpdateFlag.GOPosition))
{
packet.ReadPackedGuid("[" + index + "] GO Position GUID");
moveInfo.Position = packet.ReadVector3("[" + index + "] GO Position");
packet.ReadVector3("[" + index + "] GO Transport Position");
moveInfo.Orientation = packet.ReadSingle("[" + index + "] GO Orientation");
packet.ReadSingle("[" + index + "] GO Transport Orientation");
}
else if (flags.HasAnyFlag(UpdateFlag.StationaryObject))
packet.ReadVector4("[" + index + "] Stationary Position");
}
if (flags.HasAnyFlag(UpdateFlag.Unknown1))
packet.ReadInt32("[" + index + "] Unk Int32");
if (flags.HasAnyFlag(UpdateFlag.LowGuid))
//.........这里部分代码省略.........
示例8: HandleLoginVerifyWorld
public static void HandleLoginVerifyWorld(Packet packet)
{
WowPacketParser.Parsing.Parsers.MovementHandler.CurrentMapId = (uint)packet.ReadInt32<MapId>("Map");
packet.ReadVector4("Position");
packet.ReadUInt32("Reason");
}
示例9: ReadMovementInfoGen
private static MovementInfo ReadMovementInfoGen(ref Packet packet, Guid guid, int index)
{
var info = new MovementInfo();
info.Flags = packet.ReadEnum<MovementFlag>("Movement Flags", TypeCode.Int32, index);
var flagsTypeCode = ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056) ? TypeCode.Int16 : TypeCode.Byte;
info.FlagsExtra = packet.ReadEnum<MovementFlagExtra>("Extra Movement Flags", flagsTypeCode, index);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545))
if (packet.ReadGuid("GUID 2", index) != guid)
throw new InvalidDataException("Guids are not equal.");
packet.ReadInt32("Time", index);
info.Position = packet.ReadVector3("Position", index);
info.Orientation = packet.ReadSingle("Orientation", index);
if (info.Flags.HasAnyFlag(MovementFlag.OnTransport))
{
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
info.TransportGuid = packet.ReadPackedGuid("Transport GUID", index);
else
info.TransportGuid = packet.ReadGuid("Transport GUID", index);
info.TransportOffset = packet.ReadVector4("Transport Position", index);
packet.ReadInt32("Transport Time", index);
if (ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing))
packet.ReadByte("Transport Seat", index);
if (info.FlagsExtra.HasAnyFlag(MovementFlagExtra.InterpolateMove))
packet.ReadInt32("Transport Time", index);
}
if (info.Flags.HasAnyFlag(MovementFlag.Swimming | MovementFlag.Flying) ||
info.FlagsExtra.HasAnyFlag(MovementFlagExtra.AlwaysAllowPitching))
packet.ReadSingle("Swim Pitch", index);
if (ClientVersion.AddedInVersion(ClientType.Cataclysm))
{
if (info.FlagsExtra.HasAnyFlag(MovementFlagExtra.InterpolateTurning))
{
packet.ReadInt32("Fall Time", index);
packet.ReadSingle("Fall Velocity", index);
if (info.Flags.HasAnyFlag(MovementFlag.Falling))
{
packet.ReadSingle("Fall Sin Angle", index);
packet.ReadSingle("Fall Cos Angle", index);
packet.ReadSingle("Fall Speed", index);
}
}
}
else
{
packet.ReadInt32("Fall Time", index);
if (info.Flags.HasAnyFlag(MovementFlag.Falling))
{
packet.ReadSingle("Fall Velocity", index);
packet.ReadSingle("Fall Sin Angle", index);
packet.ReadSingle("Fall Cos Angle", index);
packet.ReadSingle("Fall Speed", index);
}
}
if (info.Flags.HasAnyFlag(MovementFlag.SplineElevation))
packet.ReadSingle("Spline Elevation", index);
return info;
}
示例10: 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();
//.........这里部分代码省略.........
示例11: HandleMovementHeartbeat433
public static void HandleMovementHeartbeat433(Packet packet)
{
packet.ReadEnum<MovementFlag>("Movement flags", 30);
packet.ReadBit("HasSplineData");
var guidBytes = new byte[8];
guidBytes[0] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[6] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[1] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[7] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[2] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[4] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[3] = (byte)(packet.ReadBit() ? 1 : 0);
packet.ReadEnum<MovementFlagExtra>("Movement flags extra", 12);
guidBytes[5] = (byte)(packet.ReadBit() ? 1 : 0);
var splineElevation = packet.ReadBit("SplineElevation"); // OR Swimming
var onTransport = packet.ReadBit("OnTransport");
var transportBytes = new byte[8];
var hasInterpolatedMovement = false;
var time3 = false;
if (onTransport)
{
transportBytes[0] = (byte)(packet.ReadBit() ? 1 : 0);
transportBytes[6] = (byte)(packet.ReadBit() ? 1 : 0);
transportBytes[2] = (byte)(packet.ReadBit() ? 1 : 0);
transportBytes[5] = (byte)(packet.ReadBit() ? 1 : 0);
transportBytes[4] = (byte)(packet.ReadBit() ? 1 : 0);
transportBytes[1] = (byte)(packet.ReadBit() ? 1 : 0);
transportBytes[3] = (byte)(packet.ReadBit() ? 1 : 0);
transportBytes[7] = (byte)(packet.ReadBit() ? 1 : 0);
hasInterpolatedMovement = packet.ReadBit("HasInterpolatedMovement");
time3 = packet.ReadBit("Time3");
}
var swimming = packet.ReadBit("Swimming"); // OR SplineElevation
var interPolatedTurning = packet.ReadBit("InterPolatedTurning");
var jumping = false;
if (interPolatedTurning)
jumping = packet.ReadBit("Jumping");
packet.ReadInt32("Time");
packet.ReadVector4("Position");
if (guidBytes[7] != 0)
guidBytes[7] ^= packet.ReadByte();
if (guidBytes[5] != 0)
guidBytes[5] ^= packet.ReadByte();
if (splineElevation)
packet.ReadSingle("Spline Elevation");
if (guidBytes[1] != 0)
guidBytes[1] ^= packet.ReadByte();
if (guidBytes[6] != 0)
guidBytes[6] ^= packet.ReadByte();
if (guidBytes[4] != 0)
guidBytes[4] ^= packet.ReadByte();
if (guidBytes[3] != 0)
guidBytes[3] ^= packet.ReadByte();
if (onTransport)
{
packet.ReadByte("Transport Seat");
packet.ReadSingle("Transport Orientation");
packet.ReadVector3("Transport Position");
packet.ReadInt32("Transport Time");
if (hasInterpolatedMovement)
packet.ReadInt32("Transport Time 2");
if (transportBytes[3] != 0)
transportBytes[3] ^= packet.ReadByte();
if (transportBytes[6] != 0)
transportBytes[6] ^= packet.ReadByte();
if (time3)
packet.ReadInt32("Transport Time 3");
if (transportBytes[7] != 0)
transportBytes[7] ^= packet.ReadByte();
if (transportBytes[5] != 0)
transportBytes[5] ^= packet.ReadByte();
if (transportBytes[2] != 0)
transportBytes[2] ^= packet.ReadByte();
if (transportBytes[1] != 0)
transportBytes[1] ^= packet.ReadByte();
if (transportBytes[0] != 0)
transportBytes[0] ^= packet.ReadByte();
//.........这里部分代码省略.........
示例12: HandleEnterWorld
public static void HandleEnterWorld(Packet packet)
{
CurrentMapId = (uint) packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
packet.ReadVector4("Position");
if (UpdateHandler.Objects != null && UpdateHandler.Objects.ContainsKey(CurrentMapId))
UpdateHandler.Objects[CurrentMapId] = new Dictionary<Guid, WoWObject>();
Player chInfo;
if (CharacterHandler.Characters.TryGetValue(SessionHandler.LoginGuid, out chInfo))
SessionHandler.LoggedInCharacter = chInfo;
packet.AddSniffData(StoreNameType.Map, (int) CurrentMapId, "NEW_WORLD");
}
示例13: ReadMovementStats
public static void ReadMovementStats(Packet packet, params object[] idx)
{
packet.ReadPackedGuid128("MoverGUID", idx);
packet.ReadUInt32("MoveIndex", idx);
packet.ReadVector4("Position", idx);
packet.ReadSingle("Pitch", idx);
packet.ReadSingle("StepUpStartElevation", idx);
var int152 = packet.ReadInt32("RemoveForcesCount", idx);
packet.ReadInt32("MoveTime", idx);
for (var i = 0; i < int152; i++)
packet.ReadPackedGuid128("RemoveForcesIDs", idx, i);
packet.ResetBitReader();
packet.ReadBitsE<MovementFlag>("MovementFlags", 30, idx);
packet.ReadBitsE<MovementFlagExtra>("ExtraMovementFlags", 18, idx);
var hasTransport = packet.ReadBit("HasTransportData", idx);
var hasFall = packet.ReadBit("HasFallData", idx);
packet.ReadBit("HasSpline", idx);
packet.ReadBit("HeightChangeFailed", idx);
packet.ReadBit("RemoteTimeValid", idx);
if (hasTransport)
V6_0_2_19033.Parsers.MovementHandler.ReadTransportData(packet, idx, "TransportData");
if (hasFall)
V6_0_2_19033.Parsers.MovementHandler.ReadFallData(packet, idx, "FallData");
}
示例14: ReadTransportData
public static void ReadTransportData(Packet packet, params object[] idx)
{
packet.ReadPackedGuid128("TransportGuid", idx);
packet.ReadVector4("TransportPosition", idx);
packet.ReadByte("TransportSeat", idx);
packet.ReadInt32("TransportMoveTime", idx);
packet.ResetBitReader();
var hasPrevMoveTime = packet.ReadBit("HasPrevMoveTime", idx);
var hasVehicleRecID = packet.ReadBit("HasVehicleRecID", idx);
if (hasPrevMoveTime)
packet.ReadUInt32("PrevMoveTime", idx);
if (hasVehicleRecID)
packet.ReadUInt32("VehicleRecID", idx);
}
示例15: HandleMoveSetCompoundState434
public static void HandleMoveSetCompoundState434(Packet packet)
{
var guid = packet.StartBitStream(5, 0, 4, 1, 7, 6, 2, 3);
var count = packet.ReadBits("Count", 23);
var unk1 = new byte[count];
var unk2 = new byte[count];
var hasPosition = new byte[count];
var unk4 = new byte[count];
for (int i = 0; i < count; ++i)
{
unk1[i] = packet.ReadBit("Unk bit 1", i); // 36
unk2[i] = packet.ReadBit("Unk bit 2", i); // 8
hasPosition[i] = packet.ReadBit("Has position", i); // 16
unk4[i] = packet.ReadBit("Unk bit 4", i); // 44
if (unk4[i] != 0)
packet.ReadBits("Unk bits", 2, i);
}
for (int i = 0; i < count; ++i)
{
if (unk4[i] != 0)
packet.ReadSingle("Unk Float 1", i);
if (hasPosition[i] != 0)
packet.ReadVector4("Position", i);
if (unk1[i] != 0)
packet.ReadInt32("Unk Int32 1", i);
packet.ReadInt32("Unk Int32 2", i);
if (unk2[i] != 0)
packet.ReadSingle("Unk Float 2", i);
packet.ReadInt16("Unk Int16", i);
}
packet.ParseBitStream(guid, 2, 1, 4, 5, 6, 7, 0, 3);
packet.WriteGuid("Guid", guid);
}