2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Administration.Managers;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Content.Shared.Administration;
|
2020-10-30 16:06:48 +01:00
|
|
|
using JetBrains.Annotations;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2020-10-30 16:06:48 +01:00
|
|
|
|
2020-11-10 21:30:20 +01:00
|
|
|
namespace Content.Server.Administration.Commands
|
2020-10-30 16:06:48 +01:00
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
[AdminCommand(AdminFlags.None)]
|
2025-06-17 13:22:03 -04:00
|
|
|
public sealed class DeAdminCommand : LocalizedCommands
|
2020-10-30 16:06:48 +01:00
|
|
|
{
|
2025-06-17 13:22:03 -04:00
|
|
|
[Dependency] private readonly IAdminManager _admin = default!;
|
2020-10-30 16:06:48 +01:00
|
|
|
|
2025-06-17 13:22:03 -04:00
|
|
|
public override string Command => "deadmin";
|
|
|
|
|
|
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-10-30 16:06:48 +01:00
|
|
|
{
|
2023-10-28 09:59:53 +11:00
|
|
|
var player = shell.Player;
|
2020-10-30 16:06:48 +01:00
|
|
|
if (player == null)
|
|
|
|
|
{
|
2025-06-17 13:22:03 -04:00
|
|
|
shell.WriteLine(Loc.GetString($"shell-cannot-run-command-from-server"));
|
2020-10-30 16:06:48 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-17 13:22:03 -04:00
|
|
|
_admin.DeAdmin(player);
|
2020-10-30 16:06:48 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|