mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-09-15 14:52:26 +02:00
* 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
33 lines
962 B
C#
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);
|
|
}
|
|
}
|
|
}
|