ConGroups are gone. Long live admin flags in content.
This commit is contained in:
35
Content.Server/Administration/Commands/ReAdminCommand.cs
Normal file
35
Content.Server/Administration/Commands/ReAdminCommand.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Content.Server.Administration
|
||||
{
|
||||
[AnyCommand]
|
||||
public class ReAdminCommand : IClientCommand
|
||||
{
|
||||
public string Command => "readmin";
|
||||
public string Description => "Re-admins you if you previously de-adminned.";
|
||||
public string Help => "Usage: readmin";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
shell.SendText(player, "You cannot use this command from the server console.");
|
||||
return;
|
||||
}
|
||||
|
||||
var mgr = IoCManager.Resolve<IAdminManager>();
|
||||
|
||||
if (mgr.GetAdminData(player, includeDeAdmin: true) == null)
|
||||
{
|
||||
shell.SendText(player, "You're not an admin.");
|
||||
return;
|
||||
}
|
||||
|
||||
mgr.ReAdmin(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user