Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Engine
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UChannel
- UActorChannel
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Engine/ActorChannel.h |
Include | #include "Engine/ActorChannel.h" |
Syntax
UCLASS (Transient, CustomConstructor, MinimalAPI)
class UActorChannel : public UChannel
Remarks
A channel for exchanging actor and its subobject's properties and RPCs.
ActorChannel manages the creation and lifetime of a replicated actor. Actual replication of properties and RPCs actually happens in FObjectReplicator now (see DataReplication.h).
An ActorChannel bunch looks like this:
+-------------------+------------------------------------------------------------------------+ | SpawnInfo | (Spawn Info) Initial bunch only | | -Actor Class | -Created by ActorChannel | | -Spawn Loc/Rot | | | NetGUID assigns | | | -Actor NetGUID | | | -Component NetGUIDs | | +-------------------+------------------------------------------------------------------------+ | | | +-------------------+------------------------------------------------------------------------+ | NetGUID ObjRef | (Content chunks) x number of replicating objects (Actor + any components) | | | -Each chunk created by its own FObjectReplicator instance. | +-------------------+------------------------------------------------------------------------+ | | |
Properties...
RPCs...
+-------------------+------------------------------------------------------------------------+ | | | +-------------------+------------------------------------------------------------------------+
Variables
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
TObjectPtr< AActor > | Actor | Variables. |
![]() |
FNetworkGUID | ActorNetGUID | |
![]() |
TSharedPtr< FObjectReplicator > | ActorReplicator | |
![]() |
uint32: 1 | bBlockChannelFailure | Whether or not to block sending of NMT_ActorChannelFailure (for NetcodeUnitTest) |
![]() |
uint32: 1 | bClearRecentActorRefs | Whether we should nullptr references to this channel's Actor in other channels' Recent data when this channel is closed set to false in cases where the Actor can't become relevant again (e.g. destruction) as it's unnecessary in that case |
![]() |
uint32: 1 | bForceCompareProperties | |
![]() |
uint32: 1 | bHoldQueuedExportBunchesAndGUIDs | |
![]() |
uint32: 1 | bIsReplicatingActor | |
![]() ![]() |
TArray< TObjectPtr< UObject > > | CreateSubObjects | |
![]() |
float | CustomTimeDilation | |
![]() |
double | LastUpdateTime | |
![]() |
TSet< FNetworkGUID > | PendingGuidResolves | |
![]() |
TArray< int32 > | PendingObjKeys | Keys pending in this bunch. |
![]() |
TArray< class FInBunch * > | QueuedBunches | Async networking loading support state. |
![]() |
double | QueuedBunchStartTime | |
![]() |
EChannelCloseReason | QueuedCloseReason | |
![]() |
TArray< class FOutBunch * > | QueuedExportBunches | |
![]() |
TArray< FNetworkGUID > | QueuedMustBeMappedGuidsInLastBunch | |
![]() |
double | RelevantTime | Variables. |
![]() |
TMap< UObject *, TSharedRef< FObjectReplicator > > | ReplicationMap | |
![]() |
uint32: 1 | SpawnAcked | |
![]() |
TMap< int32, FPacketRepKeyInfo > | SubobjectNakMap | Maps packetId to keys in Subobject. |
![]() |
TMap< int32, int32 > | SubobjectRepKeyMap | Maps ObjID to the current RepKey. |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UActorChannel
(
const FObjectInitializer& ObjectInitializer |
Default constructor |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | AddReferencedObjects
(
UObject* InThis, |
|
![]() |
void | Release any references this channel is holding to UObjects and object replicators and mark it as broken. | |
![]() ![]() |
bool | Only returns true when calling ReplicateSubobjects() while we are trying to detect bad usage of the legacy function. | |
![]() ![]() |
bool | CanSubObjectReplicateToClient
(
const APlayerController* PlayerController, |
|
![]() |
void | CleanupReplicators
(
const bool bKeepReplicators |
Cleans up replicators and clears references to the actor class this channel was associated with. |
![]() |
TSharedRef< FObjectReplicator > & | CreateReplicator
(
UObject* Obj, |
Creates a new object replicator. |
![]() |
TSharedRef< FObjectReplicator > & | CreateReplicator
(
UObject* Obj |
Creates a new object replicator or reuses a replicator if it was stored for dormancy in the Connection. |
![]() |
void | ||
![]() |
bool | DoSubObjectReplication
(
FOutBunch& Bunch, |
Handle the replication of subobjects for this actor. |
![]() |
TSharedRef< FObjectReplicator > & | FindOrCreateReplicator
(
UObject* Obj, |
Convenience method for finding a replicator, and creating one if necessary, all at once. |
![]() |
TSharedRef< FObjectReplicator > * | FindReplicator
(
UObject* Obj |
Attempts to find a valid, non-dormant replicator for the given object. |
![]() |
TSharedRef< FObjectReplicator > * | FindReplicator
(
UObject* Obj, |
Attempts to find a valid, non-dormant replicator for the given object. |
![]() ![]() |
AActor * | GetActor () |
UActorChannel interface and accessors. |
![]() |
FObjectReplicator & | Returns the replicator for the actor associated with this channel. Guaranteed to exist. | |
![]() ![]() |
const TArray< TObjectPtr< UObject > > & | ||
![]() |
FNetFieldExportGroup * | GetNetFieldExportGroupForClassNetCache
(
UClass* ObjectClass |
Finds the net field export group for a class net cache, if not found, creates one |
![]() |
FNetFieldExportGroup * | GetOrCreateNetFieldExportGroupForClassNetCache
(
const UObject* Object |
Finds (or creates) the net field export group for a class net cache, if not found, creates one |
![]() ![]() |
bool | ||
![]() ![]() |
bool | Tells if the actor is ready to be replicated since he is BeginPlay or inside BeginPlay | |
![]() |
bool | KeyNeedsToReplicate
(
int32 ObjID, |
Returns true if the given ObjID is not up to date with RepKey this implicitly 'writes' the RepKey to the current out bunch. |
![]() |
void | MoveMappedObjectToUnmapped
(
const UObject* Object |
Unmap all references to this object, so that if later we receive this object again, we can remap the original references |
![]() ![]() |
void | NotifyActorChannelOpen
(
AActor* InActor, |
|
![]() ![]() |
bool |
ObjectHasReplicator
(
const TWeakObjectPtr< UObject >& Obj |
|
![]() |
void | PrepareForRemoteFunction
(
UObject* TargetObj |
If not queueing the RPC, prepare the channel for replicating the call. |
![]() |
void | ProcessBunch
(
FInBunch& Bunch |
|
![]() |
bool | ||
![]() |
void | QueueRemoteFunctionBunch
(
UObject* CallTarget, |
Queue a function bunch for this channel to be sent on the next property update. |
![]() |
UObject * | ReadContentBlockHeader
(
FInBunch& Bunch, |
Reads the header of the content block and instantiates the subobject if necessary |
![]() |
UObject * | ReadContentBlockPayload
(
FInBunch& Bunch, |
Reads content block header and payload |
![]() ![]() |
bool | ReadFieldHeaderAndPayload
(
UObject* Object, |
Reads property/function header and data blob from network stream |
![]() |
void | ReleaseReferences
(
bool bKeepReplicators |
|
![]() |
int64 | Replicate this channel's actor differences. | |
![]() |
bool | ReplicateSubobject
(
UActorComponent* ActorChannel, |
Replicates an ActorComponent subobject. |
![]() |
bool | ReplicateSubobject
(
UObject* Obj, |
Replicates given subobject on this actor channel |
![]() ![]() |
bool | ReplicateSubobjectCustom
(
UObject* Obj, |
Custom implementation for ReplicateSubobject when RepFlags.bUseCustomSubobjectReplication is true |
![]() |
bool | ReplicateSubobjectList
(
TArray< Type* >& ObjectList, |
Utility template for replicating list of replicated subobjects |
![]() |
void | SetChannelActor
(
AActor* InActor, |
Set this channel's actor to the given actor. |
![]() ![]() |
void | SetCurrentSubObjectOwner
(
UActorComponent* SubObjectOwner |
|
![]() ![]() |
void | SetCurrentSubObjectOwner
(
AActor* SubObjectOwner |
Subobject Replication state |
![]() |
void | SetForcedSerializeFromRPC
(
bool bInFromRPC |
|
![]() |
void | SetSkipRoleSwap
(
const bool bShouldSkip |
|
![]() |
const TCHAR * | ToString
(
UActorChannel::ESubObjectDeleteFlag DeleteFlag |
|
![]() |
void | WriteContentBlockForSubObjectDelete
(
FOutBunch& Bunch, |
Writes the header for a content block specifically for deleting sub-objects |
![]() |
void | WriteContentBlockForSubObjectDelete
(
FOutBunch& Bunch, |
Writes the header for a content block specifically for deleting sub-objects |
![]() |
void | WriteContentBlockHeader
(
UObject* Obj, |
Writes the header for a content block of properties / RPCs for the given object (either the actor a subobject of the actor) |
![]() |
int32 | WriteContentBlockPayload
(
UObject* Obj, |
Writes header and payload of content block |
![]() |
int32 | WriteFieldHeaderAndPayload
(
FNetBitWriter& Bunch, |
Writes property/function header and data blob to network stream |
Overridden from UChannel
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Notification that this channel has been placed in a channel pool and needs to reset to its original state so it can be used again like a new channel | |
![]() ![]() |
void | AppendExportBunches
(
TArray< FOutBunch* >& OutExportBunches |
Append any export bunches |
![]() ![]() |
void | AppendMustBeMappedGuids
(
FOutBunch* Bunch |
Append any "must be mapped" guids to front of bunch. |
![]() ![]() |
void | Closes the actor channel but with a 'dormant' flag set so it can be reopened | |
![]() ![]() ![]() |
bool | Return true to indicate that this channel no longer needs to Tick() every frame. | |
![]() ![]() |
bool | CleanUp
(
const bool bForDestroy, |
Cleans up channel structures and nulls references to the channel |
![]() ![]() |
int64 | Close
(
EChannelCloseReason Reason |
Close the base channel. Returns how many bits were written to the send buffer |
![]() ![]() |
FString | Describe () |
Describe the channel. |
![]() ![]() |
void | Init
(
UNetConnection* InConnection, |
UChannel interface. |
![]() ![]() |
bool | ReadyForDormancy
(
bool debug |
Returns true if channel is ready to go dormant (e.g., all outstanding property updates have been ACK'd) |
![]() ![]() |
void | ReceivedBunch
(
FInBunch& Bunch |
Handle an incoming bunch. |
![]() ![]() |
void | ReceivedNak
(
int32 NakPacketId |
Negative acknowledgment processing. |
![]() ![]() |
void | Set the closing flag. | |
![]() ![]() |
void | Puts the channel in a state to start becoming dormant. | |
![]() ![]() |
void | Tick () |
Handle time passing on this channel. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Handles reading, writing, and reference collecting using FArchive. |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
FPacketRepKeyInfo |
Enums
Type | Name | Description | |
---|---|---|---|
![]() |
ESubObjectDeleteFlag |
Constants
Name | Description |
---|---|
ClassNetCacheSuffix | |
SubobjectRepKeyBufferSize | Static size for SubobjectRepKeyMap. Allows us to resuse arrays and avoid dyanmic memory allocations. |