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
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
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 SubObjectOwnerHandle, |
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. | |
| void | DestroyInstanceFromRemote
(
UObject* Instance, |
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
(
UObject* Instance, |
Stop replicating the object. | |
| 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. | |
| 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 FString& Path, |
Get or create NetObjectReference for object identified by path relative to outer. | |
| UE::Net::FNetObjectReference | GetOrCreateObjectReference
(
const UObject* Instance |
Get or create NetObjectReference for object instance. | |
| 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. | |
| 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. | |
| 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 | 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 | 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 SubObjectOwnerNetHandle, |
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 | 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 | 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 |
Typedefs
| Name | Description |
|---|---|
| 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 |