cancel connection and start offline

Options
hi, in my game when the user hits play I call "PhotonNetwork.ConnectUsingSettings("0.9");" and as soon as the player gets connected the main level is loaded. In the meanwhile I show player a message "connecting ..." and there is a button to play offline.

so my question is, how can I make this button work ?

the "play offline" button should :
1. cancel the connecting to photon.
2. start the main level in the photon offline mode.

please help !

Comments

  • huhund
    Options
    // first disconnect from photon server

    // then
    PhotonNetwork.offlineMode = true;
  • Divyansh
    Options
    Thanks @huhund for the reply.

    but is it possible to do it, when photon is trying to connect to there servers. can I stop it at that point ?
  • huhund
    Options
    Aah, ok, I missed that part of the question, sorry. Yeah, so far I haven't seen anyway way to cancel connect requests. I assume you'll have to wait for one of the callbabacks. Probably doesn't help you in your specific use case. :(