Files
tbd-station-14/Content.Server/Administration/Commands/StealthminCommand.cs
Kyle Tyo 69b3e355e4 Command resolves. (#38519)
* banlist-command

* open-admin-notes-command

* stealthmin-command

* set-alert-level-command

* remove unused usings

* whitelist commands
2025-06-23 02:40:55 +02:00

34 lines
943 B
C#

using Content.Server.Administration.Managers;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Utility;
namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Stealth)]
public sealed class StealthminCommand : LocalizedCommands
{
[Dependency] private readonly IAdminManager _adminManager = default!;
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("shell-cannot-run-command-from-server"));
return;
}
var adminData = _adminManager.GetAdminData(player);
DebugTools.AssertNotNull(adminData);
if (!adminData!.Stealth)
_adminManager.Stealth(player);
else
_adminManager.UnStealth(player);
}
}