From e3896e45fce81b712cc375c84fcde659487725ba Mon Sep 17 00:00:00 2001 From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Fri, 28 Jun 2024 19:42:58 -0700 Subject: [PATCH] Move GameTicker.RoundDuration to Shared (#29425) --- Content.Server/GameTicking/GameTicker.RoundFlow.cs | 5 ----- Content.Shared/GameTicking/SharedGameTicker.cs | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index d67b8d96e3..c957e0eb96 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -622,11 +622,6 @@ namespace Content.Server.GameTicking } } - public TimeSpan RoundDuration() - { - return _gameTiming.CurTime.Subtract(RoundStartTimeSpan); - } - private void AnnounceRound() { if (CurrentPreset == null) return; diff --git a/Content.Shared/GameTicking/SharedGameTicker.cs b/Content.Shared/GameTicking/SharedGameTicker.cs index 308476baa8..5126a6bdc4 100644 --- a/Content.Shared/GameTicking/SharedGameTicker.cs +++ b/Content.Shared/GameTicking/SharedGameTicker.cs @@ -5,12 +5,14 @@ using Robust.Shared.Replays; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Markdown.Mapping; using Robust.Shared.Serialization.Markdown.Value; +using Robust.Shared.Timing; namespace Content.Shared.GameTicking { public abstract class SharedGameTicker : EntitySystem { [Dependency] private readonly IReplayRecordingManager _replay = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; // See ideally these would be pulled from the job definition or something. // 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()); } + + public TimeSpan RoundDuration() + { + return _gameTiming.CurTime.Subtract(RoundStartTimeSpan); + } } [Serializable, NetSerializable]