Navigation
API > API/Runtime > API/Runtime/IrisCore
The class is responsible for creating the header representing specific replicated object types. Also responsible for instantiating the UObject from a replicated header.
| Name | UNetObjectFactory |
| Type | class |
| Header File | /Engine/Source/Runtime/Net/Iris/Public/Iris/ReplicationSystem/NetObjectFactory.h |
| Include Path | #include "Iris/ReplicationSystem/NetObjectFactory.h" |
Syntax
UCLASS (MinimalAPI, Transient, Abstract)
class UNetObjectFactory : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UNetObjectFactory
Derived Classes
Structs
| Name | Remarks |
|---|---|
| FDestroyedContext | Contextual information for the destroy callbacks |
| FInstantiateContext | Contextual information to use during instantiation |
| FInstantiateResult | Result of the instantiate request |
| FPostInitContext | Contextual information to use in the PostInit callback |
| FPostInstantiationContext | Contextual information to use in the PostInstantiation callback |
| FWorldInfoContext | Context when asking the factory for information on a specific object |
| FWorldInfoData | The world data the factory needs to fill about a given object. |
Enums
Public
| Name | Remarks |
|---|---|
| EWorldInfoRequested | Details which info needs to be updated in GetWorldInfo |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TUniquePtr< UE::Net::FNetObjectCreationHeader > CreateHeader
(
UE::Net::FNetRefHandle Handle, |
Creates the header containing all information required to instantiate a remote version of the object represented by the handle. | Iris/ReplicationSystem/NetObjectFactory.h | |
void Deinit() |
Iris/ReplicationSystem/NetObjectFactory.h | ||
virtual void DestroyReplicatedObject
(
const FDestroyedContext& Context |
Replaced by DetachedFromReplication since it didn't receive callbacks for objects with EReplicationBridgeDestroyInstanceReason::DoNotDestroy reasons. | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void DetachedFromReplication
(
const FDestroyedContext& Context |
Callback triggered when a replicated object is no longer relevant on the client. | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual float GetPollFrequency
(
UE::Net::FNetRefHandle RootObjectHandle, |
Return the poll frequency of a root object managed by this factory. | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual TOptional< FWorldInfoData > GetWorldInfo
(
const FWorldInfoContext& Context |
Fetch world information about a replicated object so it can be updated in the network engine. | Iris/ReplicationSystem/NetObjectFactory.h | |
void Init
(
UE::Net::FNetObjectFactoryId InId, |
Iris/ReplicationSystem/NetObjectFactory.h | ||
virtual FInstantiateResult InstantiateReplicatedObjectFromHeader
(
const FInstantiateContext& Context, |
Create or bind a replicated object from the received creation header. | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void PostInit
(
const FPostInitContext& Context |
Optional callback triggered after we applied the initial replicated properties to the instantiated object. | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void PostInstantiation
(
const FPostInstantiationContext& Context |
Optional callback triggered at the end of the instantiation process and before any replicated properties were applied. | Iris/ReplicationSystem/NetObjectFactory.h | |
void PostReceiveUpdate() |
Iris/ReplicationSystem/NetObjectFactory.h | ||
TUniquePtr< UE::Net::FNetObjectCreationHeader > ReadHeader
(
UE::Net::FNetRefHandle Handle, |
Deserialize the header data received and return a valid header | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void SubObjectCreatedFromReplication
(
UE::Net::FNetRefHandle RootObject, |
Optional callback triggered when a root object managed by this factory gets assigned a dynamic subobject. | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void SubObjectDetachedFromReplication
(
const FDestroyedContext& Context |
Optional callback triggered when a subobject will be detached from the replication system and potentially destroyed by it's factory in DestroyReplicatedObject. | Iris/ReplicationSystem/NetObjectFactory.h | |
bool WriteHeader
(
UE::Net::FNetRefHandle Handle, |
Serializes a valid header so it can be replicated to remote connections | Iris/ReplicationSystem/NetObjectFactory.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TUniquePtr< UE::Net::FNetObjectCreationHeader > CreateAndDeserializeHeader
(
const UE::Net::FCreationHeaderContext& Context |
Create a new header and deserialize it's data from the incoming bitstream | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual TUniquePtr< UE::Net::FNetObjectCreationHeader > CreateAndFillHeader
(
UE::Net::FNetRefHandle Handle |
Create the correct header type for a given replicated object and fill the header with the information representing it. | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void OnDeinit() |
Called before the netfactory will be destroyed | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void OnInit() |
Called when the netfactory is created | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual void OnPostReceiveUpdate() |
Called after we finished processing all incoming packets | Iris/ReplicationSystem/NetObjectFactory.h | |
virtual bool SerializeHeader
(
const UE::Net::FCreationHeaderContext& Context, |
Serialize the header into the bitstream | Iris/ReplicationSystem/NetObjectFactory.h |