Move GameTicker.RoundDuration to Shared (#29425)

This commit is contained in:
DrSmugleaf
2024-06-28 19:42:58 -07:00
committed by GitHub
parent 797aebb161
commit e3896e45fc
2 changed files with 7 additions and 5 deletions

View File

@@ -622,11 +622,6 @@ namespace Content.Server.GameTicking
} }
} }
public TimeSpan RoundDuration()
{
return _gameTiming.CurTime.Subtract(RoundStartTimeSpan);
}
private void AnnounceRound() private void AnnounceRound()
{ {
if (CurrentPreset == null) return; if (CurrentPreset == null) return;

View File

@@ -5,12 +5,14 @@ using Robust.Shared.Replays;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Markdown.Mapping; using Robust.Shared.Serialization.Markdown.Mapping;
using Robust.Shared.Serialization.Markdown.Value; using Robust.Shared.Serialization.Markdown.Value;
using Robust.Shared.Timing;
namespace Content.Shared.GameTicking namespace Content.Shared.GameTicking
{ {
public abstract class SharedGameTicker : EntitySystem public abstract class SharedGameTicker : EntitySystem
{ {
[Dependency] private readonly IReplayRecordingManager _replay = default!; [Dependency] private readonly IReplayRecordingManager _replay = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
// See ideally these would be pulled from the job definition or something. // See ideally these would be pulled from the job definition or something.
// But this is easier, and at least it isn't hardcoded. // But this is easier, and at least it isn't hardcoded.
@@ -41,6 +43,11 @@ namespace Content.Shared.GameTicking
{ {
metadata["roundId"] = new ValueDataNode(RoundId.ToString()); metadata["roundId"] = new ValueDataNode(RoundId.ToString());
} }
public TimeSpan RoundDuration()
{
return _gameTiming.CurTime.Subtract(RoundStartTimeSpan);
}
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]