Skip to content

fix: game frozen when client leaves in postgame [MTT-4342] #719

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

Conversation

LPLafontaineB
Copy link
Contributor

@LPLafontaineB LPLafontaineB commented Aug 25, 2022

Description

This PR changes when we register and un-register to NGO callbacks within ServerBossRoomState, making it simpler and clearer. It is now only done once in OnNetworkSpawn and undone once in OnNetworkDespawn. Before this, it relied on OnLoadComplete to register those callbacks (which happens every time any scene is loaded, including the additive scenes) and on OnUnloadeComplete to un-register them (which only happens when an additive scene is unloaded). This meant that we would register to these callbacks multiple times and we would not un-register properly afterwards.

Here are the repro steps for the bug this is fixing:

1.Start a game with a host and at least one client
2.Progress through the game up to the postgame state
3.As a client, leave the game

No addition to changelog since this bug was introduced after the 1.3.0 release

Issue Number(s)

MTT-4342

Contribution checklist

  • Tests have been added for boss room and/or utilities pack
  • Release notes have been added to the project changelog file and/or package changelog file
  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • JIRA ticket ID is in the PR title or at least one commit message
  • Include the ticket ID number within the body message of the PR to create a hyperlink

@LPLafontaineB LPLafontaineB marked this pull request as ready for review August 25, 2022 15:18
@LPLafontaineB LPLafontaineB added 2-Easy This PR is trivial and can be reviewed quickly 1-Needs Review PR needs attention from the assignee and reviewers labels Aug 25, 2022
Copy link
Contributor

@SamuelBellomo SamuelBellomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I also fixed this the same way in my unmerged DGS PR, thanks for looking at this

@LPLafontaineB LPLafontaineB added 2-One More Review One review in, one to go and removed 1-Needs Review PR needs attention from the assignee and reviewers labels Aug 25, 2022
@fernando-cortez fernando-cortez added 3-Good to Merge and removed 2-One More Review One review in, one to go labels Aug 25, 2022
@LPLafontaineB LPLafontaineB merged commit 5071db7 into develop Aug 25, 2022
@LPLafontaineB LPLafontaineB deleted the fix/game-frozen-when-client-leaves-in-postgame branch August 25, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-Easy This PR is trivial and can be reviewed quickly 3-Good to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants