My problem is the “Find Session” node code is written in Visual Studio so that only one session can be found, and I need it to be able to give me an array of found sessions, and the default “find sessions” node from UE5 doesn’t work with it.
You won’t be able to build a proper server browser using EOS Sessions. The search results are capped at 200, and the backend returns results that are non-deterministic. See How can I retrieve a list of all lobbies or sessions?
What’s the “Find Session” node? I’m assuming you’re using a third-party plugin. The plugins provided by Epic don’t expose OSS APIs to blueprints. At the OSS level FindSessions returns a TArray<FOnlineSessionSearchResult>.
Do you have a link to the plugin repo? We don’t support 3P plugins, but I can take a quick look at the code to see if I spot what needs to be changed to return an array rather than a single session.
Hey, the callback for FindSessions looks to be broken (or there was a design decision made I don’t currently understand):
void UEOSSubsystem::OnFindSessionsComplete(bool bWasSuccessful)
{
++BackgroundCounter;
if (bWasSuccessful && SessionSearch.IsValid() && SessionSearch->SearchResults.Num() > 0)
{
int32 Index = 0;
for (FOnlineSessionSearchResult Lobby : SessionSearch->SearchResults)
{
LogEntry(FString::Printf(TEXT("Found session with id: %s"), *Lobby.GetSessionIdStr()));
auto CompareInt = CurrentSessionName.Compare(FName(*Lobby.GetSessionIdStr()));
if (CompareInt != 0)
{
SearchResult = SessionSearch->SearchResults[Index];
CurrentSessionName = FName(*SearchResult.GetSessionIdStr());
}
++Index;
}
OnRoomFound.Broadcast(true);
}
else
{
LogError(FString::Printf(TEXT("Couldn't find any sessions")));
OnRoomFound.Broadcast(false);
}
}
Effectively, only 1 session will be returned the last one. I don’t understand the comparison here as the CurrentSessionName is getting overwritten and compared to on the following loop. If you’re comfortable modifying C++ code, you could look at how our OnlineSubsystemEOS plugin handles FindSessions.
You can try asking in the Epic Online Services Discord channel and in the Epic Developer Community for UE. There are also other 3rd party plugins on FAB that may support Oculus and provide the features you need.
Oh ok thank you for the link, and yes it is third party it uses Oculus Platform Social APIs, the EOS plugin as the transport layer and UE replication, or at least that’s how meta explains it on their GitHub page.
Yes, https://github.com/oculus-samples/Unreal-SharedSpaces. Sorry for the late reply. Do you want me to copy paste the any of the code?
Thank you for looking in to it so quickly. I came to the same conclusion a few weeks ago and have been trying to figure out how to edit the code to retrieve an array like you said, but I just don’t feel like I have a good enough understanding of how meta’s version of their “find session” node is working but the default one doesn’t seem to work at all.
I’d be willing to pay if you know anyone who could code it?
Thank you, I’ll head there next. I have also tried purchasing the EOS integration kit from betide studio and I’m still in the process of testing that out as an alternative. Thank you SedBergy I appreciate your help.