# Steam Online Subsystem Session Search always Empty

**URL:** <https://forums.unrealengine.com/t/steam-online-subsystem-session-search-always-empty/1270080>\
**Category:** Multiplayer & Networking\
**Tags:** onlinesubsystem, UE-5, Networking, empty, Steam, unreal-engine, CPP, question\
**Created:** [August 23, 2023, 5:13pm UTC](https://forums.unrealengine.com/t/steam-online-subsystem-session-search-always-empty/1270080 "2023-08-23T17:13:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SCARBLAZ1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SCARBLAZ1](https://forums.unrealengine.com/u/SCARBLAZ1)\
**Post date:** [August 23, 2023, 5:13pm UTC](https://forums.unrealengine.com/t/steam-online-subsystem-session-search-always-empty/1270080/1 "2023-08-23T17:13:40Z")

</div>

**Issue: Steam OSS Find Session Result is always empty. (0)**

Please find the image attached for visual of Debug values.

**Details:**  
Engine: Unreal 5.2  
Project Type: C++  
Online Subsystem: Steam  
Steam App ID: Default 480 ( Space War )

**Objective:**  
Be able to join steam session using online multiplayer in Unreal 5.2 C++

**Current Status:**  
Able to creating session but when trying to connect a session, SessionSearch-\>SearchResults.Num() is always coming in as 0.

**Things i tried already:**  
After reading a few forums , these lines needed to be there to be able to join, i tried and they are already there in my testing build.

```auto
sessionSettings->bUsesPresence = true;
sessionSettings->bUseLobbiesIfAvailable = true;

```

**How am i testing:**  
I am using 2 different laptops , 2 different steam accounts, BUT same network.  
not sure if this is helpful, but just letting the most detail out of me.

**Creating Game Session Code**

```auto
//Called When pressing the 1 key
	if (!OnlineSessionInterface.IsValid())
	{
		return;
	}

	auto existingSessions = OnlineSessionInterface->GetNamedSession(NAME_GameSession);
	if (existingSessions != nullptr)
	{
		OnlineSessionInterface->DestroySession(NAME_GameSession);
	}

	OnlineSessionInterface->AddOnCreateSessionCompleteDelegate_Handle(CreateSessionCompleteDelegate);

	TSharedPtr<FOnlineSessionSettings> sessionSettings = MakeShareable(new FOnlineSessionSettings());
	sessionSettings->bIsLANMatch = false;
	sessionSettings->NumPublicConnections = 4;
	sessionSettings->bAllowJoinInProgress = true;
	sessionSettings->bAllowJoinViaPresence = true;
	sessionSettings->bShouldAdvertise = true;
	sessionSettings->bUsesPresence = true;
	sessionSettings->bUseLobbiesIfAvailable = true;
	const ULocalPlayer* localPlayer = GetWorld()->GetFirstLocalPlayerFromController();
	OnlineSessionInterface->CreateSession(*localPlayer->GetPreferredUniqueNetId(), NAME_GameSession, *sessionSettings);

```

**Joining Game Session / Checking the joining session**

```auto
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, FString::Printf(TEXT("Searching For Sessions")));
	//Find Game Sessions
	if (!OnlineSessionInterface.IsValid())
	{
		if (GEngine)
		{
			GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, FString::Printf(TEXT("Game Session Interface Invalid")));
		}
		return;
	}

	OnlineSessionInterface->AddOnFindSessionsCompleteDelegate_Handle(FindSessionsCompleteDelegate);

	SessionSearch = MakeShareable(new FOnlineSessionSearch());
	SessionSearch->MaxSearchResults = 1000000;
	SessionSearch->bIsLanQuery = false;
	
	const ULocalPlayer* localPlayer = GetWorld()->GetFirstLocalPlayerFromController();

	OnlineSessionInterface->FindSessions(*localPlayer->GetPreferredUniqueNetId(), SessionSearch.ToSharedRef());

```

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/a/7aabd0447f35c5b6abdb44768ea18f58748161ba.png)

Code Reference: [Unreal Engine 5 C++ Multiplayer Shooter | Udemy](https://www.udemy.com/course/unreal-engine-5-cpp-multiplayer-shooter/)

---

<div class="post-metadata">

**Author:** ![k\_rajesh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@k\_rajesh](https://forums.unrealengine.com/u/k_rajesh)\
**Post date:** [August 24, 2023, 9:41am UTC](https://forums.unrealengine.com/t/steam-online-subsystem-session-search-always-empty/1270080/2 "2023-08-24T09:41:16Z")

</div>

it needs to be set querySettings

---

<div class="post-metadata">

**Author:** ![SCARBLAZ1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SCARBLAZ1](https://forums.unrealengine.com/u/SCARBLAZ1)\
**Post date:** [August 24, 2023, 10:56am UTC](https://forums.unrealengine.com/t/steam-online-subsystem-session-search-always-empty/1270080/3 "2023-08-24T10:56:08Z")

</div>

can you explain in detail?  
Because QuerySettings no longer has ‘SEARCH\_PRESENCE’. if that is what you are talking about.

---

<div class="post-metadata">

**Author:** ![SCARBLAZ1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SCARBLAZ1](https://forums.unrealengine.com/u/SCARBLAZ1)\
**Post date:** [August 24, 2023, 12:28pm UTC](https://forums.unrealengine.com/t/steam-online-subsystem-session-search-always-empty/1270080/4 "2023-08-24T12:28:19Z")

</div>

for future purpose whoever faces this issue:

Even though IDE showing that symbol is not found

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/7/277e67f1866f495cb53c04ecc8131167bf29c218.png)  
just compile it and it will compile without any error.

and session is connected.

found out that in 5.1.1 IDE identified that symbol.  
5.2 has this issue.

Thanks @k_rajesh

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 23, 2023, 12:28pm UTC](https://forums.unrealengine.com/t/steam-online-subsystem-session-search-always-empty/1270080/5 "2023-09-23T12:28:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
