PUN1: OnDisconnectedFromPhoton after 40-60 secs after joining a room

Hey there,

I use PUN1 and when I load the scene for the first time it's fine. When I load it for the second, third, etc times - I stably get OnDisconnectedFromPhoton after 40-60 secs after I load the scene. Is there anything I should clear? It works on the first load so I assume I don't reset something properly.

In order to connect I use:
PhotonNetwork.ConnectUsingSettings("v1.0");
->
OnConnectedToMaster
->
PhotonNetwork.JoinOrCreateRoom(matchId, roomOptions, null);

Please help! :)

-zelena

Comments

  • I wanted to note that I am not getting OnConnectionFail; all I get is OnDisconnectedFromPhoton
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited March 2019
    Hi @zelena,

    Does this happen on Unity Editor or on a build?
    If it's a build what is the target platform?
    What is the PUN1 version you are using?
  • Hey @JohnTube,

    We use iPhones: 7, 8 and X - repros on all of them. It seems to work fine in the editor.

    The documentation title is: Photon Unity Networking v1.92 (hopefully this is the right version)

    -zelena
  • Update: upgraded to Photon Unity Networking v1.94 - the bug still persists.
  • @JohnTube I wanted to follow-up on this issue :) Still can't solve it - reproes on the second time I launch the scene, first time - always works fine and doesn't disconnect.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited March 2019
    Hi @zelena,

    There is some weirdness in your report:

    when I load the scene for the first time it's fine. When I load it for the second, third, etc times - I stably get OnDisconnectedFromPhoton
    I don't see how the first time loading the scene can be different from the subsequent trials. What changes? At which point do you do this scene loading?

    I stably get OnDisconnectedFromPhoton after 40-60 secs after I load the scene
    The 40-60 seconds period is strange and could be not related to the scene loading at all, maybe something else like you're being disconnected because the client is sending too much in a short period of time.

    I am not getting OnConnectionFail; all I get is OnDisconnectedFromPhoton
    Very strange, are you sure you are not calling Disconnect() manually in some script? What is the value of PhotonNetwork.BackgroundTimeout? How do you implement OnConnectionFail?

    Also, you did not answer all my previous questions.
    Anyway, please answer these:

    Does this happen on Unity Editor? What Unity version(s) did you reproduce this with?
    Your target platform is iOS only or you tested this only on iOS devices? can you test this on Android as well?
    Does this happen with the demo scenes provided in the package?
    How do you load scenes? Do you use PhotonNetwork.LoadLevel or PhotonNetwork.LoadLevelAsync else?

    Can you try and get help from "Analyzing Disconnects" page.
    You can make use of the "SupportLogger" to get more info.