Use TimeSpan instead of an int for the countdown time
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
private CancellationTokenSource _roundEndCancellationTokenSource = new CancellationTokenSource();
|
private CancellationTokenSource _roundEndCancellationTokenSource = new CancellationTokenSource();
|
||||||
public bool IsRoundEndCountdownStarted { get; private set; }
|
public bool IsRoundEndCountdownStarted { get; private set; }
|
||||||
public int RoundEndCountdownTime { get; set; } = 240000;
|
public TimeSpan RoundEndCountdownTime { get; set; } = TimeSpan.FromMinutes(4);
|
||||||
public TimeSpan? ExpectedCountdownEnd = null;
|
public TimeSpan? ExpectedCountdownEnd = null;
|
||||||
|
|
||||||
public delegate void RoundEndCountdownStarted();
|
public delegate void RoundEndCountdownStarted();
|
||||||
@@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
IsRoundEndCountdownStarted = true;
|
IsRoundEndCountdownStarted = true;
|
||||||
|
|
||||||
ExpectedCountdownEnd = _gameTiming.CurTime + TimeSpan.FromMilliseconds(RoundEndCountdownTime);
|
ExpectedCountdownEnd = _gameTiming.CurTime + RoundEndCountdownTime;
|
||||||
Timer.Spawn(RoundEndCountdownTime, EndRound, _roundEndCancellationTokenSource.Token);
|
Timer.Spawn(RoundEndCountdownTime, EndRound, _roundEndCancellationTokenSource.Token);
|
||||||
OnRoundEndCountdownStarted?.Invoke();
|
OnRoundEndCountdownStarted?.Invoke();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user