Warning: STEAM: Unknown session name (GameSession)

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

1 Like