Holds the packet simulation settings in one place 更多...
#include <NetDriver.h>
Public 成员函数 | |
| void | ApplySettings (const FPacketSimulationSettings &NewSettings) |
| Force new emulation settings and ignore config or cmdline values | |
| void | LoadConfig (const TCHAR *OptionalQualifier=nullptr) |
| reads in settings from the .ini file 更多... | |
| bool | LoadEmulationProfile (const TCHAR *ProfileName) |
| Load a preconfigured emulation profile from the .ini Returns true if the given profile existed | |
| bool | ParseSettings (const TCHAR *Stream, const TCHAR *OptionalQualifier=nullptr) |
| Reads the settings from a string: command line or an exec 更多... | |
| bool | ShouldDropPacketOfSize (int32 NumBits) const |
| Tells if a packet fits the size settings to potentially be dropped | |
| void | ValidateSettings () |
| Ensure that settings have proper values | |
Public 属性 | |
| int32 | PktDup = 0 |
| When set, will cause calls to FlushNet to duplicate packets. 更多... | |
| int32 | PktIncomingLagMax = 0 |
| The maximum delay in milliseconds to add to incoming packets before they are processed. | |
| int32 | PktIncomingLagMin = 0 |
| Set a value to add a minimum delay in milliseconds to incoming packets before they are processed. | |
| int32 | PktIncomingLoss = 0 |
| The ratio of incoming packets that will be dropped to simulate packet loss | |
| int32 | 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 | PktLag = 0 |
| When set, will cause calls to FlushNet to delay packets. 更多... | |
| int32 | PktLagMin = 0 |
| If set lag values will randomly fluctuate between Min and Max. 更多... | |
| int32 | PktLagVariance = 0 |
| When set, will cause PktLag to use variable lag instead of constant. 更多... | |
| int32 | PktLoss = 0 |
| When set, will cause calls to FlushNet to drop packets. 更多... | |
| int32 | PktLossMaxSize = 0 |
| Sets the maximum size of packets in bytes that will be dropped according to the PktLoss setting. 更多... | |
| int32 | PktLossMinSize = 0 |
| Sets the minimum size of packets in bytes that will be dropped according to the PktLoss setting. 更多... | |
| int32 | PktOrder = 0 |
| When set, will cause calls to FlushNet to change ordering of packets at random. 更多... | |
Holds the packet simulation settings in one place
| void FPacketSimulationSettings::LoadConfig | ( | const TCHAR * | OptionalQualifier = nullptr | ) |
reads in settings from the .ini file
| bool FPacketSimulationSettings::ParseSettings | ( | const TCHAR * | Stream, |
| 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" |
| 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::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::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.