Files
crystall-punk-14/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs

33 lines
894 B
C#
Raw Permalink Normal View History

using Content.Shared.Administration;
using Robust.Shared.Console;
2021-06-09 22:19:39 +02:00
namespace Content.Server.GameTicking.Commands
{
[AnyCommand]
sealed class ToggleReadyCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _e = default!;
public string Command => "toggleready";
public string Description => "";
public string Help => "";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var player = shell.Player;
if (args.Length != 1)
{
shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
return;
}
if (player == null)
{
return;
}
var ticker = _e.System<GameTicker>();
ticker.ToggleReady(player, bool.Parse(args[0]));
}
}
}