2021-02-01 16:49:43 -08:00
|
|
|
using Content.Server.Administration;
|
2021-12-13 16:45:49 +11:00
|
|
|
using Content.Shared.Administration;
|
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-12-03 03:40:47 +01:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.GameTicking.Commands
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
|
|
|
|
[AnyCommand]
|
2022-02-16 00:23:23 -07:00
|
|
|
sealed class ObserveCommand : IConsoleCommand
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
|
|
|
|
public string Command => "observe";
|
|
|
|
|
public string Description => "";
|
|
|
|
|
public string Help => "";
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
2021-12-21 21:23:29 +01:00
|
|
|
if (shell.Player is not IPlayerSession player)
|
2020-12-03 03:40:47 +01:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
var ticker = EntitySystem.Get<GameTicker>();
|
2021-12-21 21:23:29 +01:00
|
|
|
|
|
|
|
|
if (ticker.RunLevel == GameRunLevel.PreRoundLobby)
|
|
|
|
|
{
|
|
|
|
|
shell.WriteError("Wait until the round starts.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-27 19:28:32 -06:00
|
|
|
if (ticker.PlayersInLobby.ContainsKey(player))
|
|
|
|
|
ticker.MakeObserve(player);
|
|
|
|
|
else
|
|
|
|
|
shell.WriteError($"{player.Name} is not in the lobby. This incident will be reported.");
|
2020-12-03 03:40:47 +01:00
|
|
|
}
|
|
|
|
|
}
|
2021-02-01 16:49:43 -08:00
|
|
|
}
|