mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user