Navigation
API > API/Runtime > API/Runtime/IrisCore > API/Runtime/IrisCore/Iris > API/Runtime/IrisCore/Iris/ReplicationSystem
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UReplicationBridge
- UObjectReplicationBridge
- UActorReplicationBridge
References
| Module | IrisCore |
| Header | /Engine/Source/Runtime/Experimental/Iris/Core/Public/Iris/ReplicationSystem/ObjectReplicationBridge.h |
| Include | #include "Iris/ReplicationSystem/ObjectReplicationBridge.h" |
Syntax
UCLASS (Transient, MinimalAPI)
class UObjectReplicationBridge : public UReplicationBridge
Remarks
Partial implementation of ReplicationBridge that can be used as a foundation for implementing support for replicating objects derived from UObject
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bSuppressCreateInstanceFailedEnsure |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddDependentObject
(
FNetRefHandle Parent, |
Adds a dependent object. | |
| void | AddStaticDestructionInfo
(
const FString& ObjectPath, |
Add static destruction info, this is used when stably named objects are destroyed prior to starting replication | |
| FObjectReplicationBridgeInstantiateResult | BeginInstantiateFromRemote
(
FNetRefHandle RootObjectOfSubObject, |
Called when we instantiate/find object instance requested by remote. | |
| FNetRefHandle | BeginReplication
(
FNetRefHandle OwnerHandle, |
Begin replicating the Instance as a subobject of the OwnerHandle. | |
| FNetRefHandle | BeginReplication
(
FNetRefHandle OwnerHandle, |
Create handle and start replicating the Instance as a SubObject of the OwnerHandle. | |
| FNetRefHandle | BeginReplication
(
UObject* Instance, |
Begin replicating the Instance and return a valid NetRefHandle for the Instance if successful. | |
| uint8 | ConvertPollFrequencyIntoFrames
(
float PollFrequency |
Transform a poll frequency (in updates per second) to an equivalent number of frames. | |
| FString | DescribeObjectReference
(
const UE::Net::FNetObjectReference& ObjectRef, |
Describe the NetObjectReference | |
| void | DestroyInstanceFromRemote
(
const FDestroyInstanceParams& Params |
Destroy or tear-off the game instance on request from remote. | |
| void | EndInstantiateFromRemote
(
FNetRefHandle Handle |
Invoked after remote NetHandle has been created and initial state is applied. | |
| void | EndReplication
(
FNetRefHandle Handle, |
Stop replicating the NetObject associated with the handle and mark the handle to be destroyed. | |
| void | EndReplication
(
UObject* Instance, |
Stop replicating the object. | |
| TArray< uint32 > | FindConnectionsFromArgs
(
const TArray< FString >& Args |
Parses a list of arguments and returns a list of Connection's that match them Ex: ConnectionId=1 or ConnectionId=1,5,7 | |
| bool | FindOrCachePollFrequency
(
const UClass* Class, |
Finds the final poll frequency for a class and cache it for future lookups. | |
| void | ForceUpdateWantsToBeDormantObject
(
FNetRefHandle Handle |
Trigger replication of dirty state for object wanting to be dormant. | |
| bool | GetClassPollFrequency
(
const UClass* Class, |
Find the poll period of a class if it was configured with an override. | |
| UE::Net::FNetObjectFilterHandle | GetDynamicFilter
(
const UClass* Class, |
Retrieves the dynamic filter to set for the given class. | |
| float | Current max tick rate set by the engine | ||
| UObject * | GetObjectFromReferenceHandle
(
FNetRefHandle RefHandle |
Lookup the UObject associated with the provided Handle. | |
| bool | GetObjectWantsToBeDormant
(
FNetRefHandle Handle |
Returns whether the object wants to be dormant. | |
| UE::Net::FNetObjectReference | GetOrCreateObjectReference
(
const UObject* Instance |
Get or create NetObjectReference for object instance. | |
| UE::Net::FNetObjectReference | GetOrCreateObjectReference
(
const FString& Path, |
Get or create NetObjectReference for object identified by path relative to outer. | |
| float | GetPollFrequencyOfRootObject
(
const UObject* ReplicatedObject |
Returns the poll frequency of a specific root object. | |
| UObject * | GetReplicatedObject
(
FNetRefHandle Handle |
Get the Object from a replicated handle, if the handle is invalid or not is a replicated handle the function will return nullptr | |
| FNetRefHandle | GetReplicatedRefHandle
(
FNetHandle Handle |
Get NetRefHandle from a NetHandle. | |
| FNetRefHandle | GetReplicatedRefHandle
(
const UObject* Object, |
Get NetRefHandle from a replicated UObject. | |
| FNetRefHandle | GetRootObjectOfSubObject
(
FNetRefHandle SubObjectHandle |
Get the handle of the root object of any replicated subobject. | |
| bool | IsClassCritical
(
const UClass* Class |
Returns true if the class is considered critical and we force a disconnection if a protocol mismatch prevents instances of this class from replicating. | |
| void | LoadConfig () |
Re-initialize config-driven parameters found in ObjectReplicationBridgeConfig. | |
| bool |
ObjectLevelHasFinishedLoading
(
UObject* Object |
Returns true of the level that the Object belongs to has finished loading. | |
| bool | OnInstantiatedFromRemote
(
UObject* Instance, |
Invoked before we start applying state data to instance on remote end. | |
| void | OnProtocolMismatchDetected
(
FNetRefHandle ObjectHandle |
Called when we found a divergence between the local and remote protocols when trying to instantiate a remote replicated object. | |
| void | OnSubObjectCreatedFromReplication
(
FNetRefHandle SubObjectHandle |
Invoked for new replicated SubObjects after state has been applied to owner | |
| void | PrintAlwaysRelevantObjects
(
uint32 ArgTraits |
||
| FString | PrintConnectionInfo
(
uint32 ConnectionId |
Returns the most relevant description of the client tied to this connection id. | |
| void | Debug functions exposed that are triggered via console commands. | ||
| void | PrintNetCullDistances
(
const TArray< FString >& Args |
||
| void | PrintRelevantObjects
(
uint32 ArgTraits |
||
| void | PrintRelevantObjectsForConnections
(
const TArray< FString >& Args |
||
| void | PrintReplicatedObjects
(
uint32 ArgTraits |
||
| FCreationHeader * | ReadCreationHeader
(
UE::Net::FNetSerializationContext& Context |
Create Header and read data required to instantiate the Handle. | |
| void | Re-initialize the poll frequency of all replicated root objects. | ||
| bool | RemapPathForPIE
(
uint32 ConnectionId, |
PIE package name remapping support. | |
| void | RemoveDependentObject
(
FNetRefHandle Parent, |
Remove dependent object from parent. | |
| UObject * | ResolveObjectReference
(
const UE::Net::FNetObjectReference& ObjectRef, |
Try to resolve UObject from NetObjectReference, this function tries to resolve the object by loading if necessary. | |
| void | SetClassDynamicFilterConfig
(
FName ClassPathName, |
||
| void | SetClassDynamicFilterConfig
(
FName ClassPathName, |
Set the object filter to use for objects of this class and any derived classes without an explicit config. | |
| void | SetClassTypeStatsConfig
(
FName ClassPathName, |
Set the TypeStats to use for specified class and any derived classes without explicit config | |
| void | SetClassTypeStatsConfig
(
const FString& ClassPathName, |
||
| void | SetInstanceGetWorldObjectInfoFunction
(
FInstanceGetWorldObjectInfoFunction InGetWorldObjectInfoFunction |
Set the function that we should call to get the world location of an object. | |
| void | SetInstancePreUpdateFunction
(
FInstancePreUpdateFunction InPreUpdateFunction |
Set the function that we should call before copying state data. | |
| void | SetMaxTickRate
(
float InMaxTickRate |
Change the max tick rate to match the one from the engine | |
| void | SetObjectWantsToBeDormant
(
FNetRefHandle Handle, |
Set whether object should go dormant. | |
| void | SetPollFrequency
(
FNetRefHandle RootHandle, |
Set poll frequency on root object and its subobjects. They will be polled on the same frame. | |
| void | SetPollWithObject
(
FNetRefHandle ObjectToPollWith, |
Force polling of Object when ObjectToPollWith is polled. | |
| void | SetShouldSubclassUseSameFilterFunction
(
TFunction< bool(const UClass*Class, const UClass*Subclass)> |
Set the function used to determine whether two classes are to be considered equal when it comes to filtering. | |
| void | SetShouldUseDefaultSpatialFilterFunction
(
TFunction< bool(const UClass*)> |
Set the function used to determine whether an object should use the default spatial filter unless the class is configured to use some other filter. | |
| void | SetSubObjectNetCondition
(
FNetRefHandle SubObjectHandle, |
Set NetCondition for a subobject, the condition is used to determine if the SubObject should replicate or not. | |
| bool | WriteCreationHeader
(
UE::Net::FNetSerializationContext& Context, |
$IRIS TODO: Consider moving these methods to separate interface to allow for a single ObjectReplicationBridge to support different type specific methods to its own interface and allow for a single bridge to support multiple subtypes? We will see what we need when we start to Serialize data we might not even want to expose virtual methods for doing this, and instead provide support for specifying a "creation state" that works exactly as any other state but only ever is replicated when we first instantiate an object of the specific type Write data required to instantiate the Handle. |
Overridden from UReplicationBridge
| Type | Name | Description | |
|---|---|---|---|
| FReplicationBridgeCreateNetRefHandleResult | CreateNetRefHandleFromRemote
(
FNetRefHandle RootObjectOfSubObject, |
Read data required to instantiate NetObject from bitstream. | |
| void | Deinitialize () |
Deinitializes the bridge. Is called during ReplicationSystem deinitialization. | |
| void | DetachInstance
(
FNetRefHandle Handle |
Called when we detach instance protocol from the local instance | |
| void | DetachInstanceFromRemote
(
FNetRefHandle Handle, |
Called when the instance is detached from the protocol on request by the remote. | |
| void | Initialize
(
UReplicationSystem* InReplicationSystem |
Initializes the bridge. Is called during ReplicationSystem initialization. | |
| void | OnErrorWithNetRefHandleReported
(
uint32 ErrorType, |
Called when a remote connection has a critical error caused by a specific NetRefHandle | |
| void | Invoked after we sent data to all connections. | ||
| void | OnProtocolMismatchReported
(
FNetRefHandle RefHandle, |
Called when a remote connection detected a protocol mismatch when trying to instantiate the NetRefHandle replicated object. | |
| void | Invoked when the ReplicationSystem starts the PreSendUpdate tick. | ||
| void | PostApplyInitialState
(
FNetRefHandle Handle |
Invoke after we have applied the initial state for an object. | |
| void | Invoked before ReplicationSystem copies dirty state data. | ||
| void | PreSendUpdateSingleHandle
(
FNetRefHandle Handle |
Invoked before ReplicationSystem copies dirty state data for a single replicated object. | |
| void | Invoked post garbage collect to allow us to detect stale objects | ||
| void | SubObjectCreatedFromReplication
(
FNetRefHandle SubObjectRefHandle |
Invoked right before we apply the state for a new received subobject but after we have applied state for owning/root object in order to behave like old replication system | |
| void | Update world locations in FWorldLocations for objects that support it. | ||
| bool | WriteNetRefHandleCreationInfo
(
FReplicationBridgeSerializationContext& Context, |
Write data required to instantiate NetObject remotely to bitstream. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FCreateNetRefHandleParams | |||
| FCreationHeader | |||
| FDestroyInstanceParams |
Typedefs
| Name | Description |
|---|---|
| EGetRefHandleFlags | |
| FInstanceGetWorldObjectInfoFunction | Helper method to get the world location & cull distance for replicated instances with the HasWorldLocation trait. |
| FInstancePreUpdateFunction | Helper method that calls provided PreUpdateFunction and polls state data for all replicated instances with the NeedsPoll trait. |
Constants
| Name | Description |
|---|---|
| DefaultCreateNetRefHandleParams |