diff --git a/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs b/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs index b2ba6cd18..874864a40 100644 --- a/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs +++ b/Assets/Scripts/ApplicationLifecycle/ApplicationController.cs @@ -17,15 +17,17 @@ namespace Unity.BossRoom.ApplicationLifecycle { - /// /// An entry point to the application, where we bind all the common dependencies to the root DI scope. /// public class ApplicationController : LifetimeScope { - [SerializeField] UpdateRunner m_UpdateRunner; - [SerializeField] ConnectionManager m_ConnectionManager; - [SerializeField] NetworkManager m_NetworkManager; + [SerializeField] + UpdateRunner m_UpdateRunner; + [SerializeField] + ConnectionManager m_ConnectionManager; + [SerializeField] + NetworkManager m_NetworkManager; LocalLobby m_LocalLobby; LobbyServiceFacade m_LobbyServiceFacade; @@ -116,17 +118,21 @@ private IEnumerator LeaveBeforeQuit() { Debug.LogError(e.Message); } + yield return null; Application.Quit(); } private bool OnWantToQuit() { + Application.wantsToQuit -= OnWantToQuit; + var canQuit = string.IsNullOrEmpty(m_LocalLobby?.LobbyID); if (!canQuit) { StartCoroutine(LeaveBeforeQuit()); } + return canQuit; } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb0974a5..8523c57b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,6 @@ Additional documentation and release notes are available at [Multiplayer Documen * Upgraded Authentication Service package to v2.7.1 * Upgraded Boss Room to Netcode for GameObjects v1.6.0 (#865) * A package Version Define has been created for Netcode for GameObjects v.1.5.2 - v1.6.0. Recent refactorings to NetworkManager's shutdown have prevented the ability to invoke CustomMessages when OnClientDisconnected callbacks are invoked during a shutdown as host. This regression has caused one of our runtime tests, namely Unity.BossRoom.Tests.Runtime.ConnectionManagementTests.UnexpectedServerShutdown_ClientsFailToReconnect, to fail and it does not impact gameplay. This is a known issue and will be addressed in a future NGO version. - -### Changed * Upgraded to Lobby 1.1.0 (#860). * Lobbies are now locked when being created and are only unlocked when the relay allocation is ready. * Removed explicit reference to Wire in the package manifest, since Wire is already a dependency of Lobby @@ -22,6 +20,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed * Fixed colliders on diagonal walls to not have negative scale (#854). * Unnecessary update requests are no longer being sent to Lobby after receiving update events from the service (#860). +* Fixed a condition where one would be unable to quit the application through OS-level quit button, nor the in-game quit button (#863) ## [2.2.0] - 2023-07-06