Handle join if full

Options
Ive come across a problem when I join a game with one of my clients and the game gets full.
my rooms have a max player count of 2. server + 1 client.

it will take some ms for the photon to update the roomList with this information and some users might be able to join an room for that time. How do I handle this kind of problem? They dont accually come in to that room but i want an extra chech when the "join" button is pressed to see if i REALLY can join a game.

I hope you understand what I mean.

// Robbin

Comments

  • Tobias
    Options
    PUN has a callback you can implement for this case: OnPhotonJoinRoomFailed.
    It's "Called if a JoinRoom() call failed. Most likely because the room does not exist or the room is full."

    This and others could be found in the Enums file in the enum PhotonNetworkingMessage.

    Only 2 players will be really able to join a room. You can use JoinRandomRoom instead of lobby-based room listing and not join the lobby. In best case close a room once it's full (set PhotonNetwork.room.open and .room.visible to false).