mirror of
https://github.com/Empostor/Empostor.git
synced 2026-10-20 01:46:07 +00:00
Fix
This commit is contained in:
1 parent
41b63f653c
commit
9dd45f35f7
1 file changed
+6
-15
@@ -116,22 +116,13 @@ namespace Empostor.Server.Net.State
|
||||
|
||||
private async ValueTask CheckLimboPlayers()
|
||||
{
|
||||
foreach (var (_, player) in _players.Where(x => x.Value.Limbo == LimboStates.WaitingForHost))
|
||||
var limboPlayers = _players.Where(x => x.Value.Limbo == LimboStates.WaitingForHost);
|
||||
foreach (var (_, player) in limboPlayers)
|
||||
{
|
||||
// Pull players out of limbo and start their spawn timeout so a failed
|
||||
// spawn is not silently stuck. Clear any stale Character too, so the
|
||||
// spawn timeout can actually fire (a leftover Character != null would
|
||||
// skip the timeout and leave the player stuck).
|
||||
// (The PR's HandleJoinGameNext approach would re-set WaitingForHost
|
||||
// and leave the player stuck on the wait-for-host screen, so we keep
|
||||
// the direct pull-out instead.)
|
||||
player.Character = null;
|
||||
player.InitializeSpawnTimeout();
|
||||
using var message = MessageWriter.Get(MessageType.Reliable);
|
||||
WriteJoinedGameMessage(message, true, player);
|
||||
WriteAlterGameMessage(message, false, IsPublic);
|
||||
player.Limbo = LimboStates.NotLimbo;
|
||||
await SendToAsync(message, player.Client.Id);
|
||||
// Pull the player out of limbo via HandleJoinGameNew (not
|
||||
// HandleJoinGameNext, which re-sets WaitingForHost and would
|
||||
// leave the player stuck on the wait-for-host screen).
|
||||
await HandleJoinGameNew(player, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user