1
0

ToggleReadyCommand.cs 894 B

1234567891011121314151617181920212223242526272829303132
  1. using Content.Shared.Administration;
  2. using Robust.Shared.Console;
  3. namespace Content.Server.GameTicking.Commands
  4. {
  5. [AnyCommand]
  6. sealed class ToggleReadyCommand : IConsoleCommand
  7. {
  8. [Dependency] private readonly IEntityManager _e = default!;
  9. public string Command => "toggleready";
  10. public string Description => "";
  11. public string Help => "";
  12. public void Execute(IConsoleShell shell, string argStr, string[] args)
  13. {
  14. var player = shell.Player;
  15. if (args.Length != 1)
  16. {
  17. shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
  18. return;
  19. }
  20. if (player == null)
  21. {
  22. return;
  23. }
  24. var ticker = _e.System<GameTicker>();
  25. ticker.ToggleReady(player, bool.Parse(args[0]));
  26. }
  27. }
  28. }