Warning: STEAM: Unknown session name (GameSession)

Hello Everyone,
I want to make a multiplayer game in ue5.5 . I added uselobbiesif availabale, I added steam subsystems into default engine.ini . After that I added some other assets into my project. Actually it is connecting to the steam and I can create a session. but when I click to join button it just waits and nothing happening. I looked to the logs to see what is wrong with it and I see that steam has a problem with my game session;

Warning: STEAM: Unknown session name (GameSession)

After find the session, it sends this warning and joining process fails. I have added some additional debug messages into different delegates and I see that my Address which we created at here;

FString Address;

SessionInterface->GetResolvedConnectString(NAME_GameSession, Address);

is null.

After this point to control I have a session at this point, I added this line;
FOnlineSession* CurrentSession = SessionInterface->GetNamedSession(NAME_GameSession);
and I see that current session is also null.

So before whole process It thrown me an error related to SEARCH_PRESENCE is not found when tried first and I included Online/OnlineSessionNames.h library to fix it. After that there is a warning;

warning C4996: ‘SEARCH_PRESENCE’: SEARCH_PRESENCE (“PRESENCESEARCH”) is deprecated and will soon stop being a valid UE-defined key. Please consult upgrade notes for more details Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.

Whole Steam Logs after trying to join;
LogOnlineSession: STEAM: Found 1 lobbies, finalizing the search

LogOnlineSession: STEAM: Search result 0: LobbyId=Lobby[0x18600004Bsfrsd46], LobbyId.IsValid()=true, CSteamID(LobbyId).IsLobby()=true

LogOnlineSession: Warning: STEAM: [FOnlineSessionSteam::JoinSession] The values of FOnlineSessionSettings::bUsesPresence and FOnlineSessionSettings::bUseLobbiesIfAvailable are treated as equal and have to match

LogOnlineSession: Warning: STEAM: Unknown session name (GameSession) specified to GetResolvedConnectString()

LogOnlineSession: Warning: STEAM: Unknown session name (GameSession) specified to GetResolvedConnectString()

By the way to be sure there is no issue related download region or something else I tried a basic game builded with ue5.2 and there wasn’t any error.

Hey,

I don’t know if you found the issue or not but I found something. If you have a better solution please write it down because my two options are very hacky.

In OnlinessionInterfaceSteam.cpp inside the Online Subsystem Steam engine plugin there is a new piece of code in JoinSession :

// In Steam, bUsesPresence and bUseLobbiesIfAvailable have equivalent meaning and should have the same value
	if(DesiredSession.Session.SessionSettings.bUsesPresence != DesiredSession.Session.SessionSettings.bUseLobbiesIfAvailable)
	{
		UE_LOG_ONLINE_SESSION(Warning, TEXT("[%hs] The values of FOnlineSessionSettings::bUsesPresence and FOnlineSessionSettings::bUseLobbiesIfAvailable are treated as equal and have to match"), __FUNCTION__);
		TriggerOnJoinSessionCompleteDelegates(SessionName, EOnJoinSessionCompleteResult::UnknownError);
		return false;
	}

For some reasons that I still don’t quite understand the SearchResultcoming from Steam does not have bUsesPresence equals to bUseLobbiesIfAvaiable.

Option 1 : very hacky const_cast

For now my VERY DIRTY HACK to fix this is the following piece of code inside you code called when a session is found, just before your call to JoinSession:

FOnlineSessionSearchResult* SearchResultPtr = const_cast<FOnlineSessionSearchResult*>(&SearchResult);
	SearchResultPtr->Session.SessionSettings.bUsesPresence = true;
	SearchResultPtr->Session.SessionSettings.bUseLobbiesIfAvailable = true;

Word of caution : this is a hack for now to unblock you while I understand why the Steam Search Result does not have the same value for those two booleans.

Option 2 : Less hacky but engine modification

A better solution if you can change the engine code in the Online Subsystem Steam plugins (located into Engine/Plugins/Online/OnlineSubsystemSteam) is to remove some of the code I showed earlier so at the beginning of the JoinSession method the code should look like that :

	if(DesiredSession.Session.SessionSettings.bUsesPresence != DesiredSession.Session.SessionSettings.bUseLobbiesIfAvailable)
	{
		UE_LOG_ONLINE_SESSION(Warning, TEXT("[%hs] The values of FOnlineSessionSettings::bUsesPresence and FOnlineSessionSettings::bUseLobbiesIfAvailable are treated as equal and have to match"), __FUNCTION__);
	}

It is still not ideal but better than a const_cast.

Cheers while I find a better solution