ServerTravelPause
ServerTravelPause
#Overview
name: ServerTravelPause
The value of this variable can be defined or overridden in .ini config files. 3
.ini config files referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ServerTravelPause is to control the amount of time a server will wait before traveling to the next map during server travel operations. This setting is primarily used in the networking and level transition systems of Unreal Engine.
ServerTravelPause is primarily used by the networking subsystem, specifically within the NetDriver and World modules. It’s also referenced in the OnlineSubsystemOculus plugin, indicating its relevance to online multiplayer scenarios, particularly those involving Oculus VR systems.
The value of this variable is set in the engine configuration files, as indicated by the UPROPERTY(Config) attribute in the UNetDriver class definition. It can be modified through project settings or configuration files.
ServerTravelPause interacts closely with the NextSwitchCountdown variable in the UWorld class. The NextSwitchCountdown is set to the value of ServerTravelPause when initiating a server travel operation.
Developers must be aware that this variable directly affects the timing of map transitions in multiplayer games. If set too low, clients might not have enough time to receive final RPCs (Remote Procedure Calls) on the existing level before the transition occurs. If set too high, it could lead to unnecessary delays in map transitions.
Best practices when using this variable include:
- Ensuring it’s set to a value that provides enough time for clients to receive final RPCs, typically a few seconds.
- Considering network conditions and the amount of data that needs to be synchronized before a map transition when setting this value.
- Testing thoroughly in various network conditions to ensure smooth transitions for all players.
- Being cautious when modifying this value, as it can impact the player experience and network synchronization.
- Documenting any custom values used in your project to maintain consistency across development and production environments.
In the Oculus-specific implementation, there’s a safeguard that sets the value to 4.0 seconds if it’s initially set to 0, suggesting that this might be a reasonable default for many scenarios.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:1639, section: [/Script/OnlineSubsystemUtils.IpNetDriver]
- INI Section:
/Script/OnlineSubsystemUtils.IpNetDriver
- Raw value:
4.0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:2266, section: [/Script/SteamSockets.SteamSocketsNetDriver]
- INI Section:
/Script/SteamSockets.SteamSocketsNetDriver
- Raw value:
4.0
- Is Array:
False
Location: <Workspace>/Engine/Plugins/Experimental/WebSocketNetworking/Config/BaseWebSocketNetDriver.ini:19, section: [/Script/WebSocketNetworking.WebSocketNetDriver]
- INI Section:
/Script/WebSocketNetworking.WebSocketNetDriver
- Raw value:
4.0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetDriver.cpp:76
Scope (from outer to inner):
file
function bool UOculusNetDriver::InitBase
Source code excerpt:
}
if (ServerTravelPause == 0.0)
{
UE_LOG(LogNet, Warning, TEXT("ServerTravelPause was set to %f"), ServerTravelPause);
ServerTravelPause = 4.0;
}
// Listen for network state
if (!NetworkingConnectionStateChangeDelegateHandle.IsValid())
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/NetDriver.h:878
Scope (from outer to inner):
file
class class UNetDriver : public UObject, public FExec
Source code excerpt:
/** Amount of time a server will wait before traveling to next map, gives clients time to receive final RPCs on existing level @see NextSwitchCountdown */
UPROPERTY(Config)
float ServerTravelPause;
/** @todo document */
UPROPERTY(Config)
float SpawnPrioritySeconds;
/** @todo document */
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/World.h:1727
Scope: file
Source code excerpt:
FVector OriginOffsetThisFrame;
/** Amount of time to wait before traveling to next map, gives clients time to receive final RPCs @see ServerTravelPause */
float NextSwitchCountdown;
/** All levels information from which our world is composed */
UPROPERTY()
TObjectPtr<class UWorldComposition> WorldComposition;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/World.cpp:6853
Scope (from outer to inner):
file
function bool UWorld::Listen
Source code excerpt:
}
NextSwitchCountdown = NetDriver->ServerTravelPause;
return true;
#else
return false;
#endif // WITH_SERVER_CODE
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/World.cpp:7433
Scope (from outer to inner):
file
function void FSeamlessTravelHandler::CopyWorldData
Source code excerpt:
if (NetDriver != nullptr)
{
LoadedWorld->NextSwitchCountdown = NetDriver->ServerTravelPause;
}
}
/**
* Version of FArchiveReplaceObjectRef that will also clear references to garbage objects not in the replacement map
* This does not try to recursively serialize subobjects because it was unreliable and missed ones without hard parent references