What Match listings will return?

nk.match_list(5, true, “1-15”, 2, 4)
I used this to get list of matches. I have a confusion what it will returns ?
All List of matches or Matches in which space is avaialble.

If it return All matches and we return matches[0].id and players request to join that match , but there is no space in that room ? in this what is the appropriate way to handle this?

Based on your match listing parameters it will return at most 5 matches, only authoritative ones, where the match label exactly matches the string "1-15", where there are between 2 and 4 players currently in the match.

Only matches that fit all of the criteria may be returned.

There are a few ways to handle this so it depends on your game which is most appropriate:

  • Return more than one match ID, and have clients try to join each until successful.
  • Ensure the match listing allows enough variation that different players get different matches often enough to avoid too much contention. Usually this is done through varying ranges of parameters inside the label.
  • If players fail to join a match have one created for them, providing even more room for other players to join.