IPlayerManager refactor (#21215)
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user