x

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"

Can't find game sessions online with steam

Hello!

I'm trying to create an online game with Steam online subsystem and for some reason I can't find any session I've created (I also have read that I should see some other games based on the 480 steam id we use for development, but I don't find them either).

What I've done for now is installing the steam plugin, modify the DefaultEditor.ini to add the data it needs, etc.

Steam itself seems working since A) I see the steam overlay ingame B) I can create a game session with steam subsystem ( I debug the standalone version of the game and it's using the Steamsubsystem as expected)

I assume I'm doing something wrong in the find session, since I'm modifying the method that used to use the Null subsystem and they might have different dependencies.

I've looked for documentation but I can't find anything that helps me (I have low experience with UE so far).

The code I've tryed is the next:

Thanks in advance!

     void UOddGameInstance::FindGameSessions(int MaxSearchResults, int PingBucketSize, TArray<FBlueprintSessionResult>& Results, FLatentActionInfo LatentInfo) {
         ULocalPlayer* const player = GetFirstGamePlayer();
     
         auto latentAction = CreatePendingLatentAction(LatentInfo);
     
         // Get the OnlineSubsystem we want to work with
         // TODO: somehow when finding we need to retrieve the Subsystem in this way to actually produce search result
         IOnlineSubsystem* onlineSub = Online::GetSubsystem(this->GetWorld());  
         if (onlineSub) {
             // Get the SessionInterface from our OnlineSubsystem
             IOnlineSessionPtr sessions = onlineSub->GetSessionInterface();
             if (sessions.IsValid() && player->GetPreferredUniqueNetId().IsValid()) {
     
                 // wrapper delegate that pass the Results reference in to the OnFindSessionsComplete call;
                 if (!OnFindSessionsCompleteDelegate.IsBound())
                     OnFindSessionsCompleteDelegate.BindLambda([this, &Results, latentAction](bool success) {
                     OnFindSessionsComplete(success, Results, latentAction);
                 });
     
                 /*
                 Fill in all the SearchSettings, like if we are searching for a LAN game and how many results we want to have!
                 */
                 SessionSearch = MakeShareable(new FOnlineSessionSearch());
     
                 SessionSearch->bIsLanQuery = bEnableLAN;
                 SessionSearch->MaxSearchResults = MaxSearchResults; //This is 10 so far
                 SessionSearch->PingBucketSize = PingBucketSize; //This is 200 so far
     
                 // We only want to set this Query Setting if "bIsPresence" is true
                 if (bIsPresence)
                 {
                     SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, bIsPresence, EOnlineComparisonOp::Equals);
                 }
     
                 TSharedRef<FOnlineSessionSearch> SearchSettingsRef = SessionSearch.ToSharedRef();
     
                 // Set the Delegate to the Delegate Handle of the FindSession function
                 OnFindSessionsCompleteDelegateHandle = sessions->AddOnFindSessionsCompleteDelegate_Handle(OnFindSessionsCompleteDelegate);
     
                 // Finally call the SessionInterface function. The Delegate gets called once this is finished
                 TSharedPtr<const FUniqueNetId> UserId = player->GetPreferredUniqueNetId();
                 sessions->FindSessions(*UserId, SearchSettingsRef);
             }
             else
                 OnFindSessionsComplete(false, Results, latentAction);
         }
         else {
             // If something goes wrong, just call the Delegate Function directly with "false".
             OnFindSessionsComplete(false, Results, latentAction);
         }
     }


Product Version: UE 4.16
Tags:
more ▼

asked Aug 30 '17 at 08:38 PM in C++ Programming

avatar image

mjdegue
6 2

(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