Skip to content

Conversation

@NoelStephensUnity
Copy link
Member

@NoelStephensUnity NoelStephensUnity commented Oct 4, 2023

This resolves the issue where the server side NetworkSceneManager instance was not adding the currently active scene to its list of scenes loaded which would result in a permanently scene event in progress state if you:

  • Had a scene already loaded (Scene1) prior to starting the server-host
  • Loaded another scene (Scene2) additively after starting the server-host and then setting the newly loaded scene as the currently active scene.
  • Then unloaded the first scene (Scene1).
    Any attempt to load or unload a scene after this point would fail.

MTT-7537

fix: #2722

Changelog

  • Fixed: Issue where the server side NetworkSceneManager instance was not adding the currently active scene to its list of scenes loaded.

Testing and Documentation

  • Includes integration test: NetworkSceneManagerFixValidationTests.InitialActiveSceneUnload
  • No documentation changes or additions were necessary.

This fixes the issue where the currently active scene, on the server side, is not taken into consideration as being a valid "loaded scene" which can cause issues as outlined in GitHub issue #2722.
This resolves an issue with integration testing where:
- the scene handler registration was being registered multiple times
- the server registration was not passing in true to NetcodeIntegrationTestHelper.RegisterHandlers
- the IntegrationTestSceneHandler.CoroutineRunner could get destroyed if the active scene it was instantiated within was unloaded (now it is migrated to the DDOL)
- Registration of the currently active scene during the scene handler registration was adjusted to no longer use NetworkSceneManager.GetAndAddNewlyLoadedSceneByName (but still registers the scene).
Added an integration test: `NetworkSceneManagerFixValidationTests.InitialActiveSceneUnload`
This validates the fix for #2722.
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner October 4, 2023 20:36
Adding change log entry for this fix.
@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) October 4, 2023 20:46
Removing verbosity settings in the added integration test.
@NoelStephensUnity NoelStephensUnity merged commit 1701474 into develop Oct 4, 2023
@NoelStephensUnity NoelStephensUnity deleted the fix/add-active-scene-to-server-side-scenes-loaded branch October 4, 2023 21:25
Copy link
Contributor

@samlucas-unity samlucas-unity left a comment

Choose a reason for hiding this comment

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

Nice :)

NoelStephensUnity added a commit that referenced this pull request Oct 5, 2023
…scenes loaded [MTT-7537] (#2723)

* fix

This fixes the issue where the currently active scene, on the server side, is not taken into consideration as being a valid "loaded scene" which can cause issues as outlined in GitHub issue #2722.

* fix: TestHelpers

This resolves an issue with integration testing where:
- the scene handler registration was being registered multiple times
- the server registration was not passing in true to NetcodeIntegrationTestHelper.RegisterHandlers
- the IntegrationTestSceneHandler.CoroutineRunner could get destroyed if the active scene it was instantiated within was unloaded (now it is migrated to the DDOL)
- Registration of the currently active scene during the scene handler registration was adjusted to no longer use NetworkSceneManager.GetAndAddNewlyLoadedSceneByName (but still registers the scene).

* test

Added an integration test: `NetworkSceneManagerFixValidationTests.InitialActiveSceneUnload`
This validates the fix for #2722.

* update

Adding change log entry for this fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reset m_IsSceneEventActive to false after InternalNetcodeError

3 participants