2022-05-13 00:59:03 -07:00
|
|
|
|
using Content.Server.Administration;
|
2020-12-03 03:40:47 +01:00
|
|
|
|
using Content.Shared.Administration;
|
2021-02-01 16:49:43 -08:00
|
|
|
|
using Robust.Shared.Console;
|
2020-12-03 03:40:47 +01:00
|
|
|
|
|
2025-09-03 06:49:34 -04:00
|
|
|
|
namespace Content.Server.GameTicking.Commands;
|
|
|
|
|
|
|
|
|
|
|
|
[AdminCommand(AdminFlags.Round)]
|
|
|
|
|
|
public sealed class EndRoundCommand : LocalizedEntityCommands
|
2020-12-03 03:40:47 +01:00
|
|
|
|
{
|
2025-09-03 06:49:34 -04:00
|
|
|
|
[Dependency] private readonly GameTicker _gameTicker = default!;
|
2024-05-12 17:34:52 -07:00
|
|
|
|
|
2025-09-03 06:49:34 -04:00
|
|
|
|
public override string Command => "endround";
|
2020-12-03 03:40:47 +01:00
|
|
|
|
|
2025-09-03 06:49:34 -04:00
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_gameTicker.RunLevel != GameRunLevel.InRound)
|
2020-12-03 03:40:47 +01:00
|
|
|
|
{
|
2025-09-03 06:49:34 -04:00
|
|
|
|
shell.WriteLine(Loc.GetString("shell-can-only-run-while-round-is-active"));
|
|
|
|
|
|
return;
|
2020-12-03 03:40:47 +01:00
|
|
|
|
}
|
2025-09-03 06:49:34 -04:00
|
|
|
|
|
|
|
|
|
|
_gameTicker.EndRound();
|
2020-12-03 03:40:47 +01:00
|
|
|
|
}
|
2021-06-09 22:19:39 +02:00
|
|
|
|
}
|