Hotfix round restart loops (#16292)

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
metalgearsloth
2023-05-11 11:00:39 +10:00
committed by GitHub
parent 90d13d79ac
commit 20748cc542
3 changed files with 22 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Content.Server.Database;
@@ -350,6 +351,19 @@ public sealed class PlayTimeTrackingManager
return GetPlayTimeForTracker(id, PlayTimeTrackingShared.TrackerOverall);
}
public bool TryGetTrackerTimes(IPlayerSession id, [NotNullWhen(true)] out Dictionary<string, TimeSpan>? time)
{
time = null;
if (!_playTimeData.TryGetValue(id, out var data) || !data.Initialized)
{
return false;
}
time = data.TrackerTimes;
return true;
}
public Dictionary<string, TimeSpan> GetTrackerTimes(IPlayerSession id)
{
if (!_playTimeData.TryGetValue(id, out var data) || !data.Initialized)