2021-12-13 16:45:49 +11: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
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.GameTicking.Commands
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
|
|
|
|
[AnyCommand]
|
2022-02-16 00:23:23 -07:00
|
|
|
sealed class ToggleReadyCommand : IConsoleCommand
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
[Dependency] private readonly IEntityManager _e = default!;
|
|
|
|
|
|
2020-12-03 03:40:47 +01:00
|
|
|
public string Command => "toggleready";
|
|
|
|
|
public string Description => "";
|
|
|
|
|
public string Help => "";
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
2023-10-28 09:59:53 +11:00
|
|
|
var player = shell.Player;
|
2022-07-12 04:14:24 +02:00
|
|
|
if (args.Length != 1)
|
|
|
|
|
{
|
|
|
|
|
shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-12-03 03:40:47 +01:00
|
|
|
if (player == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 17:34:52 -07:00
|
|
|
var ticker = _e.System<GameTicker>();
|
2020-12-03 03:40:47 +01:00
|
|
|
ticker.ToggleReady(player, bool.Parse(args[0]));
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-02-01 16:49:43 -08:00
|
|
|
}
|