Skip to content
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

fix: unable to quit application with application exit or in-game exit button [MTT-7003] #863

Merged
merged 5 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
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
14 changes: 10 additions & 4 deletions Assets/Scripts/ApplicationLifecycle/ApplicationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@

namespace Unity.BossRoom.ApplicationLifecycle
{

/// <summary>
/// An entry point to the application, where we bind all the common dependencies to the root DI scope.
/// </summary>
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;
Expand Down Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ 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

### 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

Expand Down