UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ReplicationDriver.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
25#pragma once
26
27#include "Delegates/Delegate.h"
28#include "Engine/EngineTypes.h"
29#include "UObject/Object.h"
32
33#include "ReplicationDriver.generated.h"
34
35class AActor;
36class UActorChannel;
37class UNetConnection;
38class UNetDriver;
40class UWorld;
41
43struct FURL;
44
46
47UCLASS(abstract, transient, config=Engine, MinimalAPI)
49{
51
52public:
53
55
57 static ENGINE_API UReplicationDriver* CreateReplicationDriver(UNetDriver* NetDriver, const FURL& URL, UWorld* World);
58
60 static ENGINE_API FCreateReplicationDriver& CreateReplicationDriverDelegate();
61
62 // -----------------------------------------------------------------------
63
65 virtual void SetRepDriverWorld(UWorld* InWorld) PURE_VIRTUAL(UReplicationDriver::SetRepDriverWorld, );
66
68 virtual void InitForNetDriver(UNetDriver* InNetDriver) PURE_VIRTUAL(UReplicationDriver::InitForNetDriver, );
69
71 virtual void InitializeActorsInWorld(UWorld* InWorld) PURE_VIRTUAL(UReplicationDriver::InitializeActorsInWorld, );
72
73 virtual void TearDown() { MarkAsGarbage(); }
74
75 virtual void ResetGameWorldState() PURE_VIRTUAL(UReplicationDriver::ResetGameWorldState, );
76
77 virtual void AddClientConnection(UNetConnection* NetConnection) PURE_VIRTUAL(UReplicationDriver::AddClientConnection, );
78
79 virtual void RemoveClientConnection(UNetConnection* NetConnection) PURE_VIRTUAL(UReplicationDriver::RemoveClientConnection, );
80
81 virtual void AddNetworkActor(AActor* Actor) PURE_VIRTUAL(UReplicationDriver::AddNetworkActor, );
82
83 virtual void RemoveNetworkActor(AActor* Actor) PURE_VIRTUAL(UReplicationDriver::RemoveNetworkActor, );
84
85 virtual void ForceNetUpdate(AActor* Actor) PURE_VIRTUAL(UReplicationDriver::ForceNetUpdate, );
86
87 virtual void FlushNetDormancy(AActor* Actor, bool WasDormInitial) PURE_VIRTUAL(UReplicationDriver::FlushNetDormancy, );
88
89 virtual void NotifyActorTearOff(AActor* Actor) PURE_VIRTUAL(UReplicationDriver::NotifyActorTearOff, );
90
91 virtual void NotifyActorFullyDormantForConnection(AActor* Actor, UNetConnection* Connection) PURE_VIRTUAL(UReplicationDriver::NotifyActorFullyDormantForConnection, );
92
93 virtual void NotifyActorDormancyChange(AActor* Actor, ENetDormancy OldDormancyState) PURE_VIRTUAL(UReplicationDriver::NotifyActorDormancyChange, );
94
97
99 virtual void NotifyActorRenamed(AActor* Actor, UObject* PreviousOuter, FName PreviousName) PURE_VIRTUAL(UReplicationDriver::NotifyActorRenamed, );
100
101 virtual void SetRoleSwapOnReplicate(AActor* Actor, bool bSwapRoles) PURE_VIRTUAL(UReplicationDriver::SetRoleSwapOnReplicate, );
102
104 virtual bool ProcessRemoteFunction(class AActor* Actor, UFunction* Function, void* Parameters, FOutParmRec* OutParms, FFrame* Stack, UObject* SubObject ) { return false; }
105
108
110 virtual void PostTickDispatch() { }
111};
112
114UCLASS(abstract, transient, MinimalAPI)
116{
118
119public:
120
121 virtual void NotifyActorChannelAdded(AActor* Actor, UActorChannel* Channel) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyActorChannelAdded, );
122
123 virtual void NotifyActorChannelRemoved(AActor* Actor) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyActorChannelRemoved, );
124
125 virtual void NotifyActorChannelCleanedUp(UActorChannel* Channel) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyActorChannelCleanedUp, );
126
127 virtual void NotifyAddDestructionInfo(FActorDestructionInfo* DestructInfo) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyAddDestructionInfo, );
128
129 virtual void NotifyAddDormantDestructionInfo(AActor* Actor) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyAddDormantDestructionInfo, );
130
131 virtual void NotifyRemoveDestructionInfo(FActorDestructionInfo* DestructInfo) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyRemoveDestructionInfo, );
132
133 virtual void NotifyResetDestructionInfo() PURE_VIRTUAL(UReplicationConnectionDriver::NotifyResetDestructionInfo, );
134
135 virtual void NotifyClientVisibleLevelNamesAdd(FName LevelName, UWorld* StreamingWorld) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyClientVisibleLevelNamesAdd, );
136
137 virtual void NotifyClientVisibleLevelNamesRemove(FName LevelName) PURE_VIRTUAL(UReplicationConnectionDriver::NotifyClientVisibleLevelNamesRemove, );
138
139 virtual void TearDown() { MarkAsGarbage(); }
140};
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE_RetVal_ThreeParams(ReturnValueType, DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:72
ENetDormancy
Definition EngineTypes.h:3361
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition Actor.h:257
Definition Engine.Build.cs:7
Definition NameTypes.h:617
Definition ActorChannel.h:78
Definition Class.h:2476
Definition NetConnection.h:284
Definition NetDriver.h:799
Definition Object.h:95
Definition ReplicationDriver.h:116
virtual void virtual NotifyActorChannelAdded(AActor *Actor, UActorChannel *Channel) PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyActorChannelRemoved(AActor *Actor) PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyActorChannelCleanedUp(UActorChannel *Channel) PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyAddDestructionInfo(FActorDestructionInfo *DestructInfo) PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyAddDormantDestructionInfo(AActor *Actor) PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyRemoveDestructionInfo(FActorDestructionInfo *DestructInfo) PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyResetDestructionInfo() PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyClientVisibleLevelNamesAdd(FName LevelName, UWorld *StreamingWorld) PURE_VIRTUAL(UReplicationConnectionDriver void virtual NotifyClientVisibleLevelNamesRemove(FName LevelName) PURE_VIRTUAL(UReplicationConnectionDriver voi TearDown)()
Definition ReplicationDriver.h:139
Definition ReplicationDriver.h:49
virtual void PostTickDispatch()
Definition ReplicationDriver.h:110
virtual void virtual SetRepDriverWorld(UWorld *InWorld) PURE_VIRTUAL(UReplicationDriver void virtual InitForNetDriver(UNetDriver *InNetDriver) PURE_VIRTUAL(UReplicationDriver void virtual InitializeActorsInWorld(UWorld *InWorld) PURE_VIRTUAL(UReplicationDriver voi TearDown)()
Definition ReplicationDriver.h:73
virtual int32 ServerReplicateActors(float DeltaSeconds) PURE_VIRTUAL(UReplicationDriver
Definition ReplicationDriver.h:107
Definition World.h:918
Definition NetDriver.h:630
Definition Stack.h:114
Definition Stack.h:103
Definition EngineBaseTypes.h:799