Skip to content

Commit eda9e9b

Browse files
committed
fix: while updating lobby, query count wasn't always back to 0 (#550)
1 parent 87e20e2 commit eda9e9b

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
@@ -67,8 +67,7 @@ void SetupPopupPanel(string titleText, string mainText)
6767
{
6868
if (m_IsPopupShown)
6969
{
70-
Debug.Log("Trying to show popup, but another popup is already being shown.");
71-
Debug.Log($"{titleText}. {mainText}");
70+
Debug.LogWarning($"Trying to show popup, but another popup is already being shown. Popup: {titleText}. {mainText}");
7271
}
7372
else
7473
{

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)