[solved] Matchmaker: player won't get matched when using "query" string even though they are the same

{Details}

  1. Versions: Nakama {3.22.0}, {Docker},
  2. client library I downloaded from Godot Asset Library, it says 3.22, however I am not 100% sure it’s the same one I downloaded last week as it’s not written anywhere. But it probably is the same (?)

Update: (added string_property and numeric_property argument)

I tried to use nakama matchmaker. I have been testing with empty query all this time and it worked.

matchmaker_ticket = await socket.add_matchmaker_async("", 4, 4)

but when I tried to add query, it won’t work:

matchmaker_ticket = await socket.add_matchmaker_async("version:alpha", 4, 4, {"version":"alpha"}, {})

I got the ticket but the players is not getting matched.
The output stuck here:

nakama-1       | {"level":"info","ts":"2025-03-04T08:29:52.951Z","caller":"server/session_ws.go:81","msg":"New WebSocket session connected","uid":"1c00d259-f6b3-47e9-8ff6-226e6951afd3","sid":"d86b65e5-f8d2-11ef-9e
58-7106fdcb5b46","format":0}
nakama-1       | {"level":"info","ts":"2025-03-04T08:29:53.140Z","caller":"server/session_ws.go:81","msg":"New WebSocket session connected","uid":"8dabe16e-3115-475e-8b8e-fb5673ef24a2","sid":"d88842b8-f8d2-11ef-9e
58-7106fdcb5b46","format":0}
nakama-1       | {"level":"info","ts":"2025-03-04T08:29:53.206Z","caller":"server/session_ws.go:81","msg":"New WebSocket session connected","uid":"001aa10b-2d85-4c22-a297-4b0c6e3c4cb9","sid":"d89264b3-f8d2-11ef-9e
58-7106fdcb5b46","format":0}
nakama-1       | {"level":"info","ts":"2025-03-04T08:29:53.245Z","caller":"server/session_ws.go:81","msg":"New WebSocket session connected","uid":"ef1a94d9-bae1-4e80-a250-1184fbca1ec8","sid":"d8984b7f-f8d2-11ef-9e
58-7106fdcb5b46","format":0}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:53.952Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_MatchmakerAdd message","uid":"1c00d259-f6b3-47e9-8ff6-226e6951afd3","sid":"d86b65e
5-f8d2-11ef-9e58-7106fdcb5b46","cid":"1","message":{"MatchmakerAdd":{"min_count":4,"max_count":4,"query":"version:alpha","string_properties":{"version":"alpha"}}}}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:53.953Z","caller":"server/session_ws.go:396","msg":"Sending *rtapi.Envelope_MatchmakerTicket message","uid":"1c00d259-f6b3-47e9-8ff6-226e6951afd3","sid":"d8
6b65e5-f8d2-11ef-9e58-7106fdcb5b46","envelope":"cid:\"1\" matchmaker_ticket:{ticket:\"0e1ee984-a6d6-4413-838f-24ea5e4d4d9a\"}"}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:54.209Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_MatchmakerAdd message","uid":"001aa10b-2d85-4c22-a297-4b0c6e3c4cb9","sid":"d89264b
3-f8d2-11ef-9e58-7106fdcb5b46","cid":"1","message":{"MatchmakerAdd":{"min_count":4,"max_count":4,"query":"version:alpha","string_properties":{"version":"alpha"}}}}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:54.210Z","caller":"server/session_ws.go:396","msg":"Sending *rtapi.Envelope_MatchmakerTicket message","uid":"001aa10b-2d85-4c22-a297-4b0c6e3c4cb9","sid":"d8
9264b3-f8d2-11ef-9e58-7106fdcb5b46","envelope":"cid:\"1\" matchmaker_ticket:{ticket:\"aae3b30f-174d-4212-ba42-df2fadb1ec15\"}"}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:54.246Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_MatchmakerAdd message","uid":"ef1a94d9-bae1-4e80-a250-1184fbca1ec8","sid":"d8984b7
f-f8d2-11ef-9e58-7106fdcb5b46","cid":"1","message":{"MatchmakerAdd":{"min_count":4,"max_count":4,"query":"version:alpha","string_properties":{"version":"alpha"}}}}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:54.247Z","caller":"server/session_ws.go:396","msg":"Sending *rtapi.Envelope_MatchmakerTicket message","uid":"ef1a94d9-bae1-4e80-a250-1184fbca1ec8","sid":"d8
984b7f-f8d2-11ef-9e58-7106fdcb5b46","envelope":"cid:\"1\" matchmaker_ticket:{ticket:\"d23e4f73-70e5-4bdc-b35f-dca7a06dfaae\"}"}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:54.512Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_MatchmakerAdd message","uid":"8dabe16e-3115-475e-8b8e-fb5673ef24a2","sid":"d88842b
8-f8d2-11ef-9e58-7106fdcb5b46","cid":"1","message":{"MatchmakerAdd":{"min_count":4,"max_count":4,"query":"version:alpha","string_properties":{"version":"alpha"}}}}
nakama-1       | {"level":"debug","ts":"2025-03-04T08:29:54.513Z","caller":"server/session_ws.go:396","msg":"Sending *rtapi.Envelope_MatchmakerTicket message","uid":"8dabe16e-3115-475e-8b8e-fb5673ef24a2","sid":"d8
8842b8-f8d2-11ef-9e58-7106fdcb5b46","envelope":"cid:\"1\" matchmaker_ticket:{ticket:\"888b63ad-ac99-413d-8534-9289e2a13f62\"}"}

The query is the same for all players, which is "version:alpha".

I found the answer.
I need to use properties.version in the query string.

In the official tutorial I read, the command was like this:

var min_players = 2
var max_players = 10
var query = "+skill:>100 mode:sabotage"
var string_properties = { "mode": "sabotage" }
var numeric_properties = { "skill": 125 }
var matchmaker_ticket : NakamaRTAPI.MatchmakerTicket = await socket.add_matchmaker_async(query, min_players, max_players, string_properties, numeric_properties)

which should not work (?)

I found the answer when reading this: Query Syntax - Heroic Labs Documentation

On unrelated note, at the time of writing this, I don’t know the difference between Label and Properties

@pegasusearl the label is set on authoritative matches and can be used to query them - the syntax is the same as for the matchmaker, but it is used in the match listing API (more info here: Authoritative Multiplayer - Heroic Labs Documentation).

Hope this clarifies.

1 Like