OnPause to be called in Android Phone

Options
Hi ,

I am using Photon Unity for FPS game. Game is also for android phone. When user presses power button it goes in OnPause. I want to kick user out side the game when OnPause is called for more then 30 seconds .

Photon Unity Networking automatically enable run in background to true.
So these methods below will be called ?

void OnApplicationFocus(bool focusStatus) {

}

void OnApplicationPause(bool focusStatus) {

}

How to kick user if he is on pause for more then 30 seconds . Need Help



Regards
Unity Learner

Comments

  • Tobias
    Options
    Set PhotonNetwork.BackgroundTimeout = 30.0f.
    The after 30 seconds, the client will stop sending ACKs and the connection will timeout. So a "someone left" event will arrive at the remaining players after 30 seconds + timeout.

    This should help.