ReadyAll no longer spawns people who are observing

Fixes #4650
This commit is contained in:
Vera Aguilera Puerto
2021-09-23 13:00:28 +02:00
parent 05a9528cd8
commit 55393699b1
2 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.GameTicking;
using Content.Shared.Administration;
using Content.Shared.GameTicking;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
@@ -11,7 +12,7 @@ namespace Content.Server.Administration.Commands
public class ReadyAll : IConsoleCommand
{
public string Command => "readyall";
public string Description => "Readies up all players in the lobby.";
public string Description => "Readies up all players in the lobby, except for observers.";
public string Help => $"{Command} | ̣{Command} <ready>";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
@@ -34,7 +35,8 @@ namespace Content.Server.Administration.Commands
foreach (var p in playerManager.GetAllPlayers())
{
gameTicker.ToggleReady(p, ready);
if(gameTicker.PlayersInLobby[p] != LobbyPlayerStatus.Observer)
gameTicker.ToggleReady(p, ready);
}
}
}

View File

@@ -28,6 +28,8 @@ namespace Content.Server.GameTicking
[ViewVariables]
private bool _roundStartCountdownHasNotStartedYetDueToNoPlayers;
public IReadOnlyDictionary<IPlayerSession, LobbyPlayerStatus> PlayersInLobby => _playersInLobby;
private void UpdateInfoText()
{
RaiseNetworkEvent(GetInfoMsg(), Filter.Empty().AddPlayers(_playersInLobby.Keys));