if it can't connect

How do I show the error message if for some reason I cannot connect with the PhotonNetwork.ConnectUsingSettings() function. Nothing like OnConnectionFailed?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Onur,

    Thank you for choosing Photon!

    Good question.
    First check the return value of PhotonNetwork.ConnectUsingSettings() method.
    I believe OnDisconnected(DisconnectCause) callback is called, some disconnect causes are specific to initial connects like ExceptionOnConnect, DnsExceptionOnConnect...others could be ServerAddressInvalid or ClientTimeout.
    You can also make sure OnConnected() callback is not called yet at least once, because if this one is called, the client managed to connect to at least one/first server.