Hello, I’m making a Multiplay FPS.
Now, I made session creating system in dedicated server with Online Subsystem NULL in C++.
It returns Success callback. But odd thing is that the OnCreateSessionComplete() function as callback returned before finishing CreateSession() functino.
void USessionManager::CreateSession()
{
if (SessionPtr.IsValid())
{
// Define Session settings here
FOnlineSessionSettings SessionSettings;
SessionSettings.NumPrivateConnections = 10;
SessionSettings.NumPublicConnections = 10;
SessionSettings.bAllowInvites = true;
SessionSettings.bAllowJoinInProgress = true;
SessionSettings.bAllowJoinViaPresence = true;
SessionSettings.bAllowJoinViaPresenceFriendsOnly = true;
SessionSettings.bIsDedicated = false;
SessionSettings.bUsesPresence = true;
SessionSettings.bIsLANMatch = true;
SessionSettings.bShouldAdvertise = true;
FName SessionName = "DedicatedServerSession";
// Bind to success delegate
SessionPtr->OnCreateSessionCompleteDelegates.AddUObject(this, &USessionManager::OnCreateSessionComplete);
// Create session
SessionPtr->CreateSession(0, SessionName, SessionSettings);
UE_LOG(LogTemp, Warning, TEXT("Successfully Requested to create session"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Failed to Request to create session"));
}
}
void USessionManager::OnCreateSessionComplete(FName SessionName, bool Successful)
{
if (Successful)
{
UE_LOG(LogTemp, Warning, TEXT("Session created successfully"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Session created failed"));
}
}
The output log is,
[2023.05.30-15.08.38:972][ 37]LogTemp: Warning: Session created successfully
[2023.05.30-15.08.38:972][ 37]LogTemp: Warning: Successfully Requested to create session
I also tried to find and join session as client from some PC. Find session return a session that I created with little delay but Join session result is odd too.
When I Join to the session, success callback returns immediately and map won’t transit to server default map.
There is no join related message log of dedicated server instance.
Thank you in advance!