MirageNet/Mirage

AsyncOperation NRE when loading a scene that has not been added to build settings (or bad path)

SoftwareGuy opened this issue · 0 comments

Describe the bug
When attempting to switch to a scene on the server via NetworkSceneManager that has not been added to build settings in Unity or doesn't exist (ie. bad path, etc), Mirage throws a "ArgumentException: Value cannot be null" error in the console. The exact behaviour after this thrown error is unknown, Mirage may stay in the last scene that it had loaded.

Repro project
This can be replicated in most projects running a recent version of Mirage. No specific repro project is required.

To Reproduce
Steps to reproduce the behavior:

  1. Initiate a scene change via NetworkSceneManager to change the scene on the server, but give it a junk or invalid path (refer to screenshot as I had one called FuckAround that I had forgotten to add into Build Settings and this triggered the error.
  2. Watch as Mirage throws an exception saying that an argument cannot be null and potentially enters a errored/unstable state.

Expected behavior
In theory, we should be checking if the scene to change exists and if it does, then Mirage does the scene change, otherwise it refuses to do so to prevent the ArgumentException. A simple error log along the lines of Mirage couldn't load scene '(name of scene)'. Has it been added to the build settings? would be enough of a clue that the developer has derped.

Screenshots
Note that this was taken from my shooter WIP project, stack trace may not be accurate.

Codename_Misfits_tGogqvnbiX

Desktop (please complete the following information):

  • OS: All supported platforms, Windows Server x64 used in this example
  • Build target: All supported platforms
  • Unity version: 2020 LTS (2020.3.25f1)
  • Mirage version: Uhh, whatever's latest version a few days ago (114.x onwards iirc?)

Additional context
N/A.