Download

EOS Create/Find/Join Session issue , Joining wrong Map despite opening a listen server on creating session

Hello,

Creating session works just fine,

void CreateSesion()
{
if (SessionInterface.IsValid()) {
		FOnlineSessionSettings SessionSettings;
		SessionSettings.bIsLANMatch = false;
		SessionSettings.NumPublicConnections = 5;
		SessionSettings.bShouldAdvertise = true;
		SessionSettings.bUsesPresence = true;
		SessionSettings.Set(SERVER_NAME_SETTINGS_KEY, DesiredServerName, EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
 
		SessionInterface->CreateSession(0, SESSION_NAME, SessionSettings);
	}
}
 
void OnCreateSessionComplete(FName SessionName, bool Success)
{
	if (!Success)
	{
		UE_LOG(LogTemp, Warning, TEXT("Could not create session"));
		return;
	}
 
	UEngine* Engine = GetEngine();
	if (!ensure(Engine != nullptr)) return;
 
	Engine->AddOnScreenDebugMessage(0, 2, FColor::Green, TEXT("Hosting"));
 
	UWorld* World = GetWorld();
	if (!ensure(World != nullptr)) return;
 
	World->ServerTravel("/Game/PuzzlePlatforms/Maps/Lobby?listen");
}

Finding session doesn’t work unless we comment this line

“SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);”

otherwise the find session will return 0 result eventhough I can see the session in the dev portal. They acknowledge this issue over EOSHelp here

void FindSessions()
{
if (SessionSearch.IsValid())
	{
		SessionSearch->MaxSearchResults = 100;
		//SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
		UE_LOG(LogTemp, Warning, TEXT("Starting Find Session"));
		SessionInterface->FindSessions(0, SessionSearch.ToSharedRef());
	}
}

Now, On joining session, I can see myself joining the session successfully, I can see the correct IP and port in the logs but followed by the wrong map path IP:PORT/Game/Maps/WrongMap

a couple seconds then I get these Logs. This codes works perfectly fine with Steam subsystem

void Join(uint32 Index)
{
	if (!SessionInterface.IsValid()) return;
	if (!SessionSearch.IsValid()) return;
 
	SessionInterface->JoinSession(0, SESSION_NAME, SessionSearch->SearchResults[Index]);
}
 
void OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result)
{
	if (!SessionInterface.IsValid()) return;
 
	FString Address;
	if (!SessionInterface->GetResolvedConnectString(SessionName, Address)) {
		UE_LOG(LogTemp, Warning, TEXT("Could not get connect string."));
		return;
	}
 
	UEngine* Engine = GetEngine();
	if (!ensure(Engine != nullptr)) return;
 
	Engine->AddOnScreenDebugMessage(0, 5, FColor::Green, FString::Printf(TEXT("Joining %s"), *Address));
 
	APlayerController* PlayerController = GetFirstLocalPlayerController();
	if (!ensure(PlayerController != nullptr)) return;
 
	PlayerController->ClientTravel(Address, ETravelType::TRAVEL_Absolute);
}