Make room only open to players who have connected before.

Pun Classic

I do random matchmaking with PhotonNetwork.JoinRandomRoom(). Once the room is full and "active" (in my case, two players) I want the room to no longer be considered for matchmaking but I do want the players who have joined successfully to be able to reconnect later should they have an unexpected disconnect. I don't want to close the room as I believe this stops anyone from joining, including those who have joined previously.

What's the recommendation on handling this sort of reconnect requirement?

Comments

  • I forgot to mention that I tried having the master client call PhotonNetwork.room.SetExpectedUsers(expUsers) after the room has filled and it's ready to go. This has caused some weird issues though. I'll continue looking into that, but in the meantime, what's the best way to handle this?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited November 2019
    Hi @MikeDConaway,

    Thank you for choosing Photon!

    When you create rooms set RoomOptions.PlayerTtl to a value other than zero (-1 for infinite and a positive value in milliseconds).
    To rejoin, use ReconnectAndRejoin.

    Clients need to keep the same unique UserId before and after reconnecting.