Files
tbd-station-14/Content.Server/Administration/Commands/StealthminCommand.cs
nikthechampiongr dca0c6694b Add stealthmins (#26263)
* Add stealthmin command.

* Update Content.Server/Administration/Commands/AdminWhoCommand.cs

As suggested by CE.

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>

* Add admin notifications for admins toggling stealthmin.

* Localize stealthmin command

---------

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
2024-03-24 10:39:53 -05:00

40 lines
1.0 KiB
C#

using Content.Server.Administration.Managers;
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Shared.Console;
using Robust.Shared.Utility;
namespace Content.Server.Administration.Commands;
[UsedImplicitly]
[AdminCommand(AdminFlags.Stealth)]
public sealed class StealthminCommand : LocalizedCommands
{
public override string Command => "stealthmin";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var player = shell.Player;
if (player == null)
{
shell.WriteLine(Loc.GetString("cmd-stealthmin-no-console"));
return;
}
var mgr = IoCManager.Resolve<IAdminManager>();
var adminData = mgr.GetAdminData(player);
DebugTools.AssertNotNull(adminData);
if (!adminData!.Stealth)
{
mgr.Stealth(player);
}
else
{
mgr.UnStealth(player);
}
}
}