Files
Pieter-Jan BriersandGitHub 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
962 B
C#

using Content.Server.Administration.Managers;
using Content.Shared.Administration;
using Robust.Shared.Console;
namespace Content.Server.Administration.Commands
{
[AnyCommand]
public sealed partial class ReAdminCommand : LocalizedCommands
{
[Dependency] private IAdminManager _adminManager = default!;
public override string Command => "readmin";
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;
}
if (_adminManager.GetAdminData(player, includeDeAdmin: true) == null)
{
shell.WriteLine(Loc.GetString($"cmd-readmin-not-an-admin"));
return;
}
_adminManager.ReAdmin(player);
}
}
}