Hello,
Im using for my dedicated server an c++ setup to create a non-presence session.
This session can be found in the client but also on the master server.
When I join on the server … The current players doesn’t get updated.
So here is the c++ where the server gets created:
void AMyGameSession::RegisterServer()
{
IOnlineSubsystem* const OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
if (Sessions.IsValid())
{
ASetupGamemode* MyGM = Cast<ASetupGamemode>(GetWorld()->GetAuthGameMode());
if (MyGM)
{
UE_LOG(LogTemp, Warning, TEXT("Creating Session."));
Sessions->GameServerName = FString("The Lost Island - Dedicated Server");
HostSettings = MakeShareable(new FOnlineSessionSettings());
HostSettings->Set(SETTING_GAMEMODE, FString("Survival"), EOnlineDataAdvertisementType::ViaOnlineService);
HostSettings->Set(SETTING_MAPNAME, FString("MP_Game"), EOnlineDataAdvertisementType::ViaOnlineService);
HostSettings->bAntiCheatProtected = true;
HostSettings->bUsesPresence = false;
HostSettings->bIsLANMatch = false;
HostSettings->bIsDedicated = true;
HostSettings->bShouldAdvertise = true;
HostSettings->bAllowJoinInProgress = true;
HostSettings->NumPublicConnections = 12;
HostSettings->bUsesStats = true;
HostSettings->bAllowInvites = true;
Sessions->CreateSession(0, GameSessionName, *HostSettings);
}
}
}
}
Cheers,
Bander