mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: #3365 NetworkClient.OnTransportDisconnected now always invokes OnDisconnected, even during connecting phase
This commit is contained in:
parent
e21d42a324
commit
7d2d21ac2c
@ -383,7 +383,13 @@ internal static void OnTransportDisconnected()
|
|||||||
|
|
||||||
// Raise the event before changing ConnectState
|
// Raise the event before changing ConnectState
|
||||||
// because 'active' depends on this during shutdown
|
// because 'active' depends on this during shutdown
|
||||||
if (connection != null) OnDisconnectedEvent?.Invoke();
|
//
|
||||||
|
// previously OnDisconnected was only invoked if connection != null.
|
||||||
|
// however, if DNS resolve fails in Transport.Connect(),
|
||||||
|
// OnDisconnected would never be called because 'connection' is only
|
||||||
|
// create after the Transport.Connect() call.
|
||||||
|
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3365
|
||||||
|
OnDisconnectedEvent?.Invoke();
|
||||||
|
|
||||||
connectState = ConnectState.Disconnected;
|
connectState = ConnectState.Disconnected;
|
||||||
ready = false;
|
ready = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user