Skip to content

Commit

Permalink
Fix Afk admin kick
Browse files Browse the repository at this point in the history
  • Loading branch information
skvoooznyak committed Jun 5, 2023
1 parent 1cd8872 commit b53e877
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Content.Server/Afk/AFKSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using Content.Server.Administration.Managers;
using Content.Server.Afk.Events;
using Content.Server.GameTicking;
using Content.Shared.CCVar;
Expand All @@ -20,6 +21,7 @@ public sealed class AFKSystem : EntitySystem
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly IAdminManager _adminManager = default!;

private float _checkDelay;
private TimeSpan _checkTime;
Expand Down Expand Up @@ -80,7 +82,7 @@ public override void Update(float frameTime)
var pSession = (IPlayerSession) session;
var isAfk = _afkManager.IsAfk(pSession);

if (_afkManager.IsAfkKick(pSession))
if (_afkManager.IsAfkKick(pSession) && !_adminManager.IsAdmin(pSession))
{
pSession.ConnectedClient.Disconnect(Loc.GetString("kick-afk"), true);
continue;
Expand Down

0 comments on commit b53e877

Please sign in to comment.