Download

FindSessions returns always 0 when run from blueprint

Enabled steam, so overlay brings up fine in standalone launch from editor

after begin play session creates (tryed both lan and not), when character jump begin session searching and magically it find 0 sessions, looked into sourcode and founde lovely definition

bool FOnlineSessionSteam::FindSessions(int32 SearchingPlayerNum, const TSharedRef& SearchSettings) { uint32 Return = E_FAIL;

// Don’t start another search while one is in progress
if (!CurrentSessionSearch.IsValid() && SearchSettings->SearchState != EOnlineAsyncTaskState::InProgress)
{
// Free up previous results
SearchSettings->SearchResults.Empty();

 // Copy the search pointer so we can keep it around
 CurrentSessionSearch = SearchSettings;

 // Check if its a LAN query
 if (SearchSettings->bIsLanQuery == false)
 {
     Return = FindInternetSession(SearchSettings);
 }
 else
 {
     Return = FindLANSession();
 }

 if (Return == ERROR_IO_PENDING)
 {
     SearchSettings->SearchState = EOnlineAsyncTaskState::InProgress;
 }

}
else
{
UE_LOG_ONLINE(Warning, TEXT(“Ignoring game search request while one is pending”));
Return = ERROR_IO_PENDING;
}

return Return == ERROR_SUCCESS || Return == ERROR_IO_PENDING;
}

bool FOnlineSessionSteam::FindSessions(const FUniqueNetId& SearchingPlayerId, const TSharedRef& SearchSettings) { // @todo: use proper SearchingPlayerId return FindSessions(0, SearchSettings); }

am i right, even after ~ a year blueprint interface to sessions feature isn’t complete and i have to use C++?

Where is the create session code? Are you opening the map with mapname?listen

everything in engine source code at …\Engine\Source\Runtime\Online\OnlineSubsystemSteam\Private\

exactly this is

bool FOnlineSessionSteam::CreateSession(int32 HostingPlayerNum, FName SessionName, const FOnlineSessionSettings& NewSessionSettings)
{
uint32 Result = E_FAIL;

// Check for an existing session
FNamedOnlineSession* Session = GetNamedSession(SessionName);
if (Session == NULL)
{
	// Create a new session and deep copy the game settings
	Session = AddNamedSession(SessionName, NewSessionSettings);
	check(Session);
	Session->SessionState = EOnlineSessionState::Creating;
	Session->NumOpenPrivateConnections = NewSessionSettings.NumPrivateConnections;
	Session->NumOpenPublicConnections = NewSessionSettings.bIsDedicated ? NewSessionSettings.NumPublicConnections : NewSessionSettings.NumPublicConnections - 1;

	Session->HostingPlayerNum = HostingPlayerNum;
	Session->OwningUserId = SteamUser() ? MakeShareable(new FUniqueNetIdSteam(SteamUser()->GetSteamID())) : NULL;
	Session->OwningUserName = SteamFriends() ? SteamFriends()->GetPersonaName() : FString(TEXT(""));
	
	// Unique identifier of this build for compatibility
	Session->SessionSettings.BuildUniqueId = GetBuildUniqueId();

	// Create Internet or LAN match
	if (!NewSessionSettings.bIsLANMatch)
	{
		if (Session->SessionSettings.bUsesPresence)
		{
			Result = CreateLobbySession(HostingPlayerNum, Session);
		}
		else
		{
			Result = CreateInternetSession(HostingPlayerNum, Session);
		}
	}
	else
	{
		Result = CreateLANSession(HostingPlayerNum, Session);
	}

	if (Result != ERROR_IO_PENDING)
	{
		// Set the game state as pending (not started)
		Session->SessionState = EOnlineSessionState::Pending;

		if (Result != ERROR_SUCCESS)
		{
			// Clean up the session info so we don't get into a confused state
			RemoveNamedSession(SessionName);
		}
		else
		{
			RegisterLocalPlayers(Session);
		}
	}
}
else
{
	UE_LOG_ONLINE(Warning, TEXT("Cannot create session '%s': session already exists."), *SessionName.ToString());
}

if (Result != ERROR_IO_PENDING)
{
	TriggerOnCreateSessionCompleteDelegates(SessionName, (Result == ERROR_SUCCESS) ? true : false);
}

return Result == ERROR_IO_PENDING || Result == ERROR_SUCCESS;

}

bool FOnlineSessionSteam::CreateSession(const FUniqueNetId& HostingPlayerId, FName SessionName, const FOnlineSessionSettings& NewSessionSettings)
{
// @todo: use proper HostingPlayerId
return CreateSession(0, SessionName, NewSessionSettings);
}

but i can’t find what function used in blueprints