2021-07-17 02:37:09 +02:00
|
|
|
|
using Content.Server.GameTicking;
|
2020-10-30 16:06:48 +01:00
|
|
|
|
using Content.Shared.Administration;
|
2021-09-23 13:00:28 +02:00
|
|
|
|
using Content.Shared.GameTicking;
|
2021-02-11 01:13:03 -08:00
|
|
|
|
using Robust.Server.Player;
|
2021-02-01 16:49:43 -08:00
|
|
|
|
using Robust.Shared.Console;
|
2021-06-20 10:09:24 +02:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-08-20 15:19:36 +02:00
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
2020-10-30 16:06:48 +01:00
|
|
|
|
namespace Content.Server.Administration.Commands
|
2020-08-20 15:19:36 +02:00
|
|
|
|
{
|
2021-11-29 14:40:10 -06:00
|
|
|
|
[AdminCommand(AdminFlags.Round)]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class ReadyAll : IConsoleCommand
|
2020-08-20 15:19:36 +02:00
|
|
|
|
{
|
|
|
|
|
|
public string Command => "readyall";
|
2021-09-23 13:00:28 +02:00
|
|
|
|
public string Description => "Readies up all players in the lobby, except for observers.";
|
2020-08-20 15:19:36 +02:00
|
|
|
|
public string Help => $"{Command} | ̣{Command} <ready>";
|
2021-02-01 16:49:43 -08:00
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-08-20 15:19:36 +02:00
|
|
|
|
{
|
|
|
|
|
|
var ready = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (args.Length > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
ready = bool.Parse(args[0]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
var gameTicker = EntitySystem.Get<GameTicker>();
|
2020-08-20 15:19:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
|
|
|
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
|
shell.WriteLine("This command can only be ran while in the lobby!");
|
2020-08-20 15:19:36 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-09-23 13:18:48 +02:00
|
|
|
|
foreach (var (player, status) in gameTicker.PlayersInLobby)
|
2020-08-20 15:19:36 +02:00
|
|
|
|
{
|
2021-09-23 13:18:48 +02:00
|
|
|
|
if(status != LobbyPlayerStatus.Observer)
|
|
|
|
|
|
gameTicker.ToggleReady(player, ready);
|
2020-08-20 15:19:36 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|