Refactor lobby status (#10550)

This commit is contained in:
wrexbe
2022-08-14 12:54:49 -07:00
committed by GitHub
parent c535214aa2
commit c4d135e253
15 changed files with 126 additions and 108 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Administration;
using Content.Shared.GameTicking;
using Robust.Server.Player;
using Robust.Shared.Console;
@@ -26,10 +27,15 @@ namespace Content.Server.GameTicking.Commands
return;
}
if (ticker.PlayersInLobby.ContainsKey(player))
if (ticker.PlayerGameStatuses.TryGetValue(player.UserId, out var status) &&
status != PlayerGameStatus.JoinedGame)
{
ticker.MakeObserve(player);
}
else
{
shell.WriteError($"{player.Name} is not in the lobby. This incident will be reported.");
}
}
}
}