2021-10-09 13:18:20 -05:00
|
|
|
using Content.Server.Administration;
|
|
|
|
|
using Content.Server.RoundEnd;
|
|
|
|
|
using Content.Shared.Administration;
|
|
|
|
|
using Robust.Shared.Console;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.GameTicking.Commands
|
|
|
|
|
{
|
2021-11-29 14:40:10 -06:00
|
|
|
[AdminCommand(AdminFlags.Round)]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class RestartRoundCommand : IConsoleCommand
|
2021-10-09 13:18:20 -05:00
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
[Dependency] private readonly IEntityManager _e = default!;
|
|
|
|
|
|
2021-10-09 13:18:20 -05:00
|
|
|
public string Command => "restartround";
|
|
|
|
|
public string Description => "Ends the current round and starts the countdown for the next lobby.";
|
2022-01-10 11:24:41 -08:00
|
|
|
public string Help => string.Empty;
|
2021-10-09 13:18:20 -05:00
|
|
|
|
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
var ticker = _e.System<GameTicker>();
|
2021-11-15 18:14:34 +00:00
|
|
|
|
|
|
|
|
if (ticker.RunLevel != GameRunLevel.InRound)
|
|
|
|
|
{
|
|
|
|
|
shell.WriteLine("This can only be executed while the game is in a round - try restartroundnow");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 17:34:52 -07:00
|
|
|
_e.System<RoundEndSystem>().EndRound();
|
2021-10-09 13:18:20 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-29 14:40:10 -06:00
|
|
|
[AdminCommand(AdminFlags.Round)]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class RestartRoundNowCommand : IConsoleCommand
|
2021-10-09 13:18:20 -05:00
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
[Dependency] private readonly IEntityManager _e = default!;
|
|
|
|
|
|
2021-10-09 13:18:20 -05:00
|
|
|
public string Command => "restartroundnow";
|
|
|
|
|
public string Description => "Moves the server from PostRound to a new PreRoundLobby.";
|
|
|
|
|
public string Help => String.Empty;
|
|
|
|
|
|
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
_e.System<GameTicker>().RestartRound();
|
2021-10-09 13:18:20 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|