Skip to content

Commit e2347f5

Browse files
committed
fix for being unable to StartClient again if there's a failed reconnect attempt
1 parent 868ae04 commit e2347f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Assets/BossRoom/Scripts/Shared/Net/ConnectionManagement/ClientGameNetPortal.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ private IEnumerator TryToReconnect(string lobbyCode)
225225
// If the coroutine has not been stopped before this, it means we failed to connect during all attempts
226226
Debug.Log("All tries failed, returning to main menu");
227227
m_LobbyServiceFacade.ForceLeaveLobbyAttempt();
228+
if (NetworkManager.Singleton.IsListening)
229+
{
228230
NetworkManager.Singleton.Shutdown();
231+
}
232+
229233
SceneLoaderWrapper.Instance.LoadScene("MainMenu");
230234
if (!DisconnectReason.HasTransitionReason)
231235
{

0 commit comments

Comments
 (0)