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

@@ -231,7 +231,7 @@ namespace Content.Server.GameTicking
public void MakeJoinGame(IPlayerSession player, EntityUid station, string? jobId = null)
{
if (!_playersInLobby.ContainsKey(player))
if (!_playerGameStatuses.ContainsKey(player.UserId))
return;
if (!_userDb.IsLoadComplete(player))
@@ -265,8 +265,8 @@ namespace Content.Server.GameTicking
EntitySystem.Get<SharedGhostSystem>().SetCanReturnToBody(ghost, false);
newMind.TransferTo(mob);
_playersInLobby[player] = LobbyPlayerStatus.Observer;
RaiseNetworkEvent(GetStatusSingle(player, LobbyPlayerStatus.Observer));
_playerGameStatuses[player.UserId] = PlayerGameStatus.JoinedGame;
RaiseNetworkEvent(GetStatusSingle(player, PlayerGameStatus.JoinedGame));
}
#region Mob Spawning Helpers