![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <NetDriver.h>
Public Member Functions | |
| ENGINE_API void | LoadConfig (const TCHAR *OptionalQualifier=nullptr) |
| ENGINE_API bool | LoadEmulationProfile (const TCHAR *ProfileName) |
| ENGINE_API void | ApplySettings (const FPacketSimulationSettings &NewSettings) |
| ENGINE_API void | ValidateSettings () |
| ENGINE_API void | ResetSettings () |
| bool | ShouldDropPacketOfSize (int32 NumBits) const |
| ENGINE_API bool | ParseSettings (const TCHAR *Stream, const TCHAR *OptionalQualifier=nullptr) |
| ENGINE_API bool | ParseHelper (const TCHAR *Cmd, const TCHAR *Name, int32 &Value, const TCHAR *OptionalQualifier) |
| ENGINE_API bool | ConfigHelperInt (const TCHAR *Name, int32 &Value, const TCHAR *OptionalQualifier) |
| ENGINE_API bool | ConfigHelperBool (const TCHAR *Name, bool &Value, const TCHAR *OptionalQualifier) |
Public Attributes | |
| int32 | PktLoss = 0 |
| int32 | PktLossMaxSize = 0 |
| int32 | PktLossMinSize = 0 |
| int32 | PktOrder = 0 |
| int32 | PktDup = 0 |
| int32 | PktLag = 0 |
| int32 | PktLagVariance = 0 |
| int32 | PktLagMin = 0 |
| int32 | PktLagMax = 0 |
| int32 | PktIncomingLagMin = 0 |
| int32 | PktIncomingLagMax = 0 |
| int32 | PktIncomingLoss = 0 |
| int32 | PktJitter = 0 |
| int32 | PktFrameDelay = 0 |
| int32 | PktIncomingFrameDelay = 0 |
| int32 | PktBufferBloatInMS = 0 |
| int32 | PktIncomingBufferBloatInMS = 0 |
Holds the packet simulation settings in one place
| ENGINE_API void FPacketSimulationSettings::ApplySettings | ( | const FPacketSimulationSettings & | NewSettings | ) |
Force new emulation settings and ignore config or cmdline values
| bool FPacketSimulationSettings::ConfigHelperBool | ( | const TCHAR * | Name, |
| bool & | Value, | ||
| const TCHAR * | OptionalQualifier | ||
| ) |
| bool FPacketSimulationSettings::ConfigHelperInt | ( | const TCHAR * | Name, |
| int32 & | Value, | ||
| const TCHAR * | OptionalQualifier | ||
| ) |
reads in settings from the .ini file
Load a preconfigured emulation profile from the .ini Returns true if the given profile existed
| bool FPacketSimulationSettings::ParseHelper | ( | const TCHAR * | Cmd, |
| const TCHAR * | Name, | ||
| int32 & | Value, | ||
| const TCHAR * | OptionalQualifier | ||
| ) |
| bool FPacketSimulationSettings::ParseSettings | ( | const TCHAR * | Cmd, |
| const TCHAR * | OptionalQualifier = nullptr |
||
| ) |
Reads the settings from a string: command line or an exec
| Stream | the string to read the settings from @Param OptionalQualifier: optional string to prepend to Pkt* settings. E.g, "GameNetDriverPktLoss=50" |
Reads the settings from a string: command line or an exec
| Stream | the string to read the settings from |
| void FPacketSimulationSettings::ResetSettings | ( | ) |
Tells if a packet fits the size settings to potentially be dropped
| void FPacketSimulationSettings::ValidateSettings | ( | ) |
Ensure that settings have proper values
| int32 FPacketSimulationSettings::PktBufferBloatInMS = 0 |
Time in milliseconds during which outgoing packets will get delayed before being sent all at once.
| int32 FPacketSimulationSettings::PktDup = 0 |
When set, will cause calls to FlushNet to duplicate packets. Value is treated as % of packets duplicated (i.e. 0 = None, 100 = All). No general pattern / ordering is guaranteed. Clamped between 0 and 100.
Cannot be used with PktOrder or PktLag.
| int32 FPacketSimulationSettings::PktFrameDelay = 0 |
Delays sending packets for a specific number of ticks
| int32 FPacketSimulationSettings::PktIncomingBufferBloatInMS = 0 |
Time in milliseconds during which incoming packets will get delayed before being processed all at once.
| int32 FPacketSimulationSettings::PktIncomingFrameDelay = 0 |
Delays processing received packets for a specific number of ticks
| int32 FPacketSimulationSettings::PktIncomingLagMax = 0 |
The maximum delay in milliseconds to add to incoming packets before they are processed.
| int32 FPacketSimulationSettings::PktIncomingLagMin = 0 |
Set a value to add a minimum delay in milliseconds to incoming packets before they are processed.
| int32 FPacketSimulationSettings::PktIncomingLoss = 0 |
The ratio of incoming packets that will be dropped to simulate packet loss
| int32 FPacketSimulationSettings::PktJitter = 0 |
Causes sent packets to have a variable latency that fluctuates from [PktLagMin] to [PktLagMin+PktJitter] Note that this will cause packet loss on the receiving end.
| int32 FPacketSimulationSettings::PktLag = 0 |
When set, will cause calls to FlushNet to delay packets. Value is treated as millisecond lag.
Cannot be used with PktOrder.
| int32 FPacketSimulationSettings::PktLagMax = 0 |
| int32 FPacketSimulationSettings::PktLagMin = 0 |
If set lag values will randomly fluctuate between Min and Max. Ignored if PktLag value is set
| int32 FPacketSimulationSettings::PktLagVariance = 0 |
When set, will cause PktLag to use variable lag instead of constant. Value is treated as millisecond lag range (e.g. -GivenVariance <= 0 <= GivenVariance).
Can only be used when PktLag is enabled.
| int32 FPacketSimulationSettings::PktLoss = 0 |
When set, will cause calls to FlushNet to drop packets. Value is treated as % of packets dropped (i.e. 0 = None, 100 = All). No general pattern / ordering is guaranteed. Clamped between 0 and 100.
Works with all other settings.
| int32 FPacketSimulationSettings::PktLossMaxSize = 0 |
Sets the maximum size of packets in bytes that will be dropped according to the PktLoss setting. Default is INT_MAX.
Works with all other settings.
| int32 FPacketSimulationSettings::PktLossMinSize = 0 |
Sets the minimum size of packets in bytes that will be dropped according to the PktLoss setting. Default is 0.
Works with all other settings.
| int32 FPacketSimulationSettings::PktOrder = 0 |
When set, will cause calls to FlushNet to change ordering of packets at random. Value is treated as a bool (i.e. 0 = False, anything else = True). This works by randomly selecting packets to be delayed until a subsequent call to FlushNet.
Takes precedence over PktDup and PktLag.