PhotonNetwork.ConnectUsingSettings when reconnecting fails silently

This happens when i ConnectUsingSettings, then Disconnect, then ConnectUsingSettings again.

OnFailedToConnectToPhoton(DisconnectCause cause) and OnConnectionFail(DisconnectCause cause) don't get called.

OnJoinedRoom() isn't called either.

the logs look like this: https://www.dropbox.com/s/gk7m0un2rguo7qt/Screenshot (316).png?dl=0

What is Event 226?

Comments

  • Statigar
    Statigar
    edited June 2017
    If figured it out. This optimization helps enormously with frequent calls like setCustomProperties, but it also restricts the basic room loading messages. So you have to be careful when you implement this that you either add your networkmanager, or wipe this out and redo it when you leave/enter a networked scene.
            if (PhotonNetwork.SendMonoMessageTargets == null)
            {
                PhotonNetwork.SendMonoMessageTargets = new System.Collections.Generic.HashSet<GameObject>();
            }
            PhotonNetwork.SendMonoMessageTargets.Add(this.gameObject);
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Statigar,

    Thank you for choosing Photon!

    I apologize about the delay to reply to your first post.

    It seems like there is no link between the two posts. I'm going to answer first one.

    To know when you are connected to Photon (which is most of the time is when you client is connected to Master Server):
    You can implement in any MonoBehaviour:
    1. If "AutoJoinLobby = false": OnConnectedToMaster()
    2. If "AutoJoinLobby = true": OnJoinedLobby()
    The callback for explicit Photon disconnect call:
    OnDisconnectedFromPhoton()

    Only after that you can re connect.

    All PUN callbacks are listed in PhotonNetworkingMessage enum and in IPunCallbacks interface.

    What is Event 226?

    226 is the code for AppStats event. Read more about this event here.
    You can find out the predefined Photon event codes in EventCode class in "LoadBalancingPeer.cs".