How to kick inactive player
Lele
✭
Hi, I would like to disconnect a player instantly as he presses the smartphone's home button or puts the app in the background (Photon Cloud PUN).
I tried with:
OnApplicationFocus(bool focus)
and
PhotonNetwork.NetworkingClient.LoadBalancingPeer.DisconnectTimeout = 0;
But none of these would seem to work. Could you help me?
Thanks.
0
Best Answer
-
OnApplicationFocus sounds good but you may want to call PhotonNetwork.Disconnect() instead of setting some timeout.
0
Answers
-
OnApplicationFocus sounds good but you may want to call PhotonNetwork.Disconnect() instead of setting some timeout.
0 -
Please call
PhotonNetwork.Disconnect();
instead of
PhotonNetwork.NetworkingClient.LoadBalancingPeer.DisconnectTimeout = 0;
And this will be okay.
0