|
| virtual | ~FRepLayout () |
| |
| FRepStateStaticBuffer | CreateShadowBuffer (const FConstRepObjectDataBuffer Source) const |
| |
| TSharedPtr< FReplicationChangelistMgr > | CreateReplicationChangelistMgr (const UObject *InObject, const ECreateReplicationChangelistMgrFlags CreateFlags) const |
| |
| TUniquePtr< FRepState > | CreateRepState (const FConstRepObjectDataBuffer Source, TSharedPtr< FRepChangedPropertyTracker > &InRepChangedPropertyTracker, ECreateRepStateFlags Flags) const |
| |
| void | InitChangedTracker (FRepChangedPropertyTracker *ChangedTracker) const |
| |
| bool | ReplicateProperties (FSendingRepState *RESTRICT RepState, FRepChangelistState *RESTRICT RepChangelistState, const FConstRepObjectDataBuffer Data, UClass *ObjectClass, UActorChannel *OwningChannel, FNetBitWriter &Writer, const FReplicationFlags &RepFlags) const |
| |
| bool | ReceiveProperties (UActorChannel *OwningChannel, UClass *InObjectClass, FReceivingRepState *RESTRICT RepState, UObject *Object, FNetBitReader &InBunch, bool &bOutHasUnmapped, bool &bOutGuidsChanged, const EReceivePropertiesFlags InFlags) const |
| |
| void | GatherGuidReferences (FReceivingRepState *RESTRICT RepState, struct FNetDeltaSerializeInfo &Params, TSet< FNetworkGUID > &OutReferencedGuids, int32 &OutTrackedGuidMemoryBytes) const |
| |
| bool | MoveMappedObjectToUnmapped (FReceivingRepState *RESTRICT RepState, struct FNetDeltaSerializeInfo &Params, const FNetworkGUID &GUID) const |
| |
| void | UpdateUnmappedObjects (FReceivingRepState *RESTRICT RepState, UPackageMap *PackageMap, UObject *Object, struct FNetDeltaSerializeInfo &Params, bool &bCalledPreNetReceive, bool &bOutSomeObjectsWereMapped, bool &bOutHasMoreUnmapped) const |
| |
| void | CallRepNotifies (FReceivingRepState *RepState, UObject *Object) const |
| |
| template<ERepDataBufferType DataType> |
| void | ValidateWithChecksum (TConstRepDataBuffer< DataType > Data, FBitArchive &Ar) const |
| |
| uint32 | GenerateChecksum (const FRepState *RepState) const |
| |
| template<ERepDataBufferType DstType, ERepDataBufferType SrcType> |
| bool | DiffProperties (TArray< FProperty * > *RepNotifies, TRepDataBuffer< DstType > Destination, TConstRepDataBuffer< SrcType > Source, const EDiffPropertiesFlags Flags) const |
| |
| template<ERepDataBufferType DstType, ERepDataBufferType SrcType> |
| bool | DiffStableProperties (TArray< FProperty * > *RepNotifies, TArray< UObject * > *ObjReferences, TRepDataBuffer< DstType > Destination, TConstRepDataBuffer< SrcType > Source) const |
| |
| void ENGINE_API | SendPropertiesForRPC (UFunction *Function, UActorChannel *Channel, FNetBitWriter &Writer, const FConstRepObjectDataBuffer Data) const |
| |
| void | ReceivePropertiesForRPC (UObject *Object, UFunction *Function, UActorChannel *Channel, FNetBitReader &Reader, FRepObjectDataBuffer Data, TSet< FNetworkGUID > &UnmappedGuids) const |
| |
| void ENGINE_API | BuildSharedSerializationForRPC (const FConstRepObjectDataBuffer Data, UE::Net::FNetTokenStore *NetTokenStore=nullptr) |
| |
| void ENGINE_API | ClearSharedSerializationForRPC () |
| |
| ENGINE_API void | SerializePropertiesForStruct (UStruct *Struct, FBitArchive &Ar, UPackageMap *Map, FRepObjectDataBuffer Data, bool &bHasUnmapped, const UObject *OwningObject=nullptr) const |
| |
| ENGINE_API void | SerializeObjectReplicatedProperties (UObject *Object, FBitArchive &Ar) const |
| |
| UObject * | GetOwner () const |
| |
| void | SendProperties_BackwardsCompatible (FSendingRepState *RESTRICT RepState, FRepChangedPropertyTracker *ChangedTracker, const FConstRepObjectDataBuffer Data, UNetConnection *Connection, FNetBitWriter &Writer, TArray< uint16 > &Changed) const |
| |
| bool | ReceiveProperties_BackwardsCompatible (UNetConnection *Connection, FReceivingRepState *RESTRICT RepState, FRepObjectDataBuffer Data, FNetBitReader &InBunch, bool &bOutHasUnmapped, const bool bEnableRepNotifies, bool &bOutGuidsChanged, UObject *OwningObject=nullptr) const |
| |
| virtual ENGINE_API void | AddReferencedObjects (FReferenceCollector &Collector) override |
| |
| virtual ENGINE_API FString | GetReferencerName () const override |
| |
| template<typename T > |
| T * | GetShadowStateValue (FRepShadowDataBuffer Data, const FName PropertyName) |
| |
| template<typename T > |
| const T * | GetShadowStateValue (FConstRepShadowDataBuffer Data, const FName PropertyName) const |
| |
| const ERepLayoutFlags | GetFlags () const |
| |
| const bool | IsEmpty () const |
| |
| const int32 | GetNumParents () const |
| |
| const FProperty * | GetParentProperty (int32 Index) const |
| |
| const int32 | GetParentArrayIndex (int32 Index) const |
| |
| const int32 | GetParentCondition (int32 Index) const |
| |
| const bool | IsCustomDeltaProperty (int32 Index) const |
| |
| const uint16 | GetCustomDeltaIndexFromPropertyRepIndex (const uint16 PropertyRepIndex) const |
| |
| void | CountBytes (FArchive &Ar) const |
| |
| template<ERepDataBufferType DestinationType, ERepDataBufferType SourceType> |
| bool | DiffProperties (TArray< FProperty * > *RepNotifies, TRepDataBuffer< DestinationType > Destination, TConstRepDataBuffer< SourceType > Source, const EDiffPropertiesFlags DiffFlags) const |
| |
| template<ERepDataBufferType DestinationType, ERepDataBufferType SourceType> |
| bool | DiffStableProperties (TArray< FProperty * > *RepNotifies, TArray< UObject * > *ObjReferences, TRepDataBuffer< DestinationType > Destination, TConstRepDataBuffer< SourceType > Source) const |
| |
| | FGCObject () |
| |
| | FGCObject (const FGCObject &Other) |
| |
| | FGCObject (FGCObject &&Other) |
| |
| | FGCObject (EFlags Flags) |
| |
| virtual | ~FGCObject () |
| |
| FGCObject & | operator= (const FGCObject &) |
| |
| FGCObject & | operator= (FGCObject &&) |
| |
| COREUOBJECT_API void | RegisterGCObject () |
| |
| COREUOBJECT_API void | UnregisterGCObject () |
| |
| virtual bool | GetReferencerPropertyName (UObject *Object, FString &OutPropertyName) const |
| |
| TSharedRef< FRepLayout, Mode > | AsShared () |
| |
| TSharedRef< FRepLayout const, Mode > | AsShared () const |
| |
| TSharedRef< SubobjectType, Mode > | AsSharedSubobject (SubobjectType *SubobjectPtr) const |
| |
| TWeakPtr< FRepLayout, Mode > | AsWeak () |
| |
| TWeakPtr< FRepLayout const, Mode > | AsWeak () const |
| |
| TWeakPtr< SubobjectType, Mode > | AsWeakSubobject (SubobjectType *SubobjectPtr) const |
| |
| void | UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const |
| |
| void | UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const |
| |
| UE_FORCEINLINE_HINT bool | DoesSharedInstanceExist () const |
| |
This class holds all replicated properties for a given type (either a UClass, UStruct, or UFunction). Helpers functions exist to read, write, and compare property state.
There is only one FRepLayout for a given type, meaning all instances of the type share the FRepState.
COMMANDS:
All Properties in a RepLayout are represented as Layout Commands. These commands dictate:
- What the underlying data type is.
- How the data is laid out in memory.
- How the data should be serialized.
- How the data should be compared (between instances of Objects, Structs, etc.).
- Whether or not the data should trigger notifications on change (RepNotifies).
- Whether or not the data is conditional (e.g. may be skipped when sending to some or all connections).
Commands are split into 2 main types: Parent Commands (
- See also
- FRepParentCmd) and Child Commands (
-
FRepLayoutCmd).
A Parent Command represents a Top Level Property of the type represented by an FRepLayout. A Child Command represents any Property (even nested properties).
E.G., Imagine an Object O, with 4 Properties, CA, DA, I, and S. CA is a fixed size C-Style array. This will generate 1 Parent Command and 1 Child Command for each element in the array. DA is a dynamic array (TArray). This will generate only 1 Parent Command and 1 Child Command, both referencing the array. Additionally, Child Commands will be added recursively for the element type of the array. S is a UStruct. All struct types generate 1 Parent Command for the Struct Property. Additionally: If the struct has a native NetSerialize method then it will generate 1 Child Command referencing the struct. If the struct has a native NetDeltaSerialize method then it will generate no Child Commands. All other structs will recursively generate Child Commands for each nested Net Property in the struct. Note, in this case there is no Child Command associated with the top level struct property. I is an integer (or other supported non-Struct type, or object reference). This will generate 1 Parent Command and 1 Child Command.
CHANGELISTS
Along with Layout Commands that describe the Properties in a type, RepLayout uses changelists to know what Properties have changed between frames.
- See also
- FRepChangedHistory.
Changelists are arrays of Property Handles that describe what Properties have changed, however they don't track the actual values of the Properties.
Changelists can contain "sub-changelists" for arrays. Formally, they can be described as the following grammar:
Terminator ::= 0
Handle ::= Integer between 1 ~ 65535
Number ::= Integer between 0 ~ 65535
Changelist ::= <Terminator> | <Handle><Changelist> | <Handle><Array-Changelist><Changelist>
Array-Changelist: ::= <Number><Changelist>
An important distinction is that Handles do not have a 1:1 mapping with RepLayoutCommands. Handles are 1-based (as opposed to 0-based), and track a relative command index within a single level of a changelist. Each Array Command, regardless of the number of child Commands it has, will only be count as a single handle in its owning changelist. Each time we recurse into an Array-Changelist, our handles restart at 1 for that "depth", and they correspond to the Commands associated with the Array's element type.
In order to generate Changelists, Layout Commands are sequentially applied that compare the values of an object's cached state to a object's current state. Any properties that are found to be different will have their handle written into the changelist. This means handles within a changelists are inherently ordered (with arrays inserted whose Handles are also ordered).
When we want to replicate properties for an object, merge together any outstanding changelists and then iterate over it using Layout Commands that serialize the necessary property data.
Receiving is very similar, except the Handles are baked into the serialized data so no explicit changelist is required. As each Handle is read, a Layout Command is applied that serializes the data from the network bunch and applies it to an object.
RETRIES AND RELIABLES
@FSendingRepState maintains a circular buffer that tracks recently sent Changelists (@FRepChangedHistory). These history items track the Changelist alongside the Packet ID that the bunches were sent in.
Once we receive ACKs for all associated packets, the history will be removed from the buffer. If NAKs are received for any of the packets, we will merge the changelist into the next set of properties we replicate.
If we receive no NAKs or ACKs for an extended period, to prevent overflows in the history buffer, we will merge the entire buffer into a single monolithic changelist which will be sent alongside the next set of properties.
In both cases of NAKs or no response, the merged changelists will be tracked in the latest history item alongside with other sent properties.
When "net.PartialBunchReliableThreshold" is non-zero and property data bunches are split into partial bunches above the threshold, we will not generate a history item. Instead, we will rely on the reliable bunch framework for resends and replication of the Object will be completely paused until the property bunches are acknowledged. However, this will not affect other history items since they are still unreliable.