mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Run disconnect callbacks after removing channel from lists
Similar to the previous changes to player sessions, but now one layer lower. Fixed ServerSendToAll from the relevant callbacks sending to a disconnected channel.
This commit is contained in:
@@ -35,7 +35,7 @@ END TEMPLATE-->
|
||||
|
||||
### Breaking changes
|
||||
|
||||
*None yet*
|
||||
* When a player disconnects, the relevant callbacks are now fired *after* removing the channel from `INetManager`.
|
||||
|
||||
### New features
|
||||
|
||||
|
||||
@@ -827,6 +827,10 @@ namespace Robust.Shared.Network
|
||||
_assignedUsernames.Remove(channel.UserName);
|
||||
_assignedUserIds.Remove(channel.UserId);
|
||||
|
||||
_channels.Remove(connection);
|
||||
peer.RemoveChannel(channel);
|
||||
channel.EncryptionChannel?.Complete();
|
||||
|
||||
#if EXCEPTION_TOLERANCE
|
||||
try
|
||||
{
|
||||
@@ -842,9 +846,6 @@ namespace Robust.Shared.Network
|
||||
_logger.Error("Caught exception in OnDisconnected handler:\n{0}", e);
|
||||
}
|
||||
#endif
|
||||
_channels.Remove(connection);
|
||||
peer.RemoveChannel(channel);
|
||||
channel.EncryptionChannel?.Complete();
|
||||
|
||||
if (IsClient)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user