Reconnect to a random room

Options
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.

Comments

  • vadim
    Options
    Hi,

    Joined room already has name (assigned automatically or explicitly in CreateRoom call).
    Use PhotonNetwork.room.name to get the name.
  • cscan
    Options
    Thanks. Can I set a threshold/timeout for disconnect? In Photon, any "OnDisconnect" function will be triggered once disconnection detected?
  • vadim
    Options
    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.