How to get persistent sessions?

It happens that a player creates a session.
Then other players join that session.

So it happens that if the player who created the session leaves the game, the session is also destroyed for the rest of the players.

Any way to make this not happen?


It is the configuration of my session:

Server Travel:

UGameplayStatics::OpenLevel(world, LobbyMapName, true, “listen”);

Client Travel:

pc->ClientTravel(url, ETravelType::TRAVEL_Absolute);


I tried to use “Client travel” for both players, but the Lobby map does not open in this case.

I would like to destroy the session when the last player leaves the game


Thank you so much

GameInstance is used for persistance between levels.
I suggest GameDevTV’s Multiplayer C++ course, contains a lot of stuff arount this subject.

Yes, I know how GameInstace works… But it’s not the same. I’m talking about the session. I don’t know how to configure it so that no player has the server role. If the server destroys the session is Game Over for everyone… It’s a problem…
Cheers!!

The problem is that it is a listening server.

For it not to work in this way it is necessary to compile a separate dedicated server

So, it is not enough to set this property to true.

SessionSettings.bIsDedicated = true;

Here an example:

-Host Migration is the solution for listen servers
-Dedicated server has not this problem