found.
void UEngine::HandleDisconnect( UWorld *InWorld, UNetDriver *NetDriver )
{
// There must be some context for this disconnect
check(InWorld || NetDriver);
// InWorld might be null. It might also not map to any valid world context (for example, a pending net game disconnect)
// If there is a context for this world, setup client travel.
if (FWorldContext* WorldContext = GetWorldContextFromWorld(InWorld))
{
// Remove ?Listen parameter, if it exists
WorldContext->LastURL.RemoveOption( TEXT("Listen") );
WorldContext->LastURL.RemoveOption( TEXT("LAN") );
// Net driver destruction will occur during LoadMap (prevents GetNetMode from changing output for the remainder of the frame)
// The ?closed option will also make sure any PendingNetGame is cancelled in Browse
SetClientTravel( InWorld, TEXT("?closed"), TRAVEL_Absolute );
}
else if (NetDriver)
{
// If the NetDriver that failed was a pending netgame driver, cancel the PendingNetGame
CancelPending(NetDriver);
// Shut down any existing game connections
if (InWorld)
{
// Call this to remove the NetDriver from the world context's ActiveNetDriver list
DestroyNamedNetDriver(InWorld, NetDriver->NetDriverName);
}
else
{
NetDriver->Shutdown();
NetDriver->LowLevelDestroy();
// In this case, the world is null and something went wrong, so we should travel back to the default world so that we
// can get back to a good state.
for (FWorldContext& PotentialWorldContext : WorldList)
{
if (PotentialWorldContext.WorldType == EWorldType::Game)
{
FURL DefaultURL;
DefaultURL.LoadURLConfig(TEXT("DefaultPlayer"), GGameIni);
const UGameMapsSettings* GameMapsSettings = GetDefault<UGameMapsSettings>();
if (GameMapsSettings)
{
PotentialWorldContext.TravelURL = FURL(&DefaultURL, *(GameMapsSettings->GetGameDefaultMap() + GameMapsSettings->LocalMapOptions), TRAVEL_Partial).ToString();
PotentialWorldContext.TravelType = TRAVEL_Partial;
}
}
}
}
}
}
You need to change this function has you need.
Mostly this line
PotentialWorldContext.TravelURL = FURL(&DefaultURL, *(GameMapsSettings->GetGameDefaultMap() + GameMapsSettings->LocalMapOptions), TRAVEL_Partial).ToString();
Require to build yourself the engine by the way.