DeAdminCommand.cs 979 B

1234567891011121314151617181920212223242526272829
  1. using Content.Server.Administration.Managers;
  2. using Content.Shared.Administration;
  3. using JetBrains.Annotations;
  4. using Robust.Shared.Console;
  5. namespace Content.Server.Administration.Commands
  6. {
  7. [UsedImplicitly]
  8. [AdminCommand(AdminFlags.None)]
  9. public sealed class DeAdminCommand : IConsoleCommand
  10. {
  11. public string Command => "deadmin";
  12. public string Description => "Temporarily de-admins you so you can experience the round as a normal player.";
  13. public string Help => "Usage: deadmin\nUse readmin to re-admin after using this.";
  14. public void Execute(IConsoleShell shell, string argStr, string[] args)
  15. {
  16. var player = shell.Player;
  17. if (player == null)
  18. {
  19. shell.WriteLine("You cannot use this command from the server console.");
  20. return;
  21. }
  22. var mgr = IoCManager.Resolve<IAdminManager>();
  23. mgr.DeAdmin(player);
  24. }
  25. }
  26. }