Skip to content

lobby fix: Removing quit when lobby detects host left. #505

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
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions Assets/BossRoom/Scripts/Shared/ApplicationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ public void QuitGame()
}
else
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void OnSuccess(Lobby lobby)
CurrentUnityLobby = lobby;
m_LocalLobby.ApplyRemoteData(lobby);

// as client, check if host is still in lobby
if (!m_LocalUser.IsHost)
{
foreach (var lobbyUser in m_LocalLobby.LobbyUsers)
Expand All @@ -126,7 +127,7 @@ void OnSuccess(Lobby lobby)
}
m_UnityServiceErrorMessagePub.Publish(new UnityServiceErrorMessage("Host left the lobby","Disconnecting."));
ForceLeaveLobbyAttempt();
m_ApplicationController.QuitGame();
// no need to disconnect NGO, it should already be handled by NGO callback to disconnect
}
}
}
Expand Down