Custom query matchMaker

Hi community,
I’m using Nakama SDK in my game that’s developed in C++ with cocos2d-x.
Currently I’m having problems with matchMaker. I’ll try to be brief:
I’m using the method addMatchmaker for search players in the server and start playing.

When I do a matchMaker with query = "*" everything works, I find an opponent to play. But when I want to do a matchMaker with a custom query, I don’t find opponents.

For example, I’ve 2 players that are looking for opponents. Both players are in the matchMaker pool with the same query, this query:
query = "+nextRoundMatch:eedf6992-0f85-4a8a-9a25-624eab40ee95."

But it doesn’t work. The callback onMatchmakerMatchedCallback is not called. And I don’t have an error related to matchMaker because this callback is called ok in both clients:

auto successCallbackMatchMaker = [](const NMatchmakerTicket &ticket)
{
};

I mean, both players are in the matchmaker pool but they don’t find each other despite of they have the same query.
Is this feature working ? Or maybe I’m doing something wrong?

Thanks.

1 Like

Issue created on git: https://github.com/heroiclabs/nakama-cpp/issues/33

@tranthor What properties are you specifying for your users when you add them to matchmaking? I assume you’ve submitted a string property for each user with the value key "nextRoundMatch" and the value "eedf6992-0f85-4a8a-9a25-624eab40ee95."

If all of that is fine then have a look at the matchmaker query docs for a few examples, you’ll see part of the query specification is a field namespace. Your query should look more like: query = "+properties.nextRoundMatch:eedf6992\-0f85\-4a8a\-9a25\-624eab40ee95.". Note also the escaped - characters, you can find more info on escaping queries in the query string docs for Nakama’s embedded indexer.

1 Like

Thanks @zyro ! I fixed it.
It worked without adding escaped - characters. So I assume that’s not necessary