OnRoomListUpdate() not updating while in a room.

Options
Hi, I am having an annoying issue where the room list doesn't update. While not in a room this works fine for all players but the problem is if player1 is in a room, and player2 creates a room if player1 leaves his room and goes to the rooms list, the room made by player2 doesn't appear. After a lot of google searches I found out that when you Join a room you leave the lobby and if you leave a room you have to rejoin the lobby and adding JoinLobby() to my LeaveRoom() function and/or in my OnLeftRoom() doesn't change anything as I automatically JoinLobby() in OnConnectedToMaster(). Does anyone know how to fix this?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options

    Hi @DarkGamerXD,

    Thank you for choosing Photon!

    This is by design, room listing works only while joined to a lobby of default type.
    It does not work when joined to a room.

  • DarkGamerXD
    Options
    Hi @JohnTube ,
    Thank you for replying to me.
    I had found another post about somebody having this issue but just putting JoinLobby() in my leave function or in OnLeftRoom() didn't change the situation. I expect that it is because I already handle joining (default) lobbies inside OnConnectedToMaster(). I've also tried manually disconnecting and reconnecting but nothing had changed.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @DarkGamerXD,

    Remove JoinLobby() call from OnLeftRoom() and keep it only inside OnConnectedToMaster().
  • DarkGamerXD
    Options
    @JohnTube
    I have that but it doesn't change.
  • DarkGamerXD
    Options

    Hi @JohnTube,
    I’ve read the whole page but I haven’t become much wiser. The only difference in this room list is that it I do almost everything with refreshing the cached list inside OnRoomListUpdate(). Im gonna try to copy the snippet and see if it does something but I don’t expect a lot.

  • Kaiserludi
    Options
    Hi @DarkGamerXD.

    As @JohnTube already said
    This is by design, room listing works only while joined to a lobby of default type.
    It does not work when joined to a room.

    There is no way to have the connection be joined to a room and to the lobby at the same time, so it's simply impossible to receive room list updates while being inside the room.

    You can't run multiple instances of PUN in the same Unity app in parallel, so you can't have multiple parallel connections to Photon with PUN.
    However multiple connections are possible with Photon Realtime.

    So what you can do is create a Photon Realtime Client instance additionally to your PUN connection.
    You can then let the Realtime connection idle inside the lobby to be able to receive room list updates through it, while your PUN connection is joined to a room.
    This will achieve what you want, but it comes with a serious downside: Each connection counts against the CCU separately, so with this approach you will end up paying for twice as many CCU.

    An alternative that avoids the extra-CCU is to host a custom server yourself and to run a Photon Realtime client on that server. That special Photon client on your custom server would then connect to Photon Cloud and just idle in the lobby to get the latest room lists at all times.
    Your actual end-user clients would then connect to your custom server (i.e. through HTTP, but you could also just run a self-hosted Photon server instance with the unlimited CCU pricing option there) and retrieve regular room list updates from there instead of directly from Photon Cloud.
    The down-side with this approach is, that you need to host your own server, implement some custom server-side logic and run your own client there.