LoadLevels breaks all events [SOLVED]

Options
We've integrated Photon into our Unity project, *not* using PUN - just the "plain" SDK. (At least I think so - we downloaded SDK from http://doc.exitgames.com/photon-cloud/SDKunity3d and have integrated with that, so if that's what's called "plain" then that's what we're using).

Everything is working great initially - players can connect, join a room, and exchange messages perfectly. But as soon as we load a new level, suddenly *all* events stop being received by all players. This is true even though scene loading is nearly instant (for this test case).

We are absolutely not destroying our PhotonClient (we have DontDestroyInLoad in all the right places). We are still able to send messages without errors. But nobody receives them after loading a new level.

We have tried variations of Network.isMessageQueueRunning = false/true around loading the new level and that hasn't helped anything. It doesn't even look like we're disconnected, though. It does, however, look like the clients' states sometimes change from "Joined" to "JoinedLobby" when the new scene loads, whatever that means.

Any idea what might be happening to Photon when we load a new scene? Again, we are not using PUN - we don't Photon to care that we're loading scenes. We just want events to keep working after we load a scene as well as they were before.

Incidentally, this current schism between "PUN" and "plain" is *extremely* confusing. In particular, the docs at the bottom of this page: http://doc.exitgames.com/photon-cloud/C ... onHandling, where we find this inscrutable sentence, don't help at all:
If you use the "plain" from our Unity Client SDKs, you implemented Service most likely in some MonoBehaviour Update method.

To make sure Photon's SendOutgoingCommands is called while you load scenes, implement a background Thread. This Thread should pause 100 or 200 ms between each loop, so it does not take away all performance.

If I am deciphering that mangled chunk of English correctly, I am "plain" and I might need a thread during level loads. I tried this by starting up a thread that calls Service() on my client at 100ms intervals while our level is loading, then stops when the level has loaded and Service() is again called during Update(). This didn't help with anything. (Again, our level is taking only about a second to load during this test, so I doubt it's the cause anyway).

It seems like something in Photon is trying to "help" in some way by reacting to our loading a new level in Unity. I don't want it to do anything other than stay connected and keep working. We are handling all aspects of level loading, etc.

Thanks for any help you can offer.

Comments

  • Nope, this was entirely our error. We were leaving the room when the level was loaded - Photon wasn't doing anything wrong at all!

    Working fine now, as advertised. (Copious logging of the client's OnStatusChanged revealed the problem - recommend this to others who have similar issues).
  • Tobias
    Options
    Thanks for the update and I'm glad you found it!
    Hope you don't run into any other issues from now on.