Skip to content

Commit 37f5ef7

Browse files
committed
making sure reconnection popup is closed when successful or cancelled
1 parent 9395f61 commit 37f5ef7

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Assets/BossRoom/Scripts/Client/UI/ConnectionStatusMessageUIManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ void OnConnectStatus(ConnectStatus status)
4242
PopupManager.ShowPopupPanel("Connection Failed", "The Host is full and cannot accept any additional connections.");
4343
break;
4444
case ConnectStatus.Success:
45-
CloseReconnectPopup();
4645
break;
4746
case ConnectStatus.LoggedInAgain:
4847
PopupManager.ShowPopupPanel("Connection Failed", "You have logged in elsewhere using the same account.");

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public void OnUserDisconnectRequest()
107107
{
108108
StopCoroutine(m_TryToReconnectCoroutine);
109109
m_TryToReconnectCoroutine = null;
110+
m_ReconnectMessagePub.Publish(new ReconnectMessage(k_NbReconnectAttempts, k_NbReconnectAttempts));
110111
}
111112
// If we are the server, shutdown will be handled by ServerGameNetPortal
112113
if (!m_Portal.NetManager.IsServer)
@@ -133,6 +134,7 @@ public void OnConnectFinished(ConnectStatus status)
133134
{
134135
StopCoroutine(m_TryToReconnectCoroutine);
135136
m_TryToReconnectCoroutine = null;
137+
m_ReconnectMessagePub.Publish(new ReconnectMessage(k_NbReconnectAttempts, k_NbReconnectAttempts));
136138
}
137139
m_ConnectStatusPub.Publish(status);
138140
if (m_LobbyServiceFacade.CurrentUnityLobby != null)
@@ -229,13 +231,7 @@ private IEnumerator TryToReconnect(string lobbyCode)
229231

230232
// If the coroutine has not been stopped before this, it means we failed to connect during all attempts
231233
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);
239235
if (!DisconnectReason.HasTransitionReason)
240236
{
241237
DisconnectReason.SetDisconnectReason(ConnectStatus.GenericDisconnect);

0 commit comments

Comments
 (0)