UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Net::FPropertyReplicationState Class Reference

#include <PropertyReplicationState.h>

Classes

struct  FCallRepNotifiesParameters
 
struct  FPollParameters
 

Public Types

enum  : unsigned { TArrayElementChangeMaskBits = 63U , TArrayPropertyChangeMaskBitIndex = 0U , TArrayElementChangeMaskBitOffset = 1U }
 

Public Member Functions

IRISCORE_API FPropertyReplicationState (const FReplicationStateDescriptor *Descriptor)
 
IRISCORE_API FPropertyReplicationState (const FReplicationStateDescriptor *Descriptor, uint8 *InStateBuffer)
 
IRISCORE_API ~FPropertyReplicationState ()
 
IRISCORE_API FPropertyReplicationState (const FPropertyReplicationState &Other)
 
IRISCORE_API FPropertyReplicationStateoperator= (const FPropertyReplicationState &Other)
 
IRISCORE_API void Set (const FPropertyReplicationState &Other)
 
IRISCORE_API bool IsValid () const
 
IRISCORE_API void SetPropertyValue (uint32 Index, const void *SrcValue)
 
IRISCORE_API void GetPropertyValue (uint32 Index, void *DstValue) const
 
IRISCORE_API bool IsDirty (uint32 Index) const
 
IRISCORE_API void MarkDirty (uint32 Index)
 
IRISCORE_API bool PollPropertyReplicationState (const void *RESTRICT SrcData)
 
IRISCORE_API bool PollPushBasedPropertyReplicationState (const void *RESTRICT SrcData, const FPollParameters &PollParameters)
 
IRISCORE_API bool StoreCurrentPropertyReplicationStateForRepNotifies (const void *RESTRICT SrcData, const FPropertyReplicationState *NewStateToBeApplied)
 
IRISCORE_API void PushPropertyReplicationState (const UObject *Owner, void *RESTRICT DstData, bool bPushAll=false) const
 
IRISCORE_API bool PollObjectReferences (const void *RESTRICT SrcData)
 
IRISCORE_API void CopyDirtyProperties (const FPropertyReplicationState &Other)
 
IRISCORE_API void CallRepNotifies (void *RESTRICT DstData, const FCallRepNotifiesParameters &Params) const
 
void CallRepNotifies (void *RESTRICT DstData, const FPropertyReplicationState *PreviousState, bool bIsInit) const
 
IRISCORE_API FString ToString (bool bIncludeAll=true) const
 
IRISCORE_API const TCHARToString (FStringBuilderBase &StringBuilder, bool bIncludeAll=true) const
 
const FReplicationStateDescriptorGetReplicationStateDescriptor () const
 
uint8GetStateBuffer () const
 
IRISCORE_API bool IsCustomConditionEnabled (uint32 Index) const
 
IRISCORE_API bool IsDirtyForPolling () const
 

Protected Member Functions

IRISCORE_API void MarkArrayDirty (uint32 Index)
 

Detailed Description

ReplicationState created at runtime using a descriptor built from existing reflection data StateBuffer contains storage for all properties described by the descriptor, When polling data from the source object properties we will compare the value with what we have stored in the statebuffer and mark the member as dirty.if the value differs

Polling is quite expensive but we only do it once per update of the replication system

Member Enumeration Documentation

◆ anonymous enum

Enumerator
TArrayElementChangeMaskBits 
TArrayPropertyChangeMaskBitIndex 
TArrayElementChangeMaskBitOffset 

Constructor & Destructor Documentation

◆ FPropertyReplicationState() [1/3]

UE::Net::FPropertyReplicationState::FPropertyReplicationState ( const FReplicationStateDescriptor Descriptor)
explicit

Construct a new state, StateBuffer will be allocated and constructed according to data in the descriptor

◆ FPropertyReplicationState() [2/3]

UE::Net::FPropertyReplicationState::FPropertyReplicationState ( const FReplicationStateDescriptor Descriptor,
uint8 InStateBuffer 
)

Construct a new state, using already constructed state in InStateBuffer

◆ ~FPropertyReplicationState()

UE::Net::FPropertyReplicationState::~FPropertyReplicationState ( )

◆ FPropertyReplicationState() [3/3]

UE::Net::FPropertyReplicationState::FPropertyReplicationState ( const FPropertyReplicationState Other)

Copy constructor, will not copy internal data

Member Function Documentation

◆ CallRepNotifies() [1/2]

void UE::Net::FPropertyReplicationState::CallRepNotifies ( void *RESTRICT  DstData,
const FCallRepNotifiesParameters Params 
) const

Invoke repnotifies for all dirty members

◆ CallRepNotifies() [2/2]

void UE::Net::FPropertyReplicationState::CallRepNotifies ( void *RESTRICT  DstData,
const FPropertyReplicationState PreviousState,
bool  bIsInit 
) const
inline

◆ CopyDirtyProperties()

void UE::Net::FPropertyReplicationState::CopyDirtyProperties ( const FPropertyReplicationState Other)

Copy dirty properties from the other state including changemask

◆ GetPropertyValue()

void UE::Net::FPropertyReplicationState::GetPropertyValue ( uint32  Index,
void DstValue 
) const

Retrieve the value at the provided Index by writing it to DstValue. The property is looked up from the descriptor using the index. Mostly intended for test code. Normal use of this class is through the poll layer.

