Reconnect to a random room
Options
cscan
✭
Hi,
I am using JoinRandomRoom to establish a connection between players. However, I found that if someone disconnect, it is hard to make sure that it can join back to such room after he/she reconnect in a second.
I think a way to assign a room name after connect to Random Room but don't know how. Can anyone give me some advices?
Thanks.
I am using JoinRandomRoom to establish a connection between players. However, I found that if someone disconnect, it is hard to make sure that it can join back to such room after he/she reconnect in a second.
I think a way to assign a room name after connect to Random Room but don't know how. Can anyone give me some advices?
Thanks.
0
Comments
-
Hi,
Joined room already has name (assigned automatically or explicitly in CreateRoom call).
Use PhotonNetwork.room.name to get the name.0 -
Thanks. Can I set a threshold/timeout for disconnect? In Photon, any "OnDisconnect" function will be triggered once disconnection detected?0
-
Probably you asking for PhotonNetwork.networkingPeer.DisconnectTimeout.
PUN does not have OnDisconnect function. It has OnPhotonPlayerDisconnected called when remote player disconnected and OnDisconnectedFromPhoton called when client itself disconnected.0