Unity PUN2 matchmaking and the LIMIT keyword?

Hi,

i try to fetch rooms with a sqlight statement. this works fine but i want to limit it
by 10 rows. I try the below statement but it dos not work. Some suggestions how can i do this?
PhotonNetwork.GetCustomRoomList(GameManager.defaultLobby, "C0  = "+(int)PlayMode.ALLvsALL+ " LIMIT 10");

without the LIMIT keyword it works but i want to limit it.

thx for every help.

Best Answer

  • JohnTube
    JohnTube mod
    edited September 15 Accepted Answer
    Hi @pezezzle,

    Thank you for choosing Photon!

    I just wanted to add the following:

    GetCustomRoomList already limits the result list to 100 entries (ICYMI).

    We use LIMIT internally you can't use it yourself in the custom query.

Answers

  • LIMIT is not supported, sorry.
    Pretty much everyone would get about the same 10 rooms (when asking at the same time) and thus there would be more race conditions to join the (few) returned rooms and more failures to join (we expect).
    It's better to do the matchmaking right on the server or get a slightly longer list and show it randomized.
  • @Tobias Thank you for answering. Yes, you are right this is exactly what I desire to doo I will fill up the rooms with players and when the game starts, the room disappears from the list. Is there no way to limit in PUN? This is very data consuming when every time get hundreds of rooms loaded but I nee just a few to let the player choose.
  • Again: LIMIT is not supported and there is no way to get this short of a list.
    If you worry about the traffic, use server-side matchmaking with the parameters.
    If you fetch just 10 rooms, a player will look at "random" room names, all with the same ping. Users will either pick a room semi-randomly (by a hunch of liking one room name better than others) or refresh and poll X times, which then again causes traffic.
  • JohnTube
    JohnTube mod
    edited September 15 Accepted Answer
    Hi @pezezzle,

    Thank you for choosing Photon!

    I just wanted to add the following:

    GetCustomRoomList already limits the result list to 100 entries (ICYMI).

    We use LIMIT internally you can't use it yourself in the custom query.
  • Hi,

    @JohnTube
    @Tobias

    Ok
    Thank you all for answering.