RealDocs

AGameModeBase::GetGameNetDriverReplicationSystem

function Engine Since unknown
#include "GameFramework/GameModeBase.h"
Access: public Specifiers: const

Description

Returns the replication system this GameMode requests for the GameNetDriver. Queried during net driver initialization to choose between the legacy replication system and Iris.

Caveats & Gotchas

  • This is a simple inline getter. To change which replication system is used, set the GameNetDriverReplicationSystem UPROPERTY (Config/EditAnywhere) in your GameMode subclass or its INI config — do not override this function unless you need runtime-dynamic selection.
  • The replication system is selected once when the NetDriver is created. Changing the underlying property after the session has started has no effect on the running driver.

Signature

EReplicationSystem GetGameNetDriverReplicationSystem() const { return GameNetDriverReplicationSystem; }

Return Type

EReplicationSystem

Example

Log the configured replication system at game start C++
void AMyGameMode::BeginPlay()
{
	Super::BeginPlay();
	EReplicationSystem RepSystem = GetGameNetDriverReplicationSystem();
	UE_LOG(LogGame, Log, TEXT("Replication system: %d"), (int32)RepSystem);
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.