CatStation/Content.Server/Administration/Commands/StealthminCommand.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

33 lines
942 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 partial class StealthminCommand : LocalizedCommands
{
[Dependency] private 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);
}
}