Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do I correctly use session search ?

While creating a session I create custom settings for the session like so,

 SessionSettings = MakeShareable(new FOnlineSessionSettings());

Then I set a custom setting for the session using,

 SessionSettings->Set(SEARCH_KEYWORDS, MatchTag, EOnlineDataAdvertisementType::ViaOnlineService);

Where MatchTag is a fstring that I set to "1V1"

Then while finding sessions, I create a custom search settings,

 SessionSearch = MakeShareable(new FOnlineSessionSearch);

And set a custom search query like so,

 SessionSearch->QuerySettings.Set(SEARCH_KEYWORDS, MatchTag, EOnlineComparisonOp::Equals);

But here I pass-in an fstring that has "2V2" in MatchTag.

The problem is that the session that was registered with "1V1" as the MatchTag, is being returned as a search result where I passed "2V2" as query setting in MatchTag.

I have even checked the Match tag on the result and it is displayed as "1V1", but why is this result even returned when I did not search for it in the query ?

Product Version: UE 4.17
more ▼

asked Dec 15 '17 at 06:27 AM in C++ Programming

avatar image

11 2 2

avatar image TheGoldenCascade Dec 15 '17 at 01:28 PM

Ok, Search settings do not work for LAN Sessions for some reason, but if you create online sessions using steam, they are filtered correctly. I am now filtering these sessions in onFindSessionsComplete(),

 if (SessionSearch->SearchResults.Num() > 0)
     for (int32 SearchIdx = 0; SearchIdx < SessionSearch->SearchResults.Num(); SearchIdx++)
         if (bIsLanSession)
             for (auto setting : SessionSearch->SearchResults[SearchIdx].Session.SessionSettings.Settings)
                 UE_LOG(LogTemp, Warning, TEXT("Key : %s , Value : %s"), *setting.Key.ToString(), *setting.Value.ToString());
                 if (setting.Key == SEARCH_KEYWORDS && setting.Value.Data == MatchTag)
                     // Yup this is correct LAN result, join it or add it to a array 
                     //Not the session you were looking for...
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question