Fix late join & observe to de-admin admins. (#28319)
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Roles;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -12,6 +15,8 @@ namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
public string Command => "joingame";
|
||||
public string Description => "";
|
||||
@@ -67,6 +72,12 @@ namespace Content.Server.GameTicking.Commands
|
||||
shell.WriteLine($"{jobPrototype.LocalizedName} has no available slots.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_adminManager.IsAdmin(player) && _cfg.GetCVar(CCVars.AdminDeadminOnJoin))
|
||||
{
|
||||
_adminManager.DeAdmin(player);
|
||||
}
|
||||
|
||||
ticker.MakeJoinGame(player, station, id);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user