AGameNetworkManager

Handles game-specific networking management (cheat detection, bandwidth management, etc.).

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/GameNetworkManager.h

Include

#include "GameFramework/GameNetworkManager.h"

Syntax

class AGameNetworkManager : public AInfo

Remarks

Handles game-specific networking management (cheat detection, bandwidth management, etc.).

Variables

Name Description

Public variable

int32

 

AdjustedNetSpeed

Current adjusted bandwidth per player, based on total and dynamic bandwidth

Public variable

float

 

BadPacketLossThreshold

If packet loss goes over this value, we have bad packet loss. Value is between 0 and 1.

Public variable

int32

 

BadPingThreshold

If average ping is higher than this threshold in ms, determine the server is either delaying packets or has bad upstream.

Public variable

uint32: 1

 

bHasStandbyCheatTriggered

Used to determine whether we've already caught a cheat or not

Public variable

uint32: 1

 

bIsStandbyCheckingEnabled

Used to determine if checking for standby cheats should occur

Public variable

bool

 

bMovementTimeDiscrepancyDetection

Whether movement time discrepancy (speed hack) detection is enabled.

Public variable

bool

 

bMovementTimeDiscrepancyForceCorrectionsDuringResolution

Whether client moves should be force corrected during time discrepancy resolution, useful for projects that have lenient move error tolerance/ClientAuthorativePosition enabled.

Public variable

bool

 

bMovementTimeDiscrepancyResolution

Whether movement time discrepancy resolution is enabled (when detected, make client movement "pay back" excessive time discrepancies)

Public variable

bool

 

bUseDistanceBasedRelevancy

If true, actor network relevancy is constrained by whether they are within their NetCullDistanceSquared from the client's view point.

Public variable

float

 

CLIENTADJUSTUPDATECOST

CLIENTADJUSTUPDATECOST is the bandwidth cost in bytes of sending a client adjustment update.

Public variable

bool

 

ClientAuthorativePosition

If client update is within MAXPOSITIONERRORSQUARED of what the server expects then the client is authoritative on it's final position

Public variable

float

 

ClientErrorUpdateRateLimit

Minimum delay between the server sending error corrections to a client, in seconds.

Public variable

float

 

ClientNetCamUpdateDeltaTime

Minimum delay between calls to ServerUpdateCamera, in seconds.

Public variable

float

 

ClientNetCamUpdatePositionLimit

Camera position change limit, when exceeded allows an immediate ServerUpdateCamera call.

Public variable

float

 

ClientNetSendMoveDeltaTime

ClientNetSendMoveDeltaTime is the default minimum time delta of CharacterMovement client moves to the server.

Public variable

float

 

ClientNetSendMoveDeltaTimeStationary

ClientNetSendMoveDeltaTimeStationary is used when players are determined to not be moving or changing their view.

Public variable

float

 

ClientNetSendMoveDeltaTimeThrottled

ClientNetSendMoveDeltaTimeThrottled is used in place of ClientNetSendMoveDeltaTime when player count is high or net speed is low.

Public variable

int32

 

ClientNetSendMoveThrottleAtNetSpeed

When player net speed (CurrentNetSpeed, based on ConfiguredInternetSpeed or ConfiguredLanSpeed) is less than or equal to this amount, ClientNetSendMoveDeltaTimeThrottled is used instead of ClientNetSendMoveDeltaTime.

Public variable

int32

 

ClientNetSendMoveThrottleOverPlayerCount

When player count is greater than this amount, ClientNetSendMoveDeltaTimeThrottled is used instead of ClientNetSendMoveDeltaTime.

Public variable

float

 

JoinInProgressStandbyWaitTime

The amount of time to wait before checking a connection for standby issues

Public variable

float

 

LastNetSpeedUpdateTime

Last time AdjustedNetSpeed was updated for server (by client entering or leaving)

Public variable

float

 

MaxClientForcedUpdateDuration

MaxClientForcedUpdateDuration is the maximum time duration over which the server will force updates, after MAXCLIENTUPDATEINTERVAL is initially exceeded.

Public variable

float

 

MaxClientSmoothingDeltaTime

MaxClientSmoothingDeltaTime is the maximum delta time between server updates that clients are allowed to smooth between for position interpolation.

Public variable

float

 

MAXCLIENTUPDATEINTERVAL

MAXCLIENTUPDATEINTERVAL is the maximum time between movement updates from the client before the server forces an update.

Public variable

int32

 

MaxDynamicBandwidth

Maximum bandwidth set per connection after splitting TotalNetBandwidth

Public variable

float

 

MaxMoveDeltaTime

MaxMoveDeltaTime is the default maximum time delta of CharacterMovement ServerMoves.

Public variable

float

 

MAXNEARZEROVELOCITYSQUARED

MAXNEARZEROVELOCITYSQUARED is the square of the max velocity that is considered zero (not corrected) in net play

Public variable

float

 

MAXPOSITIONERRORSQUARED

MAXPOSITIONERRORSQUARED is the square of the max position error that is accepted (not corrected) in net play

Public variable

int32

 

MinDynamicBandwidth

Minimum bandwidth set per connection after splitting TotalNetBandwidth

Public variable

float

 

MovementTimeDiscrepancyDriftAllowance

Accepted drift in clocks between client and server as a percent per second allowed.

Public variable

float

 

MovementTimeDiscrepancyMaxTimeMargin

Maximum time client can be ahead before triggering movement time discrepancy detection/resolution (if enabled).

Public variable

float

 

MovementTimeDiscrepancyMinTimeMargin

Maximum time client can be behind.

Public variable

float

 

MovementTimeDiscrepancyResolutionRate

During time discrepancy resolution, we "pay back" the time discrepancy at this rate for future moves until total error is zero.

Public variable

float

 

MoveRepSize

Average size of replicated move packet (ServerMove() packet size) from player

Public variable

float

 

PercentForBadPing

The percentage of clients with bad ping before triggering the standby code

Public variable

float

 

PercentMissingForRxStandby

The percentage of clients missing RX data before triggering the standby code

Public variable

float

 

PercentMissingForTxStandby

The percentage of clients missing TX data before triggering the standby code

Public variable

float

 

ServerForcedUpdateHitchCooldown

Ignore forced client movement updates when server hitch was detected within this amount of time in the past.

Public variable

float

 

ServerForcedUpdateHitchThreshold

Ignore forced client movement updates when server hitches for longer than this duration.

Public variable

float

 

SeverePacketLossThreshold

If the packet loss goes over this threshold, we have severe packet loss. Value is between 0 and 1

Public variable

int32

 

SeverePingThreshold

Similar to BadPingThreshold, but used to track exceptionally bad pings.

Public variable

float

 

StandbyRxCheatTime

The amount of time without packets before triggering the cheat code

Public variable

float

 

StandbyTxCheatTime

The amount of time without packets before triggering the cheat code

Protected variable

FTimerHandle

 

TimerHandle_UpdateNetSpeedsTimer

Handle for efficient management of UpdateNetSpeeds timer

Public variable

int32

 

TotalNetBandwidth

Total available bandwidth (in bytes/sec) for listen server, split dynamically across net connections

Constructors

Name Description

Public function

AGameNetworkManager

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual

int32

 

CalculatedNetSpeed()

New per/client bandwidth given number of players in the game

Public function Virtual

void

 

EnableStandbyCheatDetection

(
    bool bIsEnabled
)

Standby cheat detection.

Public function Virtual Const

bool

 

ExceedsAllowablePositionError

(
    FVector LocDiff
)

Public function Virtual

bool

 

IsInLowBandwidthMode()

Returns true if we should be in low bandwidth mode

Public function Virtual Const

bool

 

NetworkVelocityNearZero

(
    FVector InVelocity
)

Public function Virtual

void

 

StandbyCheatDetected

(
    EStandbyType StandbyType
)

Notifies the game code that a standby cheat was detected

Public function Virtual

void

 

UpdateNetSpeeds

(
    bool bIsLanMatch
)

Update network speeds for listen servers based on number of connected players.

Public function Virtual

void

 

UpdateNetSpeedsTimer()

Timer which calls UpdateNetSpeeds() once a second.

Public function Virtual Const

bool

 

WithinUpdateDelayBounds

(
    APlayerController* PC,
    float LastUpdateTime
)

Overridden from AActor

Name Description

Public function Virtual

void

 

PostInitializeComponents()

Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss