When will onroomlistupdate() be called?

Comments
-
Hi @Lhiker,
Thank you for choosing Photon!
OnRoomListUpdate callback is called in two cases:
- when client receives GameList event received when joining lobby of type default.
- when client receives GameListUpdate event when joined to a lobby of type default and one or more rooms inside the lobby change one one of more of its properties visible to the lobby (IsOpen, IsVisible, PlayerCount, MaxPlayers or custom room properties explicitly exposed to the lobby).
EDIT, UPDATE:
Ah yes, I forgot one more case:
OnRoomListUpdate will be called as a result of op GetGameList for SQL Lobbies (PhotonNetwork.GetCustomRoomList)1 -
Thanks for the response @JohnTube mod,
Do you mean to say when I coded PhotonNetwork.CurrentRoom.IsVisible = false; OnRoomListUpdate callback will be called? I think it might be, but there is error,Operation GetGameList (217) not allowed on current server (GameServer)。Can you tell me why?0 -
Ah yes, I forgot one more case:
OnRoomListUpdate will be called as a result of op GetGameList for SQL Lobbies (PhotonNetwork.GetCustomRoomList)
PhotonNetwork.GetCustomRoomList can be called only when connected to master server, outside of rooms.1 -
I seem to know what the problem is. When I join or create a room, I will automatically exit the lobby. At this time, I can not update the room list unless I join the lobby again. I always thought that after leaving the room, I was still in the lobby, which led to the error。In the end, thanks for your help again.1
-
I seem to know what the problem is. When I join or create a room, I will automatically exit the lobby. At this time, I can not update the room list unless I join the lobby again. I always thought that after leaving the room, I was still in the lobby, which led to the error。In the end, thanks for your help again.
0 -
Have you solved the problem? If not, here is my solution. You can call PhotonNetwork.JoinLobby() in OnConnectedToMaster(). Client will call OnConnectedToMaster after leaving the room, and thus client will join lobby at the same time.0
-
I tried implementing this to see if it gives me any correct results for a room that is already created and nothing happens. It almost feels like the callback is not called after GetCustomRoomList() is called.
And yes, I am in a lobby when the Refresh method is called.
private void Refresh() { Debug.Log("Refresh"); PhotonNetwork.GetCustomRoomList(customLobby, "C0 = 'yes'"); Debug.Log(PhotonNetwork.InLobby); } public override void OnRoomListUpdate(List<RoomInfo> roomList) { Debug.Log(roomList.Count); Rooms = roomList; RefreshVisuals(); }
And this is how the room is created:
RoomOptions options = new RoomOptions(); options.MaxPlayers = (byte)nrPlayers_HostGame; options.CustomRoomProperties = new ExitGames.Client.Photon.Hashtable() { { "C0", "yes"}, { "C1", HG_NameGame.text} }; options.CustomRoomPropertiesForLobby = new string[] { "C0", "C1" };
Can somebody please tell me why this is not working? I've been trying to figure it out since yesterday and I can't seem to find something that's useful. :-(
0 -
I think you create the room in the default lobby, which in turn does not support GetCustomRoomList and neither the filtering string.
Make sure to use an SQL lobby (for the room and joining it)...
0 -
I'm 100% sure I'm not creating the room in a default lobby.
private TypedLobby customLobby = new TypedLobby("lobby1", LobbyType.SqlLobby);
0 -
Yes, ok, you got the customLobby field. Are you using this in CreateRoom() as parameter?
As you are so sure you don't miss anything: Please help me help you and create a tiny repro project. Just something I can run, no visual fluff. I don't even need gui, as I could log anything needed. Just something that shows the issue.
Then, upload the zip for us and send a link to: [email protected].
Thanks
0