Hi guys, I am working on Photon Unity Networking package and found an issue that their GetRoomList() function not working. It’s not like the issue someone has posted before (Photon Networking - Getting RoomList inside a Room - Questions & Answers - Unity Discussions).
But it simply cannot display all the rooms available at the start of its Viking Demo. The thing is I run this demo in the editor and create a room called “myRoom111”. And I opened a webplayer of this demo, but the room list on the main page is still showing “no games available”. However, when I enter “myRoom111” and clicked “Go” to join this room, it worked! So it is not likely to say this room doesn’t exist.
Is there anything wrong with my network setting? Should I do something in the Photon Network Account?
It might be related to the “Auto Join Lobby” setting, which is in the PhotonServerSettings.
With the release of PUN v1.60, the default for AutoJoinLobby is false.
Due to that, PUN calls OnConnectedToMaster() when you can create/join/match rooms.
Without joining the lobby, PUN will not call OnJoinedLobby() as usual before and GetRoomList() will return an empty list.
AutoJoinLobby can now be set in the PhotonServerSettings file in the project.
When you import PUN into existing projects, you need to make this setting one time. Updating PUN will keep the PhotonServerSettings, so you don’t need to touch this setting again.
Make a method in a class inherited from Photon.Punbehavior named OnReceivedRoomListUpdate(). This method will get called whenever a change is made in the server list.