Filtering by multiple lobby attributes #1035
Replies: 3 comments 2 replies
-
This isn't demonstrated exactly in the samples, but we have something close. Look to First it cooks up a lobby search, which doesn't actually need to relate to your query. var createLobbySearchOptions = new CreateLobbySearchOptions() { MaxResults = 10};
Result result = EOSManager.Instance.GetEOSLobbyInterface().CreateLobbySearch(ref createLobbySearchOptions, out LobbySearch outLobbySearchHandle); Then it cooks up a parameter set. LobbySearchSetParameterOptions paramOptions = new LobbySearchSetParameterOptions();
paramOptions.ComparisonOp = ComparisonOp.Equal;
// Turn SearchString into AttributeData
AttributeData attrData = new AttributeData();
attrData.Key = attributeKey.Trim();
attrData.Value = new AttributeDataValue();
attrData.Value = attributeValue.Trim();
paramOptions.Parameter = attrData;
result = outLobbySearchHandle.SetParameter(ref paramOptions); All you need to do here, is to create an |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the quick response! I am really not sure if I am doing the right thing and how exactly it should work. I tried adding my two AttributeData like this in the SearchByAttribute function :
I am not sure what to pass for the attributeKey and attributeValue of SearchByAttribute(); Normally for searching a single attribute, I would do this:
|
Beta Was this translation helpful? Give feedback.
-
Thank you so much! This works great! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a list that displays all active lobbies in a specific game mode (Lobby Attribute 2) and I want an user to be able to search a lobby by it's name (Lobby Attribute 2).
It should search for lobbies with specific game mode then, within the results, search again for a lobby name that corresponds to the user's input and finally display this lobby to the user. This would be to prevent a lobby from a game mode (eg. Coop) to pop up in the lobby list of another game mode (eg. Versus).
My problem is that I am not sure if there is a way to filter by multiple lobby attributes in a single query and if not, I was wondering if there is a workaround I could do.
For now, I can do both search separately completely fine, I just don't know how to combine them.
Any help will be greatly appreciated!
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions