For a listen server its trivial to create session via game logic following user input.
But on a dedicated server there is no user intervention once started so at what point create session is called and by what?
For a listen server its trivial to create session via game logic following user input.
But on a dedicated server there is no user intervention once started so at what point create session is called and by what?
For dedicated server there is a method for creating the session provided in the GameSession class:
void ASwatGameSession::RegisterServer()
{
TSharedPtr<const FUniqueNetId> UserId;
auto OnlineSubsystem = IOnlineSubsystem::Get();
if (OnlineSubsystem)
{
auto IdentityInterface = OnlineSubsystem->GetIdentityInterface();
if (IdentityInterface.IsValid())
{
UserId = IdentityInterface->GetUniquePlayerId(0);
}
}
CreateGameSession(UserId, SwatGameMode->GetClass(), GetWorld()->GetMapName());
}