You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added switch-case to only show popups for Lobby exceptions pertinent to the users
* Adding input sanitization for join code
Co-authored-by: Philipp Deschain <[email protected]>
errorMessage+="\nSee logs for possible causes and solution.";
59
-
Debug.LogError($"Got service error {error.Message} with LobbyConflict. Possible conflict cause: Trying to play with two builds on the "+
60
-
$"same machine. Please use command line arg '{ProfileManager.AuthProfileCommandLineArg} someName' to set a different auth profile.\n");
61
-
break;
62
-
}
63
-
caseLobbyExceptionReason.LobbyFull:
55
+
switch(exception.Reason)
64
56
{
65
-
PopupManager.ShowPopupPanel("Failed to join lobby","Lobby is full and can't accept more players");
66
-
// Returning out of the function because we replace default popup panel with this.
67
-
return;
57
+
// If the error is one of the following, the player needs to know about it, so show in a popup message. Otherwise, the log in the console is sufficient.
58
+
caseLobbyExceptionReason.ValidationError:
59
+
PopupManager.ShowPopupPanel("Validation Error","Validation check failed on Lobby. Is the join code correctly formatted?");
60
+
break;
61
+
caseLobbyExceptionReason.LobbyNotFound:
62
+
PopupManager.ShowPopupPanel("Lobby Not Found","Requested lobby not found. The join code is incorrect or the lobby has ended.");
63
+
break;
64
+
caseLobbyExceptionReason.LobbyConflict:
65
+
// LobbyConflict can have multiple causes. Let's add other solutions here if there's other situations that arise for this.
66
+
Debug.LogError($"Got service error {error.Message} with LobbyConflict. Possible conflict cause: Trying to play with two builds on the "+
67
+
$"same machine. Please use command line arg '{ProfileManager.AuthProfileCommandLineArg} someName' to set a different auth profile.\n");
68
+
PopupManager.ShowPopupPanel("Failed to join Lobby","Failed to join Lobby due to a conflict. See logs for more details.");
69
+
break;
70
+
caseLobbyExceptionReason.NoOpenLobbies:
71
+
PopupManager.ShowPopupPanel("Failed to join Lobby","No accessible lobbies are currently available for quick-join.");
72
+
break;
73
+
caseLobbyExceptionReason.LobbyFull:
74
+
PopupManager.ShowPopupPanel("Failed to join Lobby","Lobby is full and can't accept more players.");
75
+
break;
76
+
caseLobbyExceptionReason.Unauthorized:
77
+
PopupManager.ShowPopupPanel("Lobby error","Received HTTP error 401 Unauthorized from Lobby Service.");
78
+
break;
79
+
caseLobbyExceptionReason.RequestTimeOut:
80
+
PopupManager.ShowPopupPanel("Lobby error","Received HTTP error 408 Request timed out from Lobby Service.");
0 commit comments