Add cvar to deadmin when joining round (#18430)
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Ghost;
|
||||
using Content.Server.Players;
|
||||
using Content.Server.Spawners.Components;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Preferences;
|
||||
@@ -22,6 +24,8 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
|
||||
private const string ObserverPrototypeName = "MobObserver";
|
||||
|
||||
/// <summary>
|
||||
@@ -133,6 +137,10 @@ namespace Content.Server.GameTicking
|
||||
return;
|
||||
}
|
||||
|
||||
// Automatically de-admin players who are joining.
|
||||
if (_cfg.GetCVar(CCVars.AdminDeadminOnJoin) && _adminManager.IsAdmin(player))
|
||||
_adminManager.DeAdmin(player);
|
||||
|
||||
// We raise this event to allow other systems to handle spawning this player themselves. (e.g. late-join wizard, etc)
|
||||
var bev = new PlayerBeforeSpawnEvent(player, character, jobId, lateJoin, station);
|
||||
RaiseLocalEvent(bev);
|
||||
|
||||
Reference in New Issue
Block a user