mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
* add tape recorder * add filled tape recorder to trinkets * :trollface: * :trollface: --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
25 lines
791 B
C#
25 lines
791 B
C#
using Content.Shared.DeltaV.TapeRecorder.Systems;
|
|
|
|
namespace Content.Client.DeltaV.TapeRecorder;
|
|
|
|
/// <summary>
|
|
/// Required for client side prediction stuff
|
|
/// </summary>
|
|
public sealed class TapeRecorderSystem : SharedTapeRecorderSystem
|
|
{
|
|
private TimeSpan _lastTickTime = TimeSpan.Zero;
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
if (!Timing.IsFirstTimePredicted)
|
|
return;
|
|
|
|
//We need to know the exact time period that has passed since the last update to ensure the tape position is sync'd with the server
|
|
//Since the client can skip frames when lagging, we cannot use frameTime
|
|
var realTime = (float) (Timing.CurTime - _lastTickTime).TotalSeconds;
|
|
_lastTickTime = Timing.CurTime;
|
|
|
|
base.Update(realTime);
|
|
}
|
|
}
|