chore: removed timestamp on paddle packet

This commit is contained in:
Syntriax 2025-06-18 16:13:25 +03:00
parent d89af5ccad
commit 23fa1f06e9

View File

@ -84,7 +84,7 @@ public class PaddleBehaviour(Keys Up, Keys Down, float High, float Low, float Sp
isDownPressed = packet.IsDownPressed; isDownPressed = packet.IsDownPressed;
Transform.Position = packet.Position; Transform.Position = packet.Position;
physicsEngine2D.StepIndividual(rigidBody, new DateTime(DateTime.UtcNow.Ticks - packet.Timestamp).Second); physicsEngine2D.StepIndividual(rigidBody, sender.Ping);
} }
public class PaddleKeyStatePacket : IEntityNetworkPacket public class PaddleKeyStatePacket : IEntityNetworkPacket
@ -93,7 +93,6 @@ public class PaddleBehaviour(Keys Up, Keys Down, float High, float Low, float Sp
public Vector2D Position { get; set; } = default!; public Vector2D Position { get; set; } = default!;
public bool IsUpPressed { get; set; } = default!; public bool IsUpPressed { get; set; } = default!;
public bool IsDownPressed { get; set; } = default!; public bool IsDownPressed { get; set; } = default!;
public long Timestamp { get; set; } = 0;
public PaddleKeyStatePacket Set(PaddleBehaviour paddleBehaviour) public PaddleKeyStatePacket Set(PaddleBehaviour paddleBehaviour)
{ {
@ -101,7 +100,6 @@ public class PaddleBehaviour(Keys Up, Keys Down, float High, float Low, float Sp
Position = paddleBehaviour.Transform.Position; Position = paddleBehaviour.Transform.Position;
IsUpPressed = paddleBehaviour.isUpPressed; IsUpPressed = paddleBehaviour.isUpPressed;
IsDownPressed = paddleBehaviour.isDownPressed; IsDownPressed = paddleBehaviour.isDownPressed;
Timestamp = DateTime.UtcNow.Ticks;
return this; return this;
} }