LoadLevel Times out in Editor Play Mode

I saw this thread from 2015 for PUN1: https://forum.photonengine.com/discussion/6750/server-timeoutdisconnect-when-in-unity-editor-mode

I'm using PUN2, and every time I load my game scene in editor, I get DisconnectByServer. Is there something special I need to do while PhotonNetwork.LoadLevel is going? During this time PhotonNetwork.IsMessageQueueRunning is set to false and loadingLevelAndPausedNetwork is set to true... I would expect these conditions to provide some safeguards to message processing acknowledgements back to the server; but nevertheless, LoadLevel in editor results in DisconnectByServer every time.

I must have missed something... what am I supposed to do to be able to play/test my PUN2 integration in Editor?


  • So in order to get my game scene to load without disconnecting the Editor player, I actually commented out the calls in PhotonNetwork that were setting PhotonNetwork.IsMessageQueueRunning = false and loadingLevelAndPausedNetwork = true . Then, I used another custom property HOST_LOADED_LEVEL_PROP_NAME that once clients receive, they can start to load the level. And, finally, only after all clients have loaded the level can I then spawn the GamePlayer prefabs.

    This does not seem like what I should have to do... there must be a better way.
  • I'm also seeing the above issue. I have some more info that might be useful.

    It seems setting IsMessageQueueRunning = false does work, it keeps the connection alive indefinitely.

    The disconnect always happens upon setting IsMessageQueueRunning = true.

    In the logs, I always see a bunch of these:
    incoming command CMD(6 c#:0 r/u: 4/0 st/r#/rt:0/0/0) is old (not saving it)

    Might be related?

    This is the disconnect log I get:
    Server sent disconnect. PeerId: 33407 RTT/Variance:15/23 reason byte: 2

    This issue is reproducible 100% when loading a large scene with 10+ PhotonViews in it.
    I have a smaller scene that loads very fast (also with 10 PhotonViews), and I do not see the issue.
  • So after a bit more testing, it seems that IsMessageQueueRunning is not working at all.

    This is easy to test:
    IEnumerator TestRoutine()
            PhotonNetwork.IsMessageQueueRunning = true;
            yield return new WaitForSeconds(10.0f);
            PhotonNetwork.IsMessageQueueRunning = true;
Sign In or Register to comment.