Skip to content

Fix for clients getting nullref when lobby host disconnects #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Assets/BossRoom/Scripts/Client/UI/UnityServicesUIHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ void ServiceErrorHandler(UnityServiceErrorMessage error)
var errorMessage = error.Message;
if (error.AffectedService == UnityServiceErrorMessage.Service.Lobby)
{
if ((error.OriginalException as LobbyServiceException).Reason == LobbyExceptionReason.LobbyConflict)
if (error.OriginalException is LobbyServiceException lobbyServiceException)
{
// LobbyConflict can have multiple causes. Let's add other solutions here if there's other situations that arise for this.
errorMessage += "\nSee logs for possible causes and solution.";
Debug.LogError($"Got service error {error.Message} with LobbyConflict. Possible conflict cause: Trying to play with two builds on the " +
$"same machine. Please use command line arg '{ClientMainMenuState.AuthProfileCommandLineArg} someName' to set a different auth profile.\n");
if (lobbyServiceException.Reason == LobbyExceptionReason.LobbyConflict)
{
// LobbyConflict can have multiple causes. Let's add other solutions here if there's other situations that arise for this.
errorMessage += "\nSee logs for possible causes and solution.";
Debug.LogError($"Got service error {error.Message} with LobbyConflict. Possible conflict cause: Trying to play with two builds on the " +
$"same machine. Please use command line arg '{ClientMainMenuState.AuthProfileCommandLineArg} someName' to set a different auth profile.\n");
}
}
}

Expand Down