CatStation/Content.Server/Administration/Commands/ReadyAllCommand.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

32 lines
920 B
C#

using Content.Server.GameTicking;
using Content.Shared.Administration;
using Robust.Shared.Console;
namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Round)]
public sealed partial class ReadyAllCommand : LocalizedEntityCommands
{
[Dependency] private GameTicker _gameTicker = default!;
public override string Command => "readyall";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var ready = true;
if (_gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
{
shell.WriteError(Loc.GetString("shell-can-only-run-from-pre-round-lobby"));
return;
}
if (args.Length > 0 && !bool.TryParse(args[0], out ready))
{
shell.WriteError(Loc.GetString("shell-argument-must-be-boolean"));
return;
}
_gameTicker.ToggleReadyAll(ready);
}
}