Online Subsystem Session Search Always Empty

I’m trying to set up a game browser using the steam online subsystem and I’m running into problems. Whenever I run a session search the result set is always completely empty.

Here is my code for creating sessions:

 if (OnlineSystem)
	{
		FOnlineSessionSettings CurrentSettings;
		CurrentSettings.bIsLANMatch = false;
		CurrentSettings.bIsDedicated = false;
		CurrentSettings.bAllowJoinInProgress = true;
		CurrentSettings.bAllowInvites = true;
		CurrentSettings.bShouldAdvertise = true;
		CurrentSettings.bUsesPresence = true;
		CurrentSettings.NumPrivateConnections = 100;
		CurrentSettings.NumPublicConnections = 100;


		CurrentSettings.bUsesStats = true;
		IOnlineSessionPtr Session = OnlineSystem->GetSessionInterface();
		if (Session.IsValid())
		{
			
			Session->AddOnCreateSessionCompleteDelegate(OnCreateSessionCompleteDelegate);
			return Session->CreateSession(1, serverName, CurrentSettings);
		}
	}

	return false;

Here is my code for searching sessions:

if (OnlineSystem)
	{
		IOnlineSessionPtr Session = OnlineSystem->GetSessionInterface();
		if (Session.IsValid())
		{
			SearchSettings = MakeShareable(new FOnlineSessionSearch());
			SearchSettings->bIsLanQuery = false;
			SearchSettings->MaxSearchResults = 100;
			SearchSettings->PingBucketSize = 200;
			TSharedRef<FOnlineSessionSearch> SearchSettingsRef = SearchSettings.ToSharedRef();
			Session->AddOnFindSessionsCompleteDelegate(OnFindSessionCompleteDelegate);
			return Session->FindSessions(0, SearchSettingsRef);
		}
	}
	return false;

Any help would be appreciated. I can provide run-time logs if that would help

#Steam

You need an actual online subsystem that has servers, the default subsystem is not actually a real service that has hosting capacities

If you use steam you need your own steam app id.

Thanks for the reply! I am using the steam subsystem and have an app id and as far as I can tell I am successfully making a session with the app id. Heres what I believe to be the relevant part of the log:

17451-sessionlog.png

Did you ever get it working? I’m stuck in the same problem.

So … isn’t it possible to use the OnlineSubsystemNull for hosting in LAN? Did I misunderstand that? I thought the OnlineSubsystemNull provides basic functionality for LAN games. Even though I am not able to find any games (it says successful hosts/finds, but the SearchResults.Num() is always 0 :frowning: )

Hello guys, I’m stuck in the same problem my SearchResults.Num() is always empty. before call my method to find sessions, i create a session successful but after that i call my FindSessions method and SearchResults is empty. Anyone can help me with this problem, please.

I also found thisproblem, like, findsession succesful, but searchresult’s Num away 0. do you know why ? help me , thank you.

Same problem here. LAN works fine, but after setting LAN to false and bUsesPresence to false (to create an internet session), the results are always empty.

Tuns out bUsesPresence=false creates an internet session which is used for dedicated servers. It will callback on one of the steam game server ports which was being blocked by the router, resulting in a ‘steam: failed to respond IP’. The solution was to use bUsesPresence=true to create a steam lobby. -debug and verbose logging were a major help in trying to figure out the steam subsystem.

I issue this problem with run PIE. after build a .exe no this problem!

I am having the same issue. I cannot find sessions via steam. Can somebody please help me? I am using UE4.15. I have my appid. My game is greenlit on steam. I am using the advanced session plug-in. Finding session over router is easy but cannot find session when hosted at a different location.

I am having the same issue while using AppID: 480, i am testing in 2 different laptops and 2 different steam accounts.

bUsesPresence = true is already set to true.
able to create the online session but unable to find that session from other laptop.
tried with max search results = 100000
but it search result is always empty.