diff --git a/Content.Server/Administration/ReadyAll.cs b/Content.Server/Administration/ReadyAll.cs new file mode 100644 index 0000000000..a03a5b447e --- /dev/null +++ b/Content.Server/Administration/ReadyAll.cs @@ -0,0 +1,39 @@ +using Content.Server.GameTicking; +using Content.Server.Interfaces.GameTicking; +using Robust.Server.Interfaces.Console; +using Robust.Server.Interfaces.Player; +using Robust.Shared.IoC; + +namespace Content.Server.Administration +{ + public class ReadyAll : IClientCommand + { + public string Command => "readyall"; + public string Description => "Readies up all players in the lobby."; + public string Help => $"{Command} | ̣{Command} "; + public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args) + { + var ready = true; + + if (args.Length > 0) + { + ready = bool.Parse(args[0]); + } + + var gameTicker = IoCManager.Resolve(); + var playerManager = IoCManager.Resolve(); + + + if (gameTicker.RunLevel != GameRunLevel.PreRoundLobby) + { + shell.SendText(player, "This command can only be ran while in the lobby!"); + return; + } + + foreach (var p in playerManager.GetAllPlayers()) + { + gameTicker.ToggleReady(p, ready); + } + } + } +} diff --git a/Resources/Groups/groups.yml b/Resources/Groups/groups.yml index ea45d9a588..e18adbfd95 100644 --- a/Resources/Groups/groups.yml +++ b/Resources/Groups/groups.yml @@ -96,6 +96,7 @@ - tilewalls - events - destroymechanism + - readyall CanViewVar: true CanAdminPlace: true @@ -186,6 +187,7 @@ - tilewalls - events - destroymechanism + - readyall CanViewVar: true CanAdminPlace: true CanScript: true