* PROJECT 0 WARNINGS: Resolve `'EntitySystem.Get<T>()' is obsolete` in content * pass entman * dog ass test * webeditor
33 lines
894 B
C#
33 lines
894 B
C#
using Content.Shared.Administration;
|
|
using Robust.Shared.Console;
|
|
|
|
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]));
|
|
}
|
|
}
|
|
}
|