UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NetSubObjectRegistryGetter.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
9
10namespace UE::Net
11{
12
15{
16public:
17
20
22
24 {
25 return InActor->ReplicatedSubObjects;
26 }
27
29 {
30 const UE::Net::FReplicatedComponentInfo* ComponentInfo = InActor->ReplicatedComponentsInfo.FindByKey(InActorComp);
31 return ComponentInfo ? &(ComponentInfo->SubObjects) : nullptr;
32 }
33
35 {
36 return InActor->ReplicatedComponentsInfo;
37 }
38
43
49
52 {
53 if (InActor->ReplicatedSubObjects.IsSubObjectInRegistry(InSubObject))
54 {
55 return true;
56 }
57
58 for (const UE::Net::FReplicatedComponentInfo& ComponentInfo : InActor->ReplicatedComponentsInfo)
59 {
60 if (ComponentInfo.Component == InSubObject || ComponentInfo.SubObjects.IsSubObjectInRegistry(InSubObject))
61 {
62 return true;
63 }
64 }
65
66 return false;
67 }
68
70 {
71 InActor->BuildReplicatedComponentsInfo();
72 }
73
75 {
76 // Start with the actor's subobjects;
77 uint32 NumReplicatedObjects = (uint32)InActor->ReplicatedSubObjects.Num();
78 // Add the replicated components
79 NumReplicatedObjects += (uint32)InActor->ReplicatedComponentsInfo.Num();
80
81 // Finally add the subobjects of the replicated components
82 for (const UE::Net::FReplicatedComponentInfo& ReplicatedComponentInfo : InActor->ReplicatedComponentsInfo)
83 {
85 }
86
88 }
89};
90
91}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Actor.h:257
Definition Array.h:670
Definition ActorComponent.h:152
Definition NetSubObjectRegistryGetter.h:15
static void InitReplicatedComponentsList(AActor *InActor)
Definition NetSubObjectRegistryGetter.h:69
static const FSubObjectRegistry * GetSubObjectsOfActorComponent(const AActor *InActor, UActorComponent *InActorComp)
Definition NetSubObjectRegistryGetter.h:28
static const TArray< UE::Net::FReplicatedComponentInfo > & GetReplicatedComponents(AActor *InActor)
Definition NetSubObjectRegistryGetter.h:34
static const FSubObjectRegistry & GetSubObjects(const AActor *InActor)
Definition NetSubObjectRegistryGetter.h:23
static uint32 CountReplicatedSubObjectsOfActor(AActor *InActor)
Definition NetSubObjectRegistryGetter.h:74
static bool IsSubObjectInRegistry(AActor *InActor, UActorComponent *InActorComp, UObject *InSubObject)
Definition NetSubObjectRegistryGetter.h:44
static const UE::Net::FReplicatedComponentInfo * GetReplicatedComponentInfoForComponent(AActor *InActor, UActorComponent *InActorComp)
Definition NetSubObjectRegistryGetter.h:39
static bool IsSubObjectInAnyRegistry(AActor *InActor, UObject *InSubObject)
Definition NetSubObjectRegistryGetter.h:51
Definition Object.h:95
Definition NetworkVersion.cpp:28
Definition NetSubObjectRegistry.h:127
FSubObjectRegistry SubObjects
Definition NetSubObjectRegistry.h:138
Definition NetSubObjectRegistry.h:29
NETCORE_API bool IsSubObjectInRegistry(const UObject *SubObject) const
Definition NetSubObjectRegistry.cpp:48