Implements panic bunkering. (#9315)

* Implements panic bunkering.
Helps with raid management, esp with unknown accounts.

* adds an enable/disable command.
This commit is contained in:
Moony
2022-07-01 15:46:37 -05:00
committed by GitHub
parent 2284412def
commit 8e90bf46e9
6 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
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);
}
}