Skip to content

fix: [Backport] MTTB-1273 Inconsistent scene name in scene event #3487

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

EmandM
Copy link
Collaborator

@EmandM EmandM commented Jun 5, 2025

MTTB-1278
fixes: #3418

Changelog

  • Added: A ScenePath field on the SceneEvent returned by the OnSceneEvent callback.
  • Fixed: Various bugs around the OnSceneEvent callback.

Testing and Documentation

  • Includes unit tests.

Backport

This is a backport of #3458

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

Some areas I noticed differences...

});

OnUnload?.Invoke(NetworkManager.LocalClientId, sceneName, sceneUnload);
InvokeSceneEvents(NetworkManager.LocalClientId, sceneEventData);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to go above the InvokeSceneEvents?

            // The only scenes unloaded are scenes that were additively loaded
            sceneEventData.LoadSceneMode = LoadSceneMode.Additive;

});

OnLoad?.Invoke(NetworkManager.LocalClientId, sceneName, loadSceneMode, sceneLoad);
InvokeSceneEvents(NetworkManager.LocalClientId, sceneEventData, sceneLoad);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to add the scene path or is that being automatically done?

@@ -1736,7 +1760,9 @@ public NetcodeIntegrationTest(HostOrServer hostOrServer)
protected void AssertOnTimeout(string timeOutErrorMessage, TimeoutHelper assignedTimeoutHelper = null)
{
var timeoutHelper = assignedTimeoutHelper ?? s_GlobalTimeoutHelper;
Assert.False(timeoutHelper.TimedOut, timeOutErrorMessage);
var internalError = m_InternalErrorLog.Length > 0 ? $"{timeOutErrorMessage}\n{m_InternalErrorLog}" : timeOutErrorMessage;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did this need to return early if length > 0?

@sentinel-u3d sentinel-u3d bot requested a review from NoelStephensUnity June 5, 2025 19:33
Removing the System.Text from StringBuilder since System.Text is included in a using directive.
removing using directive that is not needed.
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.

SceneName in SceneEvent contains inconsistent values
2 participants