I am developing a multiplayer racing game in unity using PUN2. I want to create 2 types of rooms. The first type is that players create a room with some constraints that max players, no of laps and bet amount (that may be called a private room or price to pay to join the room). And 2nd type is the free room type. For this, I’ve used JoinRandomRoom()
function. So the issue is that when I use the JoinRandomRoom()
function it joins the First type of room (without even paying the price). Now I want to define constraints for this type of room is that when the JoinRandoomRoom()
function calls it must not be allowed to join the first type of room if there is no free room available it creates a new room.
I have found 2 overloads of JoinRandomRoom()
function but couldn’t understand how to use them. One thing I also found that while creating the First type of room I could add some additional strings like the word “Private” in starting of the Room name so that I can keep check of such rooms but didn’t get how to pass such conditions to JoinRandomRoom()
function that if the room name starts with the word private do not join that room and create a new one.