Show a message when players chose to remain in the lobby due to preferences. (#12130)

This commit is contained in:
Mervill
2022-10-29 23:49:43 -07:00
committed by GitHub
parent b6135d3be5
commit e55acca504
3 changed files with 23 additions and 9 deletions

View File

@@ -65,9 +65,17 @@ namespace Content.Server.GameTicking
// Calculate extended access for stations.
var stationJobCounts = _stationSystem.Stations.ToDictionary(e => e, _ => 0);
foreach (var (_, (_, station)) in assignedJobs)
foreach (var (netUser, (job, station)) in assignedJobs)
{
stationJobCounts[station] += 1;
if (job == null)
{
var playerSession = _playerManager.GetSessionByUserId(netUser);
_chatManager.DispatchServerMessage(playerSession, Loc.GetString("job-not-available-wait-in-lobby"));
}
else
{
stationJobCounts[station] += 1;
}
}
_stationJobs.CalcExtendedAccess(stationJobCounts);
@@ -75,6 +83,9 @@ namespace Content.Server.GameTicking
// Spawn everybody in!
foreach (var (player, (job, station)) in assignedJobs)
{
if (job == null)
continue;
SpawnPlayer(_playerManager.GetSessionByUserId(player), profiles[player], station, job, false);
}