Skip to content

Commit 781c834

Browse files
committed
fix: added error message for uncaught same profile already in session error
1 parent 2fc8c1f commit 781c834

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Assets/Scripts/Gameplay/UI/UnityServicesUIHandler.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ void HandleSessionError(UnityServiceErrorMessage error)
7070
break;
7171
}
7272
}
73+
else
74+
{
75+
PopupManager.ShowPopupPanel("Unknown Issue", error.Message);
76+
}
7377
}
7478

7579
void OnDestroy()

Assets/Scripts/UnityServices/Sessions/MultiplayerServicesFacade.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ public void EndTracking()
188188

189189
try
190190
{
191+
var joinedSessionList = await MultiplayerService.Instance.GetJoinedSessionIdsAsync();
192+
if (joinedSessionList.Contains(sessionName))
193+
{
194+
throw new Exception($"Already joined session {sessionName}") ;
195+
}
191196
var session = await m_MultiplayerServicesInterface.JoinSessionById(sessionName, m_LocalUser.GetDataForUnityServices());
192197
return (true, session);
193198
}

0 commit comments

Comments
 (0)