Skip to content

Commit d3ec2e2

Browse files
committed
cleanup
1 parent a5395d8 commit d3ec2e2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ 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-
if (m_CurrentReconnectPopup != null)
46-
{
47-
m_CurrentReconnectPopup.Hide();
48-
m_CurrentReconnectPopup = null;
49-
}
45+
CloseReconnectPopup();
5046
break;
5147
case ConnectStatus.LoggedInAgain:
5248
PopupManager.ShowPopupPanel("Connection Failed", "You have logged in elsewhere using the same account.");
@@ -72,8 +68,7 @@ void OnReconnectMessage(ReconnectMessage message)
7268
{
7369
if (message.CurrentAttempt == message.MaxAttempt)
7470
{
75-
m_CurrentReconnectPopup.Hide();
76-
m_CurrentReconnectPopup = null;
71+
CloseReconnectPopup();
7772
}
7873
else if (m_CurrentReconnectPopup != null)
7974
{
@@ -83,7 +78,15 @@ void OnReconnectMessage(ReconnectMessage message)
8378
{
8479
m_CurrentReconnectPopup = PopupManager.ShowPopupPanel("Connection lost", $"Attempting to reconnect...\nAttempt {message.CurrentAttempt+1}/{message.MaxAttempt}", closeableByUser: false);
8580
}
81+
}
8682

83+
void CloseReconnectPopup()
84+
{
85+
if (m_CurrentReconnectPopup != null)
86+
{
87+
m_CurrentReconnectPopup.Hide();
88+
m_CurrentReconnectPopup = null;
89+
}
8790
}
8891
}
8992
}

0 commit comments

Comments
 (0)