The emptied room still presents, and custom properties became null

Tested with 2 players, and Player A in the room list view which displays the list of the rooms and can pick up the room to join. Another Player B, just created a room and waiting for joining other players.

When Player B created a room, Player A receives OnRoomListUpdate Callback and updates the list of the rooms. But, right after Player B left the room, Player A receives OnRoomListUpdate callback again, but the room is still over there with 0 players. The problem is that this room never disappears until Player A forcibly refreshes the server list by disconnect from the PhotonNetwork and connect again, or someone else creates another server so that A receives OnRoomListUpdate callback again.

And the second problem is that I'm using custom properties, and when Player B left the room and Player A receives ListUpdate callback, the room still exists but all custom properties go null which throws a null reference exception.

Using Unity 2019.1.0f2 and Pun 2.33 lib 4.1.6.3, just downloaded from the asset store.

Best Answer

  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓

    Hi @modernator,

    please use the snippet shown in the documentation here.
    you can also see how Asteroids demo in the package handles rooms list.

    when a room is no longer available in the lobby for whatever reason it's sent but marked as RemovedFromList = true.

Answers

  • Hello
  • Hello anyone
  • Still waiting for answer.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓

    Hi @modernator,

    please use the snippet shown in the documentation here.
    you can also see how Asteroids demo in the package handles rooms list.

    when a room is no longer available in the lobby for whatever reason it's sent but marked as RemovedFromList = true.

  • JohnTube wrote: »
    Hi @modernator,

    please use the snippet shown in the documentation here.
    you can also see how Asteroids demo in the package handles rooms list.

    when a room is no longer available in the lobby for whatever reason it's sent but marked as RemovedFromList = true.

    Thanks, that works.