Skip to content

Commit 6b323e7

Browse files
better error messages and lobby fix (#550)
fixing issue where it's possible if there's an exception during updating lobby, query count never goes back to 0
1 parent f3fad54 commit 6b323e7

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ long SetupPopupPanel(string titleText, string mainText, bool isCloseableByUser =
9393
{
9494
if (m_IsPopupShown)
9595
{
96-
Debug.Log("Trying to show popup, but another popup is already being shown.");
97-
Debug.Log($"{titleText}. {mainText}");
96+
Debug.LogWarning($"Trying to show popup, but another popup is already being shown. Popup: {titleText}. {mainText}");
9897
return -1;
9998
}
10099

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void ServiceErrorHandler(UnityServiceErrorMessage error)
4848
}
4949
default:
5050
{
51-
PopupPanel.ShowPopupPanel("Service error", errorMessage);
51+
PopupPanel.ShowPopupPanel("Service error: "+error.Title, errorMessage);
5252
break;
5353
}
5454
}

Assets/BossRoom/Scripts/Shared/Net/UnityServices/Lobbies/JoinedLobbyContentHeartbeat.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ void OnUpdate(float dt)
7474

7575
if (m_LocalUser.IsHost)
7676
{
77-
m_AwaitingQueryCount++;
78-
m_LobbyServiceFacade.UpdateLobbyDataAsync(m_LocalLobby.GetDataForUnityServices(), OnSuccess, null);
77+
m_AwaitingQueryCount++; // todo this should disapear once we use await correctly. This causes issues at the moment if OnSuccess isn't called properly
78+
m_LobbyServiceFacade.UpdateLobbyDataAsync(m_LocalLobby.GetDataForUnityServices(), OnSuccess, () => m_AwaitingQueryCount--);
7979
}
8080
m_AwaitingQueryCount++;
81-
m_LobbyServiceFacade.UpdatePlayerDataAsync(m_LocalUser.GetDataForUnityServices(), OnSuccess, null);
81+
m_LobbyServiceFacade.UpdatePlayerDataAsync(m_LocalUser.GetDataForUnityServices(), OnSuccess, () => m_AwaitingQueryCount--);
8282
}
8383

8484
void OnSuccess()

0 commit comments

Comments
 (0)