Skip to content

fix: spawners not working in case host exits #398

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

Closed
wants to merge 1 commit into from

Conversation

fernando-cortez
Copy link
Collaborator

Description (*)

Jira task here.

If a host had exited the game abruptly while in-game, or had left while in the post-game screen, an exception was triggered on spawners which made them not spawn any imps on a subsequent playthrough.

This had to do with a static collection not being cleared on OnDisable(). This has been moved to both an OnNetworkDespawn() and OnDestroy(), as OnNetworkDespawn() is not guaranteed to be fired when the network is shutdown abruptly.

The same pattern was applied to a network text object that would not be cleared on a host exit event.

Related Pull Requests

Issue Number(s) (*)

Fixes issue(s): MTT-1472.

Manual testing scenarios

  1. This was tested with Photon relay, in the editor as well as on standalone builds.
  2. ...

Questions or comments

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@fernando-cortez fernando-cortez added the 1-Needs Review PR needs attention from the assignee and reviewers label Oct 26, 2021
@fernando-cortez fernando-cortez 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 Oct 26, 2021
@SamuelBellomo SamuelBellomo added the 4-On Hold PR can't proceed because it's blocked or is otherwise waiting on something. label Oct 28, 2021
@SamuelBellomo
Copy link
Contributor

same here as this #397
Is there a fix incoming for this? @NoelStephensUnity please note we shouldn't fix things sample side that are going to get fixed soon by a new SDK update. Will a fix for this come in a 1.x soon?

@NoelStephensUnity
Copy link
Contributor

@SamuelBellomo

same here as this #397 Is there a fix incoming for this? @NoelStephensUnity please note we shouldn't fix things sample side that are going to get fixed soon by a new SDK update. Will a fix for this come in a 1.x soon?

I replied in #397 with what I believe is the fix. Will look into Jira Ticket and have a Draft PR-1390 started.

@fernando-cortez
Copy link
Collaborator Author

PR status update: Fix has been merged with develop and included as part of pre.4 release.

Will simply review once SDK version is upgraded.

@fernando-cortez
Copy link
Collaborator Author

Closing this as the update here invalidates this PR.

OnDisable() is fired on NetworkBehaviours when a host abruptly shuts down the connected session, meaning that the PlayerServerCharacter collection is properly cleared between sessions. This then prevents any null objects inside of the player distance check inside of the enemy spawners.

@fernando-cortez fernando-cortez deleted the hotfix/host-exit-spawner-bugfix branch January 12, 2022 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-One More Review One review in, one to go 4-On Hold PR can't proceed because it's blocked or is otherwise waiting on something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants