Language:
Discover
By Skill Level
By Category

AGameNetworkManager

Choose your OS:

Inheritance Hierarchy

Syntax

class AGameNetworkManager : public AInfo

Remarks

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

Variables

Name Description

Public variable

int32

 

AdjustedNetSpeed

====================================================================================================================== Listen server dynamic netspeed adjustment Current adjusted net speed - Used for dynamically managing netspeed for listen servers

Public variable

int32

 

BadPingThreshold

The point we 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

====================================================================================================================== Standby cheat detection Used to determine if checking for standby cheats should occur

Public variable

bool

 

bMovementTimeDiscrepancyDetection

====================================================================================================================== Movement Time Discrepancy settings for Characters (speed hack detection and prevention) Whether movement time discrepancy 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 then he is authorative on his final position

Public variable

float

 

ClientErrorUpdateRateLimit

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

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 netspeed was updated for server (by client entering or leaving)

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 dynamically set per connection

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 dynamically set per connection

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

====================================================================================================================== Player replication 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

 

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 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 Turns standby detection on/off

Public function Virtual

bool

 

ExceedsAllowablePositionError

(
    FVector LocDiff
)

True if position error exceeds max allowable amount

Public function Virtual

bool

 

IsInLowBandwidthMode()

Returns true if we should be in low bandwidth mode

Public function Virtual

bool

 

NetworkVelocityNearZero

(
    FVector InVelocity
)

True if velocity vector passed in is considered near zero for networking purposes

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

bool

 

WithinUpdateDelayBounds

(
    APlayerController * PC,
    float LastUpdateTime
)

====================================================================================================================== Player replication

Overridden from AActor

Name Description

Public function Virtual

void

 

PostInitializeComponents()

Allow actors to initialize themselves on the C++ side

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/GameNetworkManager.h