Count of rooms is zero after room creation
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Count of rooms is zero after room creation
WeebOrWeed
2022-11-16 09:17:10
The join room function was actually fine a month ago, but when I am reviewing it today, I am having trouble to join a created room from other clients, citing that game does not exist. So I did some back tracking and found out that when the room is being created in the first place, it is not being recognized by PhotonNetwork.CountOfRooms.
And what is even wierder, after I createRoom, I did the following print statement:
And the result is:
How could this be possible? On the one hand, PhotonNetwork does not recognize this room as one of the rooms available, but on the other hand, the PhotonNetwork.CurrentRoom clearly shows that this room not only exists, but is also open and visible to other players.
Btw, I've also checked that the room is not in offline mode.
Does anyone know what is going on here? And how can I actually make this room available for other players to join?
Comments
I think I replied to this somewhere today. Don't recall where, though.
Did you get an answer? If so, please copy paste here. Thanks.
WeebOrWeed
2022-11-18 07:45:03
Yes I got the answerhere: When creating a room or joining one, the client leaves the Master Server to connect to the assigned Game Server. Functionality provided by the Master Server is no longer available, which means CountOfRooms is unknown while in a room.
There is a workaround for this by connecting another client to the Master Server but as this drives traffic and costs for a minor gain, it's not very popular.
Aside from leaving one server for another, creating and joining rooms will take a moment! The count does not go up until someone is actually using the room on the Game Server.
Anyone connected to the Master Server should sooner or later get an update for CountOfRooms. This is not immediate, as a popular game will make the room counts fluctuate a lot, so it's only updated every few seconds.
Other clients can only see rooms which are using the same Region and Game Version string. See the link for some more details (which I think don't apply here).
WeebOrWeed
2022-11-18 07:45:47
Btw I solved the problem by syncing the two games with up to date files over plastic SCM.
Glad you found a solution.
Now I don't know what the problem was really. What happened?
WeebOrWeed
2023-01-09 07:12:29
I suppose it was due to the different version numbers of the two copies.
That's possible, yes.
Back to top