File tree Expand file tree Collapse file tree 3 files changed +47
-48
lines changed
Assets/BossRoom/Scripts/Client/UI Expand file tree Collapse file tree 3 files changed +47
-48
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using Unity . Multiplayer . Samples . BossRoom . Client ;
3
+ using Unity . Multiplayer . Samples . BossRoom . Shared . Infrastructure ;
4
+ using Unity . Multiplayer . Samples . BossRoom . Shared . Net . UnityServices . Infrastructure ;
5
+ using Unity . Services . Lobbies ;
6
+ using UnityEngine ;
7
+
8
+ namespace Unity . Multiplayer . Samples . BossRoom . Visual
9
+ {
10
+ public class UnityServicesUIHandler : MonoBehaviour
11
+ {
12
+ IDisposable m_Subscriptions ;
13
+
14
+ void Awake ( )
15
+ {
16
+ DontDestroyOnLoad ( gameObject ) ;
17
+ }
18
+
19
+ [ Inject ]
20
+ void Initialize ( ISubscriber < UnityServiceErrorMessage > serviceError )
21
+ {
22
+ m_Subscriptions = serviceError . Subscribe ( ServiceErrorHandler ) ;
23
+ }
24
+
25
+ void ServiceErrorHandler ( UnityServiceErrorMessage error )
26
+ {
27
+ var errorMessage = error . Message ;
28
+ if ( error . AffectedService == UnityServiceErrorMessage . Service . Lobby )
29
+ {
30
+ if ( ( error . OriginalException as LobbyServiceException ) . Reason == LobbyExceptionReason . LobbyConflict )
31
+ {
32
+ // LobbyConflict can have multiple causes. Let's add other solutions here if there's other situations that arise for this.
33
+ errorMessage += "\n See logs for possible causes and solution." ;
34
+ Debug . LogError ( $ "Got service error { error . Message } with LobbyConflict. Possible conflict cause: Trying to play with two builds on the " +
35
+ $ "same machine. Please use command line arg '{ ClientMainMenuState . AuthProfileCommandLineArg } someName' to set a different auth profile.\n ") ;
36
+ }
37
+ }
38
+
39
+ PopupPanel . ShowPopupPanel ( "Service error" , errorMessage ) ;
40
+ }
41
+
42
+ void OnDestroy ( )
43
+ {
44
+ m_Subscriptions . Dispose ( ) ;
45
+ }
46
+ }
47
+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments