5#include "Containers/Array.h"
16class FFragmentRegistrationContext;
17class FReplicationFragment;
18struct FReplicationStateDescriptor;
20typedef FReplicationFragment* (*CreateAndRegisterReplicationFragmentFunc)(
UObject*,
const FReplicationStateDescriptor*, FFragmentRegistrationContext&);
35template<
typename StructName>
106 static bool bRegistryIsDirty;
115template <
typename T,
typename ConfigType = FNetSerializerConfig>
145 return CreateAndRegisterReplicationFragmentFunction;
200#define UE_NET_IS_DECLARED_TYPE(Name) \
202 UE::Net::IsDeclaredType((struct F##Name*)nullptr) || \
203 UE::Net::IsDeclaredType((struct U##Name*)nullptr) \
204 , "The UE type name '" #Name "' cannot be found. Make sure you have removed the 'F' or 'U' prefix from the type name.");
207#define UE_NET_DECLARE_NETSERIALIZER_INFO(NetSerializerInfo) \
208const UE::Net::FPropertyNetSerializerInfo& GetPropertyNetSerializerInfo_##NetSerializerInfo();
211#define UE_NET_IMPLEMENT_NETSERIALIZER_INFO(NetSerializerInfo) \
212const UE::Net::FPropertyNetSerializerInfo& GetPropertyNetSerializerInfo_##NetSerializerInfo() { static NetSerializerInfo StaticInstance; return StaticInstance; };
215#define UE_NET_IMPLEMENT_SIMPLE_NETSERIALIZER_INFO(PropertyType, SerializerName) \
216const UE::Net::FPropertyNetSerializerInfo& GetPropertyNetSerializerInfo_##PropertyType() { static UE::Net::TSimplePropertyNetSerializerInfo<PropertyType> StaticInstance(UE_NET_GET_SERIALIZER(SerializerName)); return StaticInstance; };
219#define UE_NET_IMPLEMENT_NAMED_STRUCT_NETSERIALIZER_INFO(Name, SerializerName) \
220const UE::Net::FPropertyNetSerializerInfo& GetPropertyNetSerializerInfo_##Name() { static UE::Net::FNamedStructPropertyNetSerializerInfo StaticInstance(Name, UE_NET_GET_SERIALIZER(SerializerName)); return StaticInstance; };
227#define UE_NET_IMPLEMENT_NAMED_STRUCT_NETSERIALIZER_WITH_CUSTOM_FRAGMENT_INFO(Name, SerializerName, CreateAndRegisterReplicationFragmentFunction) \
228const UE::Net::FPropertyNetSerializerInfo& GetPropertyNetSerializerInfo_##Name() \
230 static UE::Net::FNamedStructPropertyNetSerializerInfo StaticInstance(Name, UE_NET_GET_SERIALIZER(SerializerName)); \
231 StaticInstance.SetCreateAndRegisterReplicationFragmentFunction(CreateAndRegisterReplicationFragmentFunction); \
232 return StaticInstance; \
236#define UE_NET_IMPLEMENT_NAMED_STRUCT_LASTRESORT_NETSERIALIZER_INFO(StructName) \
237const UE::Net::FPropertyNetSerializerInfo& GetPropertyNetSerializerInfo_##StructName() { static UE::Net::FNamedStructLastResortPropertyNetSerializerInfo StaticInstance(StructName); return StaticInstance; };
240#define UE_NET_IMPLEMENT_NAMED_STRUCT_LASTRESORT_NETSERIALIZER_INFO_WITH_SIZE_OVERRIDE(StructName, MaxBits) \
241const UE::Net::FPropertyNetSerializerInfo& GetPropertyNetSerializerInfo_##StructName() { static UE::Net::FNamedStructLastResortPropertyNetSerializerInfo StaticInstance(StructName, MaxBits); return StaticInstance; };
244#define UE_NET_REGISTER_NETSERIALIZER_INFO(Name) \
245UE::Net::FPropertyNetSerializerInfoRegistry::Register(&GetPropertyNetSerializerInfo_##Name());
249#define UE_NET_UNREGISTER_NETSERIALIZER_INFO(Name) \
250UE::Net::FPropertyNetSerializerInfoRegistry::Unregister(&GetPropertyNetSerializerInfo_##Name());
252#define UE_NET_UNREGISTER_NETSERIALIZER_INFO(...)
256#define UE_NET_IMPLEMENT_NETSERIALIZER_REGISTRY_DELEGATES(Name) \
257struct F##Name##NetSerializerRegistryDelegates : protected UE::Net::FNetSerializerRegistryDelegates \
259 ~F##Name##NetSerializerRegistryDelegates() { UE_NET_UNREGISTER_NETSERIALIZER_INFO(PropertyNetSerializerRegistry_NAME_##Name); } \
260 virtual void OnPreFreezeNetSerializerRegistry() override { UE_NET_REGISTER_NETSERIALIZER_INFO(PropertyNetSerializerRegistry_NAME_##Name); } \
262static F##Name##NetSerializerRegistryDelegates Name##NetSerializerRegistryDelegates;
265#define UE_NET_IMPLEMENT_FORWARDING_NETSERIALIZER_AND_REGISTRY_DELEGATES(Name, SerializerName) \
266 static const FName PropertyNetSerializerRegistry_NAME_##Name( PREPROCESSOR_TO_STRING(Name) ); \
267 UE_NET_IMPLEMENT_NAMED_STRUCT_NETSERIALIZER_INFO(PropertyNetSerializerRegistry_NAME_##Name, SerializerName); \
268 UE_NET_IMPLEMENT_NETSERIALIZER_REGISTRY_DELEGATES(Name)
272#define UE_NET_IMPLEMENT_NAMED_STRUCT_LASTRESORT_NETSERIALIZER_AND_REGISTRY_DELEGATES(Name) \
273 UE_NET_IS_DECLARED_TYPE(Name); \
274 static const FName PropertyNetSerializerRegistry_NAME_##Name( PREPROCESSOR_TO_STRING(Name) ); \
275 UE_NET_IMPLEMENT_NAMED_STRUCT_LASTRESORT_NETSERIALIZER_INFO(PropertyNetSerializerRegistry_NAME_##Name); \
276 UE_NET_IMPLEMENT_NETSERIALIZER_REGISTRY_DELEGATES(Name)
279#define UE_NET_IMPLEMENT_NAMED_STRUCT_LASTRESORT_NETSERIALIZER_AND_REGISTRY_DELEGATES_WITH_SIZE_OVERRIDE(Name, MaxBits) \
280 UE_NET_IS_DECLARED_TYPE(Name); \
281 static const FName PropertyNetSerializerRegistry_NAME_##Name( PREPROCESSOR_TO_STRING(Name) ); \
282 UE_NET_IMPLEMENT_NAMED_STRUCT_LASTRESORT_NETSERIALIZER_INFO_WITH_SIZE_OVERRIDE(PropertyNetSerializerRegistry_NAME_##Name, MaxBits); \
283 UE_NET_IMPLEMENT_NETSERIALIZER_REGISTRY_DELEGATES(Name)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition NameTypes.h:617
Definition UnrealType.h:174
Definition UnrealType.h:6306
Definition PropertyNetSerializerInfoRegistry.h:75
static IRISCORE_API const FPropertyNetSerializerInfo * GetNopNetSerializerInfo()
Definition PropertyNetSerializerInfoRegistry.cpp:214
static IRISCORE_API void Unregister(const FPropertyNetSerializerInfo *Info)
Definition PropertyNetSerializerInfoRegistry.cpp:43
static IRISCORE_API void Freeze()
Definition PropertyNetSerializerInfoRegistry.cpp:55
static IRISCORE_API const FPropertyNetSerializerInfo * FindSerializerInfo(const FProperty *Property)
Definition PropertyNetSerializerInfoRegistry.cpp:142
static IRISCORE_API const FPropertyNetSerializerInfo * FindStructSerializerInfo(const FName Name)
Definition PropertyNetSerializerInfoRegistry.cpp:187
static IRISCORE_API void Reset()
Definition PropertyNetSerializerInfoRegistry.cpp:49
Definition NetworkVersion.cpp:28
void ValidateForwardingNetSerializerTraits(const FNetSerializer *Serializer, EReplicationStateTraits UsedReplicationStateTraits)
Definition PropertyNetSerializerInfoRegistry.cpp:219
FReplicationFragment *(* CreateAndRegisterReplicationFragmentFunc)(UObject *Owner, const FReplicationStateDescriptor *Descriptor, FFragmentRegistrationContext &Context)
Definition CoreNet.h:55
constexpr auto IsDeclaredType(StructName *) -> decltype(sizeof(StructName))
Definition PropertyNetSerializerInfoRegistry.h:36
EReplicationStateTraits
Definition ReplicationStateDescriptor.h:163
Definition NetSerializerConfig.h:17
Definition PropertyNetSerializerInfoRegistry.h:158
bool bExcludeFromDefaultStateHash
Definition PropertyNetSerializerInfoRegistry.h:173
virtual IRISCORE_API const FNetSerializer * GetNetSerializer(const FProperty *Property) const override final
Definition PropertyNetSerializerInfoRegistry.cpp:110
virtual IRISCORE_API FNetSerializerConfig * BuildNetSerializerConfig(void *NetSerializerConfigBuffer, const FProperty *Property) const override final
Definition PropertyNetSerializerInfoRegistry.cpp:120
virtual IRISCORE_API bool CanUseDefaultConfig(const FProperty *Property) const override final
Definition PropertyNetSerializerInfoRegistry.cpp:115
virtual IRISCORE_API bool IsSupported(const FProperty *Property) const override
Definition PropertyNetSerializerInfoRegistry.cpp:105
virtual IRISCORE_API const FFieldClass * GetPropertyTypeClass() const override
Definition PropertyNetSerializerInfoRegistry.cpp:100
uint32 MaxQuantizedSizeBits
Definition PropertyNetSerializerInfoRegistry.h:170
IRISCORE_API FLastResortPropertyNetSerializerInfo()
Definition PropertyNetSerializerInfoRegistry.cpp:88
Definition PropertyNetSerializerInfoRegistry.h:177
FNamedStructLastResortPropertyNetSerializerInfo(const FName InPropertyFName, const uint32 InMaxBits)
Definition PropertyNetSerializerInfoRegistry.h:184
FNamedStructLastResortPropertyNetSerializerInfo(const FName InPropertyFName)
Definition PropertyNetSerializerInfoRegistry.h:178
virtual IRISCORE_API const FFieldClass * GetPropertyTypeClass() const override
Definition PropertyNetSerializerInfoRegistry.cpp:131
virtual IRISCORE_API bool IsSupported(const FProperty *Property) const override
Definition PropertyNetSerializerInfoRegistry.cpp:136
Definition PropertyNetSerializerInfoRegistry.h:128
FNamedStructPropertyNetSerializerInfo(const FName InPropertyFName, const FNetSerializer &InSerializer)
Definition PropertyNetSerializerInfoRegistry.h:131
TSimplePropertyNetSerializerInfo< FStructProperty > Super
Definition PropertyNetSerializerInfoRegistry.h:129
virtual bool IsSupported(const FProperty *Property) const override
Definition PropertyNetSerializerInfoRegistry.h:137
void SetCreateAndRegisterReplicationFragmentFunction(CreateAndRegisterReplicationFragmentFunc InCreateAndRegisterReplicationFragmentFunction)
Definition PropertyNetSerializerInfoRegistry.h:148
virtual CreateAndRegisterReplicationFragmentFunc GetCreateAndRegisterReplicationFragmentFunction() const
Definition PropertyNetSerializerInfoRegistry.h:143
Definition NetSerializer.h:377
Definition PropertyNetSerializerInfoRegistry.h:52
virtual const FNetSerializer * GetNetSerializer(const FProperty *Property) const
Definition PropertyNetSerializerInfoRegistry.h:55
virtual const FFieldClass * GetPropertyTypeClass() const
Definition PropertyNetSerializerInfoRegistry.h:53
virtual bool IsSupported(const FProperty *Property) const
Definition PropertyNetSerializerInfoRegistry.h:54
virtual bool CanUseDefaultConfig(const FProperty *Property) const
Definition PropertyNetSerializerInfoRegistry.h:56
bool IsSupportedStruct(FName InStructName) const
Definition PropertyNetSerializerInfoRegistry.h:61
virtual const FNetSerializerConfig * BuildNetSerializerConfig(void *NetSerializerConfigBuffer, const FProperty *Property) const
Definition PropertyNetSerializerInfoRegistry.h:57
FName StructName
Definition PropertyNetSerializerInfoRegistry.h:68
virtual CreateAndRegisterReplicationFragmentFunc GetCreateAndRegisterReplicationFragmentFunction() const
Definition PropertyNetSerializerInfoRegistry.h:59
Definition PropertyNetSerializerInfoRegistry.h:117
const FNetSerializer & Serializer
Definition PropertyNetSerializerInfoRegistry.h:118
virtual const FFieldClass * GetPropertyTypeClass() const override
Definition PropertyNetSerializerInfoRegistry.h:121
virtual FNetSerializerConfig * BuildNetSerializerConfig(void *NetSerializerConfigBuffer, const FProperty *Property) const override
Definition PropertyNetSerializerInfoRegistry.h:123
TSimplePropertyNetSerializerInfo(const FNetSerializer &InSerializer)
Definition PropertyNetSerializerInfoRegistry.h:120
virtual const FNetSerializer * GetNetSerializer(const FProperty *Property) const override
Definition PropertyNetSerializerInfoRegistry.h:122