* Implements panic bunkering. Helps with raid management, esp with unknown accounts. * adds an enable/disable command.
33 lines
991 B
C#
33 lines
991 B
C#
using Content.Shared.Administration;
|
|
using Content.Shared.CCVar;
|
|
using Robust.Shared.Configuration;
|
|
using Robust.Shared.Console;
|
|
|
|
namespace Content.Server.Administration.Commands;
|
|
|
|
[AdminCommand(AdminFlags.Server)]
|
|
public sealed class PanicBunkerCommand : IConsoleCommand
|
|
{
|
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
|
|
|
public string Command => "panicbunker";
|
|
public string Description => "Enables or disables the panic bunker functionality.";
|
|
public string Help => "panicbunker <enabled>";
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
{
|
|
if (args.Length != 1)
|
|
{
|
|
shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
|
|
return;
|
|
}
|
|
|
|
if (!bool.TryParse(args[0], out var enabled))
|
|
{
|
|
shell.WriteError(Loc.GetString("shell-invalid-bool"));
|
|
return;
|
|
}
|
|
|
|
_cfg.SetCVar(CCVars.PanicBunkerEnabled, enabled);
|
|
}
|
|
}
|