I am attempting to build a function to find sessions in my game using OnlineSubsystem. I am using a Windows Sandbox with a separate Steam account. I am able to see the user in an active session via Steam interface. I can join their session via Steam interface. When I run the FindSessions function, the function completes with 0 results.
Below is a snippet of the FindSessions function:
PendingSearchResults = &OutSessionSearchResults;
SearchSettings = MakeShareable(new FOnlineSessionSearch());
SearchSettings->bIsLanQuery = false;
SearchSettings->MaxSearchResults = MaxResults;
SearchSettings->QuerySettings.Set(SEARCH_LOBBIES,true,EOnlineComparisonOp::Equals);
SessionInterface->OnFindSessionsCompleteDelegates.AddUObject(this, &MySubSystem::OnSessionsFound);
SessionInterface->FindSessions(LocalPlayerNumber, SearchSettings.ToSharedRef());
Below is a snippet of the OnSessionsFound delegate:
if (bWasSuccessful)
{
*PendingSearchResults = SearchSettings->SearchResults;
}
else
{
UE_LOG(LogTemp, Error, TEXT("Session search failed."));
}
There were some issues getting JoinSession to work, but was able to get it working with some config changes and forcing the OnlineSubsystem for the correct platform(“STEAM”). I am wondering if there is something I am missing to get FindSessions working?
For context, PendingSearchResults is used to display the search results in an ImGui window for testing.