EngineHealth sync added

This commit is contained in:
EntenKoeniq 2021-08-16 16:51:33 +02:00
parent 45815ba6d9
commit 51f4b58497
4 changed files with 44 additions and 20 deletions

View File

@ -51,6 +51,7 @@ namespace CoopClient
private int[] LastVehicleColors = new int[] { 0, 0 };
public int[] VehicleColors { get; set; }
public bool VehicleDead { get; set; }
public float VehicleEngineHealth { get; set; }
public int VehicleSeatIndex { get; set; }
public Vehicle MainVehicle { get; set; }
public Vector3 VehiclePosition { get; set; }
@ -303,6 +304,8 @@ namespace CoopClient
return;
}
MainVehicle.EngineHealth = VehicleEngineHealth;
if (VehicleDead && !MainVehicle.IsDead)
{
MainVehicle.Explode();

View File

@ -340,6 +340,7 @@ namespace CoopClient
player.VehicleSeatIndex = packet.VehSeatIndex;
player.VehiclePosition = packet.VehPosition.ToVector();
player.VehicleRotation = packet.VehRotation.ToQuaternion();
player.VehicleEngineHealth = packet.VehEngineHealth;
player.VehicleVelocity = packet.VehVelocity.ToVector();
player.VehicleSpeed = packet.VehSpeed;
player.VehicleSteeringAngle = packet.VehSteeringAngle;
@ -488,6 +489,7 @@ namespace CoopClient
npc.VehicleSeatIndex = packet.VehSeatIndex;
npc.VehiclePosition = packet.VehPosition.ToVector();
npc.VehicleRotation = packet.VehRotation.ToQuaternion();
npc.VehicleEngineHealth = packet.VehEngineHealth;
npc.VehicleVelocity = packet.VehVelocity.ToVector();
npc.VehicleSpeed = packet.VehSpeed;
npc.VehicleSteeringAngle = packet.VehSteeringAngle;
@ -516,6 +518,7 @@ namespace CoopClient
VehicleSeatIndex = packet.VehSeatIndex,
VehiclePosition = packet.VehPosition.ToVector(),
VehicleRotation = packet.VehRotation.ToQuaternion(),
VehicleEngineHealth = packet.VehEngineHealth,
VehicleVelocity = packet.VehVelocity.ToVector(),
VehicleSpeed = packet.VehSpeed,
VehicleSteeringAngle = packet.VehSteeringAngle,
@ -593,6 +596,7 @@ namespace CoopClient
VehSeatIndex = (int)player.SeatIndex,
VehPosition = player.CurrentVehicle.Position.ToLVector(),
VehRotation = player.CurrentVehicle.Quaternion.ToLQuaternion(),
VehEngineHealth = player.CurrentVehicle.EngineHealth,
VehVelocity = player.CurrentVehicle.Velocity.ToLVector(),
VehSpeed = player.CurrentVehicle.Speed,
VehSteeringAngle = player.CurrentVehicle.SteeringAngle,
@ -694,6 +698,7 @@ namespace CoopClient
VehSeatIndex = (int)npc.SeatIndex,
VehPosition = npc.CurrentVehicle.Position.ToLVector(),
VehRotation = npc.CurrentVehicle.Quaternion.ToLQuaternion(),
VehEngineHealth = npc.CurrentVehicle.EngineHealth,
VehVelocity = npc.CurrentVehicle.Velocity.ToLVector(),
VehSpeed = npc.CurrentVehicle.Speed,
VehSteeringAngle = npc.CurrentVehicle.SteeringAngle,

View File

@ -396,21 +396,24 @@ namespace CoopClient
public LQuaternion VehRotation { get; set; }
[ProtoMember(8)]
public LVector3 VehVelocity { get; set; }
public float VehEngineHealth { get; set; }
[ProtoMember(9)]
public float VehSpeed { get; set; }
public LVector3 VehVelocity { get; set; }
[ProtoMember(10)]
public float VehSteeringAngle { get; set; }
public float VehSpeed { get; set; }
[ProtoMember(11)]
public int[] VehColors { get; set; }
public float VehSteeringAngle { get; set; }
[ProtoMember(12)]
public VehicleDoors[] VehDoors { get; set; }
public int[] VehColors { get; set; }
[ProtoMember(13)]
public VehicleDoors[] VehDoors { get; set; }
[ProtoMember(14)]
public byte? Flag { get; set; } = 0;
public override void PacketToNetOutGoingMessage(NetOutgoingMessage message)
@ -436,6 +439,7 @@ namespace CoopClient
VehSeatIndex = data.VehSeatIndex;
VehPosition = data.VehPosition;
VehRotation = data.VehRotation;
VehEngineHealth = data.VehEngineHealth;
VehVelocity = data.VehVelocity;
VehSpeed = data.VehSpeed;
VehSteeringAngle = data.VehSteeringAngle;
@ -682,21 +686,24 @@ namespace CoopClient
public LQuaternion VehRotation { get; set; }
[ProtoMember(10)]
public LVector3 VehVelocity { get; set; }
public float VehEngineHealth { get; set; }
[ProtoMember(11)]
public float VehSpeed { get; set; }
public LVector3 VehVelocity { get; set; }
[ProtoMember(12)]
public float VehSteeringAngle { get; set; }
public float VehSpeed { get; set; }
[ProtoMember(13)]
public int[] VehColors { get; set; }
public float VehSteeringAngle { get; set; }
[ProtoMember(14)]
public VehicleDoors[] VehDoors { get; set; }
public int[] VehColors { get; set; }
[ProtoMember(15)]
public VehicleDoors[] VehDoors { get; set; }
[ProtoMember(16)]
public byte? Flag { get; set; } = 0;
public override void PacketToNetOutGoingMessage(NetOutgoingMessage message)
@ -724,6 +731,7 @@ namespace CoopClient
VehSeatIndex = data.VehSeatIndex;
VehPosition = data.VehPosition;
VehRotation = data.VehRotation;
VehEngineHealth = data.VehEngineHealth;
VehVelocity = data.VehVelocity;
VehSpeed = data.VehSpeed;
VehSteeringAngle = data.VehSteeringAngle;

View File

@ -328,21 +328,24 @@ namespace CoopServer
public LQuaternion VehRotation { get; set; }
[ProtoMember(8)]
public LVector3 VehVelocity { get; set; }
public float VehEngineHealth { get; set; }
[ProtoMember(9)]
public float VehSpeed { get; set; }
public LVector3 VehVelocity { get; set; }
[ProtoMember(10)]
public float VehSteeringAngle { get; set; }
public float VehSpeed { get; set; }
[ProtoMember(11)]
public int[] VehColors { get; set; }
public float VehSteeringAngle { get; set; }
[ProtoMember(12)]
public VehicleDoors[] VehDoors { get; set; }
public int[] VehColors { get; set; }
[ProtoMember(13)]
public VehicleDoors[] VehDoors { get; set; }
[ProtoMember(14)]
public byte? Flag { get; set; } = 0;
public override void PacketToNetOutGoingMessage(NetOutgoingMessage message)
@ -368,6 +371,7 @@ namespace CoopServer
VehSeatIndex = data.VehSeatIndex;
VehPosition = data.VehPosition;
VehRotation = data.VehRotation;
VehEngineHealth = data.VehEngineHealth;
VehVelocity = data.VehVelocity;
VehSpeed = data.VehSpeed;
VehSteeringAngle = data.VehSteeringAngle;
@ -614,21 +618,24 @@ namespace CoopServer
public LQuaternion VehRotation { get; set; }
[ProtoMember(10)]
public LVector3 VehVelocity { get; set; }
public float VehEngineHealth { get; set; }
[ProtoMember(11)]
public float VehSpeed { get; set; }
public LVector3 VehVelocity { get; set; }
[ProtoMember(12)]
public float VehSteeringAngle { get; set; }
public float VehSpeed { get; set; }
[ProtoMember(13)]
public int[] VehColors { get; set; }
public float VehSteeringAngle { get; set; }
[ProtoMember(14)]
public VehicleDoors[] VehDoors { get; set; }
public int[] VehColors { get; set; }
[ProtoMember(15)]
public VehicleDoors[] VehDoors { get; set; }
[ProtoMember(16)]
public byte? Flag { get; set; } = 0;
public override void PacketToNetOutGoingMessage(NetOutgoingMessage message)
@ -656,6 +663,7 @@ namespace CoopServer
VehSeatIndex = data.VehSeatIndex;
VehPosition = data.VehPosition;
VehRotation = data.VehRotation;
VehEngineHealth = data.VehEngineHealth;
VehVelocity = data.VehVelocity;
VehSpeed = data.VehSpeed;
VehSteeringAngle = data.VehSteeringAngle;