Hi. I’m having trouble with joining a local session created by a locally running dedicated server - the search result is empty.
I have dedicated sever built according to this guide
which creates and starts a session according to this guide
The session is created and started successfully, but the client (PIE instance of the game) is not able to find it.
Here are the session’s settings:
Dedicated sever
void ATPPGameSession::RegisterServer()
{
IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
IOnlineSessionPtr SessionInt = Online::GetSessionInterface();
if (SessionInt.IsValid())
{
TSharedPtr<class FOnlineSessionSettings> SessionSettings = MakeShareable(new FOnlineSessionSettings());
SessionSettings->Set(SETTING_MATCHING_TIMEOUT, 120.0f, EOnlineDataAdvertisementType::ViaPingOnly);
SessionSettings->Set(SETTING_SESSION_TEMPLATE_NAME, FString("GameSession"), EOnlineDataAdvertisementType::ViaPingOnly);
SessionSettings->Set(SETTING_MAPNAME, GetWorld()->GetMapName(), EOnlineDataAdvertisementType::ViaPingOnly);
SessionSettings->bIsDedicated = true;
SessionSettings->bIsLANMatch = true;
SessionSettings->bUsesPresence = false;
SessionSettings->bAllowJoinViaPresence= false;
SessionSettings->bAllowJoinViaPresenceFriendsOnly = false;
SessionSettings->bShouldAdvertise = true;
SessionSettings->NumPrivateConnections = 10;
SessionSettings->NumPublicConnections = 10;
MaxPlayers = 20;
OnCreateSessionCompleteDelegateHandle = SessionInt->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);
SessionInt->CreateSession(0, NAME_GameSession, *SessionSettings);
}
}
}
PIE Client:
IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
if (Sessions.IsValid())
{
SessionSearch = MakeShareable(new FOnlineSessionSearch());
SessionSearch->bIsLanQuery = true;
SessionSearch->MaxSearchResults = 20;
SessionSearch->PingBucketSize = 50;
TSharedRef<FOnlineSessionSearch> SearchSettingsRef = SessionSearch.ToSharedRef();
OnFindSessionsCompleteDelegateHandle = Sessions->AddOnFindSessionsCompleteDelegate_Handle(OnFindSessionsCompleteDelegate);
Sessions->FindSessions(0, SearchSettingsRef);
}
}
else
{
OnFindSessionsComplete(false);
}
[OnlineSubsystem]
DefaultPlatformService=Null