fix: game frozen when client leaves in postgame [MTT-4342] #719
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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