Server Travel: How To Travel To New Game Mode

Hi.

So I’m having a bit of trouble with server travel. I’ve just got lobby set up and working and I’m trying to start a game. I’ve got map to load using 1 of 2 lines of code on the server:

GetWorld()->ServerTravel( Url.ToString(), true, false ); // absolute travel

This loads the level with a new game mode, player state, etc. but disconnects all clients. The client doesn’t even really disconnect, it sits in the lobby for a minute before timing out. It does not load the new map.

The log prints out this on the server:

[2016.02.02-11.06.44:625][900]LogGameMode: ProcessServerTravel: /Game/Maps/MP/BC-Kepler311?bIsLanMatch
[2016.02.02-11.06.44:669][903]LogNet: UChannel::ReceivedSequencedBunch: Bunch.bClose == true. ChIndex == 0. Calling ConditionalCleanUp.
[2016.02.02-11.06.44:670][903]LogNet: UChannel::CleanUp: [GameNetDriver] [BCLobbyMenuPlayerController_1] [BCLobbyMenuPlayerController_1]. ChIndex == 0. Closing connection.
[2016.02.02-11.06.44:670][903]LogNet: UNetConnection::Close: Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_0, PC: BCLobbyMenuPlayerController_1, Owner: BCLobbyMenuPlayerController_1, Channels: 9, RemoteAddr: 192.168.1.3:60629, Time: 2016.02.02-11.06.44
[2016.02.02-11.06.44:670][903]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: ControlChannel_0
[2016.02.02-11.06.48:623][148]LogEngine: Server switch level: /Game/Maps/MP/BC-Kepler311?bIsLanMatch
[2016.02.02-11.06.48:623][148]LogNet: Browse: /Game/Maps/MP/BC-Kepler311?bIsLanMatch
[2016.02.02-11.06.48:624][148]LogLoad: LoadMap: /Game/Maps/MP/BC-Kepler311?bIsLanMatch
[2016.02.02-11.06.48:624][148]LogNet: World NetDriver shutdown IpNetDriver_0 [GameNetDriver]
[2016.02.02-11.06.48:624][148]LogNet: DestroyNamedNetDriver IpNetDriver_0 [GameNetDriver]
[2016.02.02-11.06.48:624][148]LogExit: GameNetDriver IpNetDriver_0 shut down
*normal map load text*

And this on the client:

[2016.02.02-11.06.44:656][142]LogNet: Browse: 192.168.1.3//Game/Maps/MP/BC-Kepler311?game=/Script/Barrage.BCLobbyMenuGameMode?bIsLanMatch
[2016.02.02-11.06.44:656][142]LogNet: World NetDriver shutdown IpNetDriver_0 [GameNetDriver]
[2016.02.02-11.06.44:656][142]LogNet: DestroyNamedNetDriver IpNetDriver_0 [GameNetDriver]
[2016.02.02-11.06.44:657][142]LogNet: UNetConnection::Close: Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_0, PC: BCLobbyMenuPlayerController_0, Owner: BCLobbyMenuPlayerController_0, Channels: 9, RemoteAddr: 192.168.1.3:7777, Time: 2016.02.02-11.06.44
[2016.02.02-11.06.44:657][142]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: ControlChannel_0
[2016.02.02-11.06.44:657][142]LogExit: GameNetDriver IpNetDriver_0 shut down
[2016.02.02-11.06.44:657][142]LogOnline:Warning: STEAM: Steam API disabled!
[2016.02.02-11.06.44:658][142]LogOnline:Display: STEAM: OnlineSubsystemSteam::Shutdown()
[2016.02.02-11.06.44:658][142]LogOnline:Warning: Unable to create OnlineSubsystem module STEAM
[2016.02.02-11.06.44:658][142]LogInit: WinSock: Socket queue 32768 / 32768
[2016.02.02-11.06.44:659][142]LogNet: Game client on port 7777, rate 10000
[2016.02.02-11.06.44:659][142]LogNet: GetLocalNetworkVersion: GEngineNetVersion: 0, ProjectName: barrage, ProjectVersion: 1.0.0.0, InternalProtocolVersion: 8, LocalNetworkVersion: 1091959075
[2016.02.02-11.07.44:686][357]LogNet:Warning: UNetConnection::Tick: Connection TIMED OUT. Closing connection. Driver: IpNetDriver_1, Elapsed: 60.029766, Threshold: 60.000000, RemoteAddr: 192.168.1.3:7777, PC: NoPC, Owner: No Owner
[2016.02.02-11.07.44:686][357]LogNet:Warning: Network Failure: PendingNetDriver[ConnectionTimeout]: UNetConnection::Tick: Connection TIMED OUT. Closing connection. Driver: IpNetDriver_1, Elapsed: 60.029766, Threshold: 60.000000, RemoteAddr: 192.168.1.3:7777, PC: NoPC, Owner: No Owner
[2016.02.02-11.07.44:687][357]LogNet: NetworkFailure: ConnectionTimeout, Error: 'UNetConnection::Tick: Connection TIMED OUT. Closing connection. Driver: IpNetDriver_1, Elapsed: 60.029766, Threshold: 60.000000, RemoteAddr: 192.168.1.3:7777, PC: NoPC, Owner: No Owner'
[2016.02.02-11.07.44:687][357]LogNet: UNetConnection::Close: Name: IpConnection_1, Driver: PendingNetDriver IpNetDriver_1, PC: NULL, Owner: NULL, Channels: 2, RemoteAddr: 192.168.1.3:7777, Time: 2016.02.02-11.07.44
[2016.02.02-11.07.44:688][357]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: ControlChannel_1
[2016.02.02-11.07.44:688][357]LogNet: DestroyNamedNetDriver IpNetDriver_1 [PendingNetDriver]
[2016.02.02-11.07.44:688][357]LogExit: PendingNetDriver IpNetDriver_1 shut down
[2016.02.02-11.07.44:717][358]LogNet: Browse: /Game/Maps/MainMenu/menu?closed
[2016.02.02-11.07.44:717][358]LogNet: Failed; returning to Entry
[2016.02.02-11.07.44:742][358]LogLoad: LoadMap: /Game/Maps/MainMenu/menu?closed
*normal map load* (of main menu after time out.)

However, when I use this line of code:

GetWorld()->ServerTravel( Url.ToString(), false, false ); // relative travel

It all works fine - but, the game mode, player controllers, etc. are not updated to the correct ones for the level. They are the ones from the lobby.

Is there a way to either:

a) Stop the client disconnecting for random reason when using absolute travel; or,

b) Make relative travel create a new game mode, player controllers, etc. ?

Thanks.

Turns out I just needed to specify the game mode in the url by doing:

Url->AddOption( TEXT( "Game=/Script/Barrage/gamemodehere" ) );

when using relative travel.