Out of nowhere the room listing does not work.

Options
Hello!

Everything seemed to be fine with Photon and the room listing before today.

Normally whenever I would create a room on clients it would show but that is not the case today.

I get a "Connected to Photon" debug message when starting the first instance and it is able to create a room just fine.

It isn't until I run a second instance and attempt to join the room that the first instance made that I run into trouble.

I hit my head against the wall for a bit trying to find some kind of error code because it isn't until I close the first instance that I get this error message...

Unity Console Preview
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Unity Console Extended Message
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <437ba245d8404784b9fbab9b439ac908>:0)
JoinEventMenu.OnRoomListUpdate (System.Collections.Generic.List`1[T] roomList) (at Assets/Scripts/EventMenu/JoinEventMenu.cs:56)
Photon.Realtime.LobbyCallbacksContainer.OnRoomListUpdate (System.Collections.Generic.List`1[T] roomList) (at Assets/3rdParty/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3970)
Photon.Realtime.LoadBalancingClient.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/3rdParty/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2880)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) (at <11e9abbca912444aa80ed58a280369fc>:0)
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () (at <11e9abbca912444aa80ed58a280369fc>:0)
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () (at <11e9abbca912444aa80ed58a280369fc>:0)
Photon.Pun.PhotonHandler.Dispatch () (at Assets/3rdParty/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:205)
Photon.Pun.PhotonHandler.FixedUpdate () (at Assets/3rdParty/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:139)

I am so confused.

Best Answer

Answers

  • Tykjen
    Options
    Hi flowingisart,

    I also experienced something similar.
    Suddenly the PhotonNetwork.GetRoomList() started returning an empty array even though I have created rooms. I am however able to join the room by using the PhotonNetwork.JoinOrCreateRoom method and everything else works as expected. The PhotonNetwork.countOfRooms actually gives the correct number of active rooms, but lack the information I need.

    I don't think the issue is on the client side. I tested an application that has been running issue free in prod for 6 months. It also gives me the same empty array on PhotonNetwork.GetRoomList().
    I believe it has something to do with the problems they had on the Photon server side.

    I hope they are able to find the bug soon.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @flowingisart, @Tykjen,

    Thank you for choosing Photon!

    If your apps are on the free 20 CCU plan they have been switched to the new lobbies v2.
    So if you are using SqlLobby type and expect a list of rooms this is no longer available in lobbies v2.
    Read more here.

    If your apps are not on the free 20 CCU plan or you are using the default lobby type then it's something else.
  • Tobias
    Options
    Which version of PUN are you using?
    PhotonNetwork.GetRoomList() is not in the more recent PUN 2 versions, so I wonder.