Skip to content

Commit 2eb198a

Browse files
committed
better error message handling for authentication errors
showing the error message along with a tip - the user can always use direct ip option to connect
1 parent d9e3b40 commit 2eb198a

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using System;
2-
using System.Runtime.CompilerServices;
32
using Unity.Multiplayer.Samples.BossRoom.Client;
43
using Unity.Multiplayer.Samples.BossRoom.Shared.Infrastructure;
54
using Unity.Multiplayer.Samples.BossRoom.Shared.Net.UnityServices.Infrastructure;
6-
using Unity.Services.Authentication;
75
using Unity.Services.Lobbies;
86
using UnityEngine;
97

@@ -44,14 +42,9 @@ void ServiceErrorHandler(UnityServiceErrorMessage error)
4442
}
4543
case UnityServiceErrorMessage.Service.Authentication:
4644
{
47-
if (error.OriginalException is AuthenticationException exception)
48-
{
49-
PopupPanel.ShowPopupPanel("Authentication Error",
50-
$"For some reason we can't authenticate the user anonymously - that typically means that project is not properly " +
51-
$"set up with Unity services or that there is no internet connection." +
52-
$" You can still use the Direct IP connection option. {exception.Message}");
53-
54-
}
45+
PopupPanel.ShowPopupPanel(
46+
"Authentication Error",
47+
$"{error.Message} \n\n tip: You can still use the Direct IP connection option.");
5548
break;
5649
}
5750
default:

0 commit comments

Comments
 (0)