Skip to content

_globalSceneLoadData Overwritten Causes Incorrect ReplaceOption for Late-Joining Clients #1035

@mygoddess-007700

Description

@mygoddess-007700

Environment:

Unity Version: 2022.3.32f1
FishNet Version: 4.5.2

Description:

I encountered a potential issue related to how the server-side SceneManager handles _globalSceneLoadData.

From my understanding, _globalSceneLoadData is overwritten whenever a new global scene is loaded. This value is later used during client validation when new players join.

Problem Scenario:

  1. The server starts with a main global scene using ReplaceOption.All.
  2. During gameplay, a secondary global scene (e.g., a shop scene) is loaded using ReplaceOption.None.
  3. The shop scene is then unloaded.
  4. A new client attempts to join the server.

At this point, _globalSceneLoadData still reflects the last loaded global scene (shop scene), meaning ReplaceOption.None is used instead of the expected ReplaceOption.All.

As a result, the newly joining player does not load scenes as intended.

Question / Suggestion:

Would it be more appropriate to manage global scene load data using a structure such as a stack (or similar), rather than a single overwritten value?

For example, when a temporary global scene (like the shop) is unloaded, it seems more intuitive for the SceneManager to revert to the previous global scene's ReplaceOption, instead of retaining the last overwritten value.

Additional Thoughts:

In the current behavior, even after the shop scene is unloaded, its ReplaceOption.None still affects newly joining clients, which feels unintuitive from a scene lifecycle perspective.

Closing:

I might be misunderstanding the intended design, so I would really appreciate any clarification or guidance on this behavior.
Thank you for your time and for maintaining FishNet!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions