The room continues to exist with no players

When a room creator leaves and there are no other players left in the room, the OnRoomListUpdate() method still gets this room info with 0 players and there no other OnRoomListUpdate() calls after that, so the room with no players exists in the room list (on other clients in the lobby) forever.

How to make a room be destroyed when there are no players left in it?

Comments

  • RoomOptions.EmptyRoomTtl is 0.
  • Up.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @develax,

    Does this happen on the self-hosted Photon Server or on Photon Cloud?
    If this happens on Photon Cloud, send us an email with the AppId + AppVersion + Region.
    If this happens on a self-hosted Photon Server, I will move this discussion to the Photon Server category and involved my colleague Ilya to help you debug this.
  • Hi @JohnTube,

    I looked into "DemoAsteroids" and found that the RoomInfo.RemovedFromList field is being checked there when the list is iterated through.

    So, it's likely to be my fault, but if this is the way it is designed I still can't understand why a room-info should have this field. Why just not send it to the OnRoomListUpdate() method at all?
  • @JohnTube,
    it would be interesting to know what is the logic behind this field.
  • JohnTube
    JohnTube ✭✭✭✭✭
    This field is used to indicate that a rooms' list entry has been removed on the server and should be removed on the client.
  • develax
    develax ✭✭
    edited October 2019
    Hi @JohnTube ,

    Yes, the same is said in the docs, but my question is why not just remove this deleted room from the OnRoomListUpdate() method's parameter List roomList (why it's kept there and marked as deleted via the RemovedFromList field instead)? If it wouldn't exist in the roomList at all it could be deleted from the client's cached list and from the visual list as well when the client processes this list. Maybe there's some reason for keeping it in the list?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @develax,

    Not sure which PUN or SDK version you have in mind or you are referring to or you are using.
    In PUN2 we do not cache the list of rooms, unlike PUN Classic.

    The server needs a way to tell the client that some rooms were removed from the lobby.
    That flag is used for this.

    So the server sends a list containing room X.
    The client adds room X to the cached list and updates the UI.
    After a while room X is removed from the lobby.
    The server sends a list containing room X marked to be removed.
    The client removes room X from the cached list and updates the UI.
  • Hi @JohnTube,

    I'm using the latest PUN2. By cached list I meant a custom list on the client as you mentioned.

    My initial thought was that it would be enough to just remove it from the list sent by the server, then the client can remove from its cached list everything that doesn't exist in the server list. This was what I expected to get in the beginning.

    Thank you for the detailed clarification!