@@ -107,6 +107,7 @@ public void OnUserDisconnectRequest()
107
107
{
108
108
StopCoroutine ( m_TryToReconnectCoroutine ) ;
109
109
m_TryToReconnectCoroutine = null ;
110
+ m_ReconnectMessagePub . Publish ( new ReconnectMessage ( k_NbReconnectAttempts , k_NbReconnectAttempts ) ) ;
110
111
}
111
112
// If we are the server, shutdown will be handled by ServerGameNetPortal
112
113
if ( ! m_Portal . NetManager . IsServer )
@@ -133,6 +134,7 @@ public void OnConnectFinished(ConnectStatus status)
133
134
{
134
135
StopCoroutine ( m_TryToReconnectCoroutine ) ;
135
136
m_TryToReconnectCoroutine = null ;
137
+ m_ReconnectMessagePub . Publish ( new ReconnectMessage ( k_NbReconnectAttempts , k_NbReconnectAttempts ) ) ;
136
138
}
137
139
m_ConnectStatusPub . Publish ( status ) ;
138
140
if ( m_LobbyServiceFacade . CurrentUnityLobby != null )
@@ -229,13 +231,7 @@ private IEnumerator TryToReconnect(string lobbyCode)
229
231
230
232
// If the coroutine has not been stopped before this, it means we failed to connect during all attempts
231
233
Debug . Log ( "All tries failed, returning to main menu" ) ;
232
- m_LobbyServiceFacade . EndTracking ( ) ;
233
- if ( NetworkManager . Singleton . IsListening )
234
- {
235
- NetworkManager . Singleton . Shutdown ( ) ;
236
- }
237
-
238
- SceneLoaderWrapper . Instance . LoadScene ( "MainMenu" ) ;
234
+ m_ApplicationController . LeaveSession ( false ) ;
239
235
if ( ! DisconnectReason . HasTransitionReason )
240
236
{
241
237
DisconnectReason . SetDisconnectReason ( ConnectStatus . GenericDisconnect ) ;
0 commit comments