PlayerState gets removed and Hosting / Joining session fails

From ShooterGame example, placing a level that the player and player controller are in between the front end menu and the map that the player travels to from hosting a session, causes the player state to be nuked or replaced, and causes issues with Hosting and Joining the session.

Even if the interim level overrides the player controller class and the game mode, this still occurs.

The interim level is loaded via a URL browse:
GetEngine()->Browse

Then the player chooses to host a session and it ‘seems’ to work and the player travels to the host map.

When the other player travels to the interim level, and tries to ‘search’ for a hosted game, the session appears but the number of players shows as 0 ( zero ), even though the host is hosting it.

When the joining player joins that session, he fails to load into the level ( becomes stuck in the loading screen ).

The player state for the host becomes corrupt or deleted when they host a short time after entering the level. It seems to have something to do with trying to persist the player state from the last level.

Question: How can a session be cleanly hosted from an interim level in which a player pawn and controller exist, ,and not corrupt the player state of the player or non-player pawns, and how can the session be hosted and joined successfully?

So the sequence of events is:

  • Player lands at menu ( and is player controller menu )
  • Player is browsed to another level where the game mode is different and the player has a controller and pawn so they can walk around and do things
  • Player hosts a session, and travels to that session…the game mode is different in the new session. The player controller and pawn class are the same
  • After a couple seconds, the player states are wiped on the server in the hosted map
  • Another client, when trying to join the session of the first, will see the session listed, but it will say ‘0’ ( zero ) players active in the hosted session

Here is the fix.
In your Game Mode for your player base / interim level / player housing whatever it is…

Set this to false in the class constructor.
bUseSeamlessTravel = false;