StartRoundCommand.cs 910 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 StartRoundCommand : IConsoleCommand
  8. {
  9. [Dependency] private readonly IEntityManager _e = default!;
  10. public string Command => "startround";
  11. public string Description => "Ends PreRoundLobby state and starts the round.";
  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.PreRoundLobby)
  17. {
  18. shell.WriteLine("This can only be executed while the game is in the pre-round lobby.");
  19. return;
  20. }
  21. ticker.StartRound();
  22. }
  23. }
  24. }