Skip to content

fix: clients not displaying popup messages when host quits application inside post-game scene [MTT-3395] #626

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
Apr 26, 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ public class ClientPostGameState : GameStateBehaviour
{
public override GameState ActiveState { get { return GameState.PostGame; } }

protected override void Start()
{
base.Start();

//it is common for the user to get dumped back to main menu from here (i.e., if the host decides not to play again), and
//it is a little funny to display a "Connection to Host Lost" message in that case. The best thing would probably be to
//display a "Host Abandoned the Game" message, but this would require some more plumbing (an RPC from the host before it quit,
//containing that information).
//In the meantime, we just set "UserRequested" to suppress the Disconnected error popup.
var portalGO = GameObject.FindGameObjectWithTag("GameNetPortal");
portalGO.GetComponent<ClientGameNetPortal>().DisconnectReason.SetDisconnectReason(ConnectStatus.UserRequestedDisconnect);
}

public override void OnNetworkSpawn()
{
if (!IsClient)
Expand Down