Un-revert IPlayerManager refactor (#21244)

This commit is contained in:
Leon Friedrich
2023-10-28 09:59:53 +11:00
committed by GitHub
parent c55e1dcafd
commit e685cb626b
245 changed files with 781 additions and 943 deletions

View File

@@ -1,4 +1,3 @@
using System.Linq;
using Content.Server.Afk.Events;
using Content.Server.GameTicking;
using Content.Shared.CCVar;
@@ -24,7 +23,7 @@ public sealed class AFKSystem : EntitySystem
private float _checkDelay;
private TimeSpan _checkTime;
private readonly HashSet<IPlayerSession> _afkPlayers = new();
private readonly HashSet<ICommonSession> _afkPlayers = new();
public override void Initialize()
{
@@ -73,11 +72,9 @@ public sealed class AFKSystem : EntitySystem
_checkTime = _timing.CurTime + TimeSpan.FromSeconds(_checkDelay);
foreach (var session in Filter.GetAllPlayers())
foreach (var pSession in Filter.GetAllPlayers())
{
if (session.Status != SessionStatus.InGame) continue;
var pSession = (IPlayerSession) session;
if (pSession.Status != SessionStatus.InGame) continue;
var isAfk = _afkManager.IsAfk(pSession);
if (isAfk && _afkPlayers.Add(pSession))