Raise PlayerStatusChanged after removing disconnected players

This makes it so players aren't in the Sessions list anymore when their status is Disconnected.

Fixes SS14's lobby code sending lobby status updates to the just-disconnected player, which logs an error with the recent net message changes.
This commit is contained in:
PJB3005
2025-08-05 17:31:29 +02:00
parent b4863dcc38
commit 8cbc5d4cd8
2 changed files with 2 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ END TEMPLATE-->
* A new analyzer has been added that will error if you attempt to subscribe to `AfterAutoHandleStateEvent` on a
component that doesn't have the `AutoGenerateComponentState` attribute, or doesn't have the first argument of that
attribute set to `true`. In most cases you will want to set said argument to `true`.
* When a player disconnects, `ISharedPlayerManager.PlayerStatusChanged` is now fired *after* removing the session from the `Sessions` list.
### New features

View File

@@ -103,6 +103,7 @@ namespace Robust.Server.Player
if (!TryGetSessionById(user, out var session))
return;
RemoveSession(session.UserId);
SetStatus(session, SessionStatus.Disconnected);
SetAttachedEntity(session, null, out _, true);
@@ -112,7 +113,6 @@ namespace Robust.Server.Player
viewSys.RemoveViewSubscriber(eye, session);
}
RemoveSession(session.UserId);
PlayerCountMetric.Set(PlayerCount);
Dirty();
}