Skip to content

Commit 6a34818

Browse files
committed
Removing quit when lobby detects host left. This should already be handled by NGO side callback (on disconnect)
Adding in-editor quit, to have the same behaviour
1 parent 87eaaa2 commit 6a34818

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Assets/BossRoom/Scripts/Shared/ApplicationController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ public void QuitGame()
109109
}
110110
else
111111
{
112+
#if UNITY_EDITOR
113+
UnityEditor.EditorApplication.isPlaying = false;
114+
#else
112115
Application.Quit();
116+
#endif
113117
}
114118
}
115119
}

Assets/BossRoom/Scripts/Shared/Net/UnityServices/Lobbies/LobbyServiceFacade.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void OnSuccess(Lobby lobby)
115115
CurrentUnityLobby = lobby;
116116
m_LocalLobby.ApplyRemoteData(lobby);
117117

118+
// as client, check if host is still in lobby
118119
if (!m_LocalUser.IsHost)
119120
{
120121
foreach (var lobbyUser in m_LocalLobby.LobbyUsers)
@@ -126,7 +127,7 @@ void OnSuccess(Lobby lobby)
126127
}
127128
m_UnityServiceErrorMessagePub.Publish(new UnityServiceErrorMessage("Host left the lobby","Disconnecting."));
128129
ForceLeaveLobbyAttempt();
129-
m_ApplicationController.QuitGame();
130+
// no need to disconnect NGO, it should already be handled by NGO callback to disconnect
130131
}
131132
}
132133
}

0 commit comments

Comments
 (0)