Cannot get room list inside lobby

I am now implementing the rejoin function, so before I call the ReJoinRoom function,
I need to check the last room is still existed to avoid
Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exist )



In OnConnectedToMaster() callback, I call
PhotonNetwork.JoinLobby(new TypedLobby("GameLobby", LobbyType.SqlLobby));
to enter a named lobby and successfully get lobby information in OnJoinedLobby() callback.

In my Android device, I create a room after join lobby by
PhotonNetwork.CreateRoom(null, new RoomOptions{MaxPlayers = 2, EmptyRoomTtl = 50000, PlayerTtl = 180000, PublishUserId = true}, null);

and ensure the room is available by
PhotonNetwork.room.IsOpen = true;
PhotonNetwork.room.IsVisible = true;
in OnJoinedRoom().

Then at my Unity editor, after joining lobby, I tried to get the room list
RoomInfo[] rooms = PhotonNetwork.GetRoomList();
		foreach(RoomInfo room in rooms){
			Debug.Log("room : " + room.Name);
		}
The room list is always empty, but I can still rejoin it by ReJoinRoom function when the room is still existed.

How to I solve it? Thank you.

Comments

  • anyone help?
  • I need to check the last room is still existed to avoid
    Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exist )
    This approach is wrong and not recommended. If the room does not exist just stop trying to join it or rejoin (tell the user that it does no longer exist or another error or fail silently internally) it OR wait until it can be joined. You can also use JoinOrCreate.

    The room list is always empty,
    You need to wait until lobby is joined and rooms list is received by client: OnReceivedRoomListUpdate() callback. SQL Lobby is not meant for rooms listing and rooms listing will be disabled in the future for this type of lobby.
Sign In or Register to comment.