◆ GetReplicationStateDescriptor()

const FReplicationStateDescriptor * UE::Net::FPropertyReplicationState::GetReplicationStateDescriptor ( ) const
inline

◆ GetStateBuffer()

uint8 * UE::Net::FPropertyReplicationState::GetStateBuffer ( ) const
inline

◆ IsCustomConditionEnabled()

bool UE::Net::FPropertyReplicationState::IsCustomConditionEnabled ( uint32  Index) const

If state has custom conditionals then this function will check whether the condition is enabled or not. If state doesn't have custom conditionals it will return true.

◆ IsDirty()

bool UE::Net::FPropertyReplicationState::IsDirty ( uint32  Index) const

Is the property at the given index dirty, for properties with multiple bits in the statemask this will return true if any of those bits are set

◆ IsDirtyForPolling()

bool UE::Net::FPropertyReplicationState::IsDirtyForPolling ( ) const

Returns true if state is marked dirty for polling

◆ IsValid()

bool UE::Net::FPropertyReplicationState::IsValid ( ) const

Either StateBuffer is initialized and owned by this instance, or we have been injected with a state from the network system A default constructed state is not valid

◆ MarkArrayDirty()

void UE::Net::FPropertyReplicationState::MarkArrayDirty ( uint32  Index)
protected

Explicitly mark an array at the given Index as dirty. It will not mark element changemask bits as dirty.

◆ MarkDirty()

void UE::Net::FPropertyReplicationState::MarkDirty ( uint32  Index)

Explicitly mark the property at the given Index as dirty, for properties with multiple bits in the statemask this will mark all bits dirty

◆ operator=()

FPropertyReplicationState & UE::Net::FPropertyReplicationState::operator= ( const FPropertyReplicationState Other)

Assignment operator, it is debatable if this should be provided or not. if we are copying to a bound state we will perform a Set which will do a full property compare to properly update dirtiness if we are copying to a loose state we will just to a copy of all properties contained in the state, changemask will also be copied

◆ PollObjectReferences()

bool UE::Net::FPropertyReplicationState::PollObjectReferences ( const void *RESTRICT  SrcData)

Poll data from object referencing properties in SrcData, Note: SrcData is a UObject containing properties. Behaves like PollPropertyReplicationState when it comes to dirtiness and such.

Returns
True if any state is dirty, false if not.

◆ PollPropertyReplicationState()

bool UE::Net::FPropertyReplicationState::PollPropertyReplicationState ( const void *RESTRICT  SrcData)

$IRIS TODO: Move Poll/Push/CallRepNotifies out of PropertyReplicationState as loose functions Poll src data from properties in SrcData, where SrcData is a UClass/UStruct containing properties. Compare and update representation in DstStateBuffer and update ChangeMask. This is currently used to track and update dirtiness for the properties.

Returns
True if any state is dirty, false if not.

◆ PollPushBasedPropertyReplicationState()

bool UE::Net::FPropertyReplicationState::PollPushBasedPropertyReplicationState ( const void *RESTRICT  SrcData,
const FPollParameters PollParameters 
)

Partial poll src data from properties in SrcData based on the state of the inlined per member pollmask non-pushbased properties are always polled, Compare and update representation in DstStateBuffer and update ChangeMask. This is currently used to track and update dirtiness for the properties. @SrcData is a UClass/UStruct containing properties.

Returns
True if any state is dirty, false if not.

◆ PushPropertyReplicationState()

void UE::Net::FPropertyReplicationState::PushPropertyReplicationState ( const UObject Owner,
void *RESTRICT  DstData,
bool  bPushAll = false 
) const

Push received state data to properties in DstData buffer. Note: DstData is a UClass/UStruct containing properties. Updates representation in DstStateBuffer and mark destination properties as dirty if updated.

◆ Set()

void UE::Net::FPropertyReplicationState::Set ( const FPropertyReplicationState Other)

Set from Other this will update dirtiness by comparing all properties

◆ SetPropertyValue()

void UE::Net::FPropertyReplicationState::SetPropertyValue ( uint32  Index,
const void SrcValue 
)

Set the value at the provided Index, The UProperty is looked up from the descriptor using the index, if the value differs the statemask is updated Mostly intended for test code Normal use of this class is through the poll layer TODO: It would be nice if we could provide some validation on property types

◆ StoreCurrentPropertyReplicationStateForRepNotifies()

bool UE::Net::FPropertyReplicationState::StoreCurrentPropertyReplicationStateForRepNotifies ( const void *RESTRICT  SrcData,
const FPropertyReplicationState NewStateToBeApplied 
)

Certain rep notifies requires the current state to be stored before we overwrite it, this method will copy property values from src data, , where SrcData is a UClass/UStruct containing properties if the property is marked as dirty in NewStateToBeApplied

◆ ToString() [1/2]

FString UE::Net::FPropertyReplicationState::ToString ( bool  bIncludeAll = true) const

Debug output state to FString

◆ ToString() [2/2]

const TCHAR * UE::Net::FPropertyReplicationState::ToString ( FStringBuilderBase StringBuilder,
bool  bIncludeAll = true 
) const

Debug output state to StringBuilder


The documentation for this class was generated from the following files: