ListRolesCommand.cs 929 B

123456789101112131415161718192021222324252627282930313233
  1. using Content.Server.Administration;
  2. using Content.Shared.Administration;
  3. using Content.Shared.Roles;
  4. using Robust.Shared.Console;
  5. using Robust.Shared.Prototypes;
  6. namespace Content.Server.Roles
  7. {
  8. [AdminCommand(AdminFlags.Admin)]
  9. public sealed class ListRolesCommand : IConsoleCommand
  10. {
  11. public string Command => "listroles";
  12. public string Description => "Lists roles";
  13. public string Help => "listroles";
  14. public void Execute(IConsoleShell shell, string argStr, string[] args)
  15. {
  16. if (args.Length != 0)
  17. {
  18. shell.WriteLine("Expected no arguments.");
  19. return;
  20. }
  21. var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
  22. foreach(var job in prototypeManager.EnumeratePrototypes<JobPrototype>())
  23. {
  24. shell.WriteLine(job.ID);
  25. }
  26. }
  27. }
  28. }