1
0

EndRoundCommand.cs 889 B

1234567891011121314151617181920212223242526272829
  1. using Content.Server.Administration;
  2. using Content.Shared.Administration;
  3. using Robust.Shared.Console;
  4. namespace Content.Server.GameTicking.Commands
  5. {
  6. [AdminCommand(AdminFlags.Round)]
  7. sealed class EndRoundCommand : IConsoleCommand
  8. {
  9. [Dependency] private readonly IEntityManager _e = default!;
  10. public string Command => "endround";
  11. public string Description => "Ends the round and moves the server to PostRound.";
  12. public string Help => String.Empty;
  13. public void Execute(IConsoleShell shell, string argStr, string[] args)
  14. {
  15. var ticker = _e.System<GameTicker>();
  16. if (ticker.RunLevel != GameRunLevel.InRound)
  17. {
  18. shell.WriteLine("This can only be executed while the game is in a round.");
  19. return;
  20. }
  21. ticker.EndRound();
  22. }
  23. }
  24. }