OnConnectionFail not called during without internet connection

Options
Hello,
My app in the unity editor throws errors that I cannot figure out how to catch. When running the game with my computers wifi turned off I just get this error. Im testing this because certainly users will try when they dont have internet and I want to make sure I handle it properly. I tried this:


try {
PhotonNetwork.ConnectUsingSettings(_gameVersion);
} catch (Exception e) {
sceneLoader.NavigateToDashboard ();
persistentUIController.ShowError ("Failed to connect to multiplayer server. Please check your network connection <code class="Code">and schools whitelist \n (Error: "+e.Message+")");
}



But it doesnt get caught. I also implemented this method:

public override void OnConnectionFail (DisconnectCause cause){
sceneLoader.NavigateToDashboard ();
persistentUIController.ShowError ("Failed to connect to multiplayer server. Please check your network connection and schools whitelist");}

Also I have added breakpoints and logs. none are hit. Any advice?

Comments

  • Hi @MingMan,

    I wouldn't use try catch here because I think it would be easier to do something directly when OnConnectionFail is being called. Maybe you can show some kind of UI overlay which notifies the user to check his network connection.
  • MingMan
    Options
    @Christian_Simon I think you mis understand the question! I tried both because neither of them work. I tried OnConnectionFail. It is never being called.

    Photon team got back to me in an email. There is actually a bug i discovered and they verified. So this will be fixed in the next update or 2.