Searching Lobbies through bucketId with EOS_CO_ANYOF returns no results

Hi,

We’re currently using the bucketId in our Lobby sessions.

So far we’re setting the bucketId when we create the lobby session:

EOS_Lobby_CreateLobbyOptions Options = { 0 };
// only showing the bucketId setting, for simplicity.
Options.BucketId = "1234567x0";  // hardcoded value, just as an example.

Later, when we search for lobbies, everything works as expected if we match a single bucketId by using the EOS_CO_EQUAL operator.

On the other hand, if we try to match the bucketId against a list by using the EOS_CO_ANYOF operator, we’re getting no matches at all.

I’m adding a snippet of the Lobby Search Parameter Option used during the search ( with hardcoded values, just for simplification ).

EOS_LobbySearch_SetParameterOptions Option = { };
Option.ApiVersion = EOS_LOBBYSEARCH_SETPARAMETER_API_LATEST;
Option.Parameter.ApiVersion = EOS_LOBBY_ATTRIBUTEDATA_API_LATEST;
Option.Parameter.Key = EOS_LOBBY_SEARCH_BUCKET_ID;
Option.Parameter.Value.AsUtf8 = "1234567x0;1234567x1;1234567x2;1234567x3;1234567x4;1234567x5";
Option.Parameter.ValueType = EOS_AT_STRING;
Option.ComparisonOp = EOS_CO_ANYOF;

EOS_EResult RetVal = EOS_LobbySearch_SetParameter(LobbySearchHandle, &Option);

According to https://dev.epicgames.com/docs/epic-online-services/multiplayer/lobbies-and-sessions/lobby-interface/search-for-a-lobby, the delimiter for “EOS_CO_ANYOF” is semicolon, so that should not be the problem.

My guess is that someone bucketId attribute doesn’t allows EOS_CO_ANYOF for some reason, but I can’t find any information that can confirm that.

Additionally, I tried to do a search with “EOS_CO_ANYOF” but targeting just “1234567x0” ( instead of multiple bucketIds ) which doesn’t returns any match either.

We’re using EOS SDK 1.18.0.4.

Thanks in advance,

Alvaro

Thanks for the detailed repro and the code snippet, both are very helpful. Your syntax for EOS_LobbySearch_SetParameter looks correct.

Looking at the SDK code, I’m suspecting this is a bug in how the SDK forwards the search parameter to the backend for ANYOF when the key is BUCKET_ID, but I want to confirm with the engineering team. This could perhaps be by design, and simply not documented. I’ll let you know once I have an update.

In the meantime, here are two workarounds:

1. Run one EOS_LobbySearch_Find per bucket ID using EOS_CO_EQUAL and merge the results on the client side. This matches the working code path and gives you the same set of lobbies. Annoying, but the Find call is asynchronous, so there shouldn’t be much of a performance hit.

2. If you want a single query, store the value you want to filter on as a regular custom string attribute on the lobby (EOS_LobbyModification_AddAttribute with EOS_AT_STRING), in addition to or instead of relying on the bucket ID for that filter. EOS_CO_ANYOF works correctly against custom string attributes, so the same semicolon-delimited list will match any of the values. This workaround is less ideal as the BucketId is the primary search key on our backend and dramatically improves performance.

Hey Alvaro,

We’ve got a Jira for this and I have a potential fix. This should get added into the next SDK version, though I can’t promise at this time. I don’t have an ETA for the next release.

Thanks,

Seb

Hi [Content removed] Bergeron​ ,

I think in the short term we’ll use a regular custom string attribute for the EOS_CO_ANYOF query. I’m afraid that doing multiple request with different bucketIds could have a negative impact in the rate limit.

It would be great if the bucket eventually supports EOS_CO_ANYOF.

Best regards,

Alvaro