UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
StructNetTokenDataStore.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
10#include "Iris/Core/IrisLog.h"
12
13namespace UE::Net
14{
15 /*
16 * This is a simplification of the process of building novel NetToken types and NetTokenDataStores for those types.
17 *
18 * The "General Idea" here is that you can define a USTRUCT that can be easily serialized as a NetToken instead of
19 * serializing the entirety of the data structure every time. This is typically useful for large data structures where the data changes infrequently
20 *
21 * or
22 *
23 * where the data is commonly one of a small-ish set of permutations of that data. There are probably other useful cases as well, but these uses are readily apparent.
24 *
25 * Each NetToken refers to single, immutable, instance of the Struct you pass in/out. Every instance of the Struct that returns the same GetUniqueKey has the same NetToken.
26 * Conceptually this means that you can't store pointers or references in them to sub pieces of data that change.
27 *
28 * You can't store references to other NetToken types, or other reference types... i.e. no properties that also are exported as NetTokens or ObjectReferences (NetGuids/NetRefHandles)
29 * You should generally consider that you can only store primitive types in the NetToken struct.
30 *
31 * This means no: FNames, FGameplayTags or anything with a NetGuid.
32 *
33 * Additionally, this means that the data permutations that you are going to iterate are finite, or effectively finite. This isn't magic and it is not a compression algorithm.
34 * We also aren't doing anything "smart" here about storing off the ShadowCopies of the input Structs. We very naively keep an entire copy of the struct in memory and there is no age out mechanism.
35 * If you try to put "big" pieces of data in here we will just be making copies of that data. It also means complicated hashing mechanics for GetUniqueKey will eat up a lot of time.
36 *
37 * Again, its a simplification, not magic. You still want to be judicious in the data you are choosing to replicate.
38 *
39 * Most/All of the "Hard Bits" are implemented for you in a 'reasonable' default. You will need to implement custom versions if you need more concrete control.
40 * - Replay Compatibility
41 * - Default Serialization/Quantization
42 * - Bookkeeping
43 * - Maintaining Shadow Copies of the required data
44 *
45 * Example: Pretend that StringTokenStore didn't exist and I have a RPC that I want to call with a couple of FStrings that come from a set of known Strings.
46 *
47 * UPROPERTY(Replicated)
48 * TArray<FString> KnownStrings =
49 * {
50 * TEXT("First string"),
51 * TEXT("Second string, this string is super long and would take up just a bunch of bytes to transmit. Just pretend its a huge string ok, thanks."),
52 * ....
53 * TEXT("Last String")
54 * };
55 *
56 * When asked to set this up we have the naive implementation:
57 * USTRUCT()
58 * struct FTwoStrings
59 * {
60 * UPROPERTY()
61 * FString Left;
62 * UPROPERTY()
63 * FString Right;
64 * };
65 *
66 * ...
67 * UFUCNTION(Server,Reliable)
68 * void SendSelectionToServer(FTwoStrings Data);
69 *
70 * ...
71 * void OnTick(double DeltaTime)
72 * {
73 * ...
74 * SendSelectionToServer({Left,Right});
75 * }
76 *
77 * Given this naive implementation we can (hopefully immediately) see the multitude of problems.
78 * In this simplistic example we could probably come up with several immediate fixes.
79 * Let's pretend we have to actually send this data on every tick.
80 *
81 * We can spend a good deal of time coming up with custom serializer that would use significantly less data or some other representation for the data...
82 * For example:
83 * USTRUCT()
84 * struct FTwoStringIdx
85 * {
86 * UPROPERTY()
87 * int32 Left;
88 * UPROPERTY()
89 * int32 Right;
90 * };
91 *
92 * But this suffers from a fundamental problem that isn't immediately obvious. KnownStrings is mutable and might be changing...
93 * And now we have a synchronization problem, where we are trying to maintain the state of KnownStrings, the index and the versioning of both.
94 * This rapidly grows in complexity beyond a simple "how do we make this use less data". We have to figure out a strategy on determining agreement on state and ordering and more.
95 * Ex: Which updates first? Do we need to maintain a history of known states in the event of delayed packets,etc,etc...
96 *
97 * Even though the list of possible strings is known/finite, the mutable nature of the KnownStrings array in conjunction with the indeterminate ordering of network communication makes this a much more difficult problem.
98 *
99 * This problem can be solved like this.
100 *
101 * --------------
102 * TwoStrings.h
103 * --------------
104 * USTRUCT()
105 * struct FTwoStrings : FNetTokenStructBase
106 * {
107 * GENERATED_BODY()
108 * UE_NET_NETTOKEN_GENERATED_BODY(TwoStrings) // Note this is the struct name minus the 'F'
109 * UPROPERTY()
110 * FString Left;
111 * UPROPERTY()
112 * FString Right;
113 * uint64 GetUniqueKey()
114 * {
115 * FString Combo = Left+Right;
116 * return CityHash64((const char*)Combo, Combo.Num()*sizeof(TCHAR));
117 * }
118 * };
119 *
120 * UE_NET_DECLARE_NAMED_NETTOKEN_STRUCT_SERIALIZERS(TwoStrings, YOUR_MODULES_API)
121 * --------------
122 * TwoStrings.cpp
123 * --------------
124 * UE_NET_IMPLEMENT_NAMED_NETTOKEN_STRUCT_SERIALIZERS(TwoStrings)
125 *
126 * --------------
127 * DefaultEngine.ini
128 * --------------
129 * +ReservedTypeIds=(StoreTypeName="TwoStrings", TypeID=4) # Don't forget to use an unused TypeID.
130 *
131 * Having a UPROPERTY() or RPC UFUNCTION() will automatically serialize the type as the NetToken.
132 *
133 * It is also possible to explicitly declare the DataStore, and use it in a custom NetSerialize.
134 * class FTwoStringDataStore : public UE::Net::TStructNetTokenDataStore<FTwoStrings>
135 * {
136 * public:
137 * explicit FTwoStringDataStore(UE::Net::FNetTokenStore& InTokenStore)
138 * : UE::Net::TStructNetTokenDataStore<FTwoStrings>(InTokenStore)
139 * {
140 * }
141 * };
142 *
143 * It is possible to use these in custom serializers like this:
144 * FTwoStrings Data{Left,Right};
145 * FTwoStringDataStore::NetSerializeAndExportToken(Ar,Map,Data);
146 */
147
148template <typename T>
149class TStructNetTokenDataStoreHelper;
150
151template <typename T>
153{
155
164
165 // Create a token for input struct
167 {
168 FNetToken Result;
170 if (Key.IsValid())
171 {
172 Result = GetNetTokenFromKey(Key);
173 if (!Result.IsValid())
174 {
175 Result = CreateAndStoreTokenForKey(Key);
176 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::GetOrCreateToken %s CreatedToken %s."), *GetTokenStoreName().ToString(), *Result.ToString());
177 }
178 }
179 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::GetOrCreateToken %s GetOrCreateToken %s."), *GetTokenStoreName().ToString(), *Result.ToString());
180 return Result;
181 }
182
183 // Resolve NetToken, to resolve remote tokens RemoteTokenStoreState must be valid
184 const T& ResolveToken(FNetToken Token, const FNetTokenStoreState* RemoteTokenStoreState = nullptr) const
185 {
187 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::ResolveToken Starting up %s - %s. Local: %d, TokenStoreState: %p"), *GetTokenStoreName().ToString(), *Token.ToString(), TokenStore.IsLocalToken(Token), TokenStoreState);
188 if (Token.IsValid() && ensureMsgf(TokenStoreState, TEXT("TStructNetTokenDataStore::ResolveToken Needs valid TokenStoreState to resolve %s"), *Token.ToString()))
189 {
191 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::ResolveToken Got Token Key %s - %s. StoreKeyIsValid: %d, StoreKeyID: %d, NumStoredStates: %d"), *GetTokenStoreName().ToString(), *Token.ToString(), StoreKey.IsValid(), StoreKey.GetKeyIndex(), StoredStates.Num());
192 if (StoreKey.IsValid() && StoredStates.Contains(StoreKey.GetKeyIndex()))
193 {
194 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::ResolveToken %s Succeeded %s."), *GetTokenStoreName().ToString(), *Token.ToString());
195 return StoredStates[StoreKey.GetKeyIndex()];
196 }
197 else
198 {
199 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::ResolveToken %s failed to resolve %s."), *GetTokenStoreName().ToString(), *Token.ToString());
200 }
201 }
202 return InvalidState;
203 }
204
205 // Resolve a token received from remote
207 {
208 return ResolveToken(Token, &NetTokenStoreState);
209 }
210
212 {
213 return T::GetTokenStoreName();
214 }
215
216 static const T& GetInvalidState()
217 {
218 return InvalidState;
219 }
220
221 // Need to declare as a delegate that is bound elsewhere to reduce the includes. We can't eliminate them, since the specialization module needs to include the engine parts necessary to make this work
222 // and we can't circular depend on the engine module to implement these details. We could write the helpers somewhere in the engine, though there isn't a great place to do this.
225protected:
227
228 // Serialize data for a token, note there is not validation in this function
230 {
231 if (!TokenStoreKey.IsValid() || !StoredStates.Contains(TokenStoreKey.GetKeyIndex()))
232 {
233 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::WriteTokenData %s KeyIndex: %d FAILED"),*GetTokenStoreName().ToString(),TokenStoreKey.GetKeyIndex());
235 return;
236 }
237
238 if (!Descriptor.IsValid())
239 {
240 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::WriteTokenData %s Failed. Serialization Descriptor Invalid."),*GetTokenStoreName().ToString());
242 return;
243 }
244
245 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::WriteTokenData %s KeyIndex: %d Serializing"),*GetTokenStoreName().ToString(),TokenStoreKey.GetKeyIndex());
246 T TempValue = StoredStates.FindRef(TokenStoreKey.GetKeyIndex());
247
249
250 if (Context.HasError())
251 {
252 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::WriteTokenData, %s, FAILED"), *GetTokenStoreName().ToString());
253 }
254 }
255
256 virtual void WriteTokenData(FArchive& Ar, FNetTokenStoreKey TokenStoreKey, UPackageMap* Map = nullptr) const override
257 {
258 if (!TokenStoreKey.IsValid()
259 || !StoredStates.Contains(TokenStoreKey.GetKeyIndex()))
260 {
261 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::WriteTokenData %s KeyIndex: %d FAILED"),*GetTokenStoreName().ToString(),TokenStoreKey.GetKeyIndex());
262 return;
263 }
264 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::WriteTokenData %s KeyIndex: %d Serializing"),*GetTokenStoreName().ToString(),TokenStoreKey.GetKeyIndex());
265 T TempValue = StoredStates.FindRef(TokenStoreKey.GetKeyIndex());
266 NetSerializeScriptDelegate.ExecuteIfBound(TempValue, Ar, Map);
267 if (Ar.IsError())
268 {
269 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::WriteTokenData, %s, FAILED"), *GetTokenStoreName().ToString());
270 }
271 }
272
273 // Read data for a token, returns a valid StoreKey if successful read
275 {
276 if (!Descriptor.IsValid())
277 {
278 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::ReadTokenData %s Failed. Serialization Descriptor Invalid."),*GetTokenStoreName().ToString());
279 return FNetTokenStoreKey();
280 }
281
282 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::ReadTokenData %s"), *GetTokenStoreName().ToString());
283 T Value;
285 if (!Context.HasErrorOrOverflow())
286 {
287 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::ReadTokenData %s, Succeeded"),*GetTokenStoreName().ToString());
289 }
290 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::ReadTokenData, %s, FAILED"), *GetTokenStoreName().ToString());
291 return FNetTokenStoreKey();
292 }
293
294 virtual FNetTokenStoreKey ReadTokenData(FArchive& Ar, const FNetToken& NetToken, UPackageMap* Map = nullptr) override
295 {
296 T Value;
297 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::ReadTokenData %s"), *GetTokenStoreName().ToString());
298 NetSerializeScriptDelegate.ExecuteIfBound(Value, Ar, Map);
299 if (!Ar.IsError())
300 {
301 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::ReadTokenData %s, Succeeded"),*GetTokenStoreName().ToString());
303 }
304 UE_LOG(LogNetToken, Error, TEXT("TStructNetTokenDataStore::ReadTokenData, %s, FAILED"), *GetTokenStoreName().ToString());
305 return FNetTokenStoreKey();
306 }
307
308 // Creates a persistent copy of the input struct
310 {
312 const uint64 HashKey = InNetTokenData.GetUniqueKey();
313 if (HashToKey.Contains(HashKey))
314 {
315 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::GetOrCreatePersistentState %s FoundToken, Hash: %llu KeyIndex: %d"), *GetTokenStoreName().ToString(), HashKey, HashToKey[HashKey].GetKeyIndex());
316 return HashToKey[HashKey];
317 }
318
320 if (NewKey.IsValid())
321 {
322 HashToKey.Add(HashKey, NewKey);
323 StoredStates.Add(NewKey.GetKeyIndex(), InNetTokenData);
324 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::GetOrCreatePersistentState %s Adding New, Hash: %llu KeyIndex: %d"), *GetTokenStoreName().ToString(), HashKey, HashToKey[HashKey].GetKeyIndex());
325 return NewKey;
326 }
327 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::GetOrCreatePersistentState %s ERROR, Hash: %llu"), *GetTokenStoreName().ToString(), HashKey);
328 return FNetTokenStoreKey();
329 }
330
331private:
332 inline static UScriptStruct* Struct;
335 TMap<uint32, T> StoredStates;
336 static inline T InvalidState = T();
337
338 // Helper for NetSerializerDescriptor setup
340 {
341 public:
342 bool HasPostFreezeBeenCalled() const { return bPostFreezeHasBeenCalled; }
343
344 private:
345 bool bPostFreezeHasBeenCalled = false;
346 virtual void OnPostFreezeNetSerializerRegistry() override
347 {
348 bPostFreezeHasBeenCalled = true;
349 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::OnPostFreezeNetSerializerRegistry %s"), *GetTokenStoreName().ToString());
350 if (!Struct)
351 {
353 }
354 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::OnPostFreezeNetSerializerRegistry %s Struct: %s"), *GetTokenStoreName().ToString(), *GetNameSafe(Struct));
355
356 if (!Descriptor.IsValid())
357 {
358 FReplicationStateDescriptorBuilder::FParameters Params;
359
360 // TODO: this need flags to not pickup serializer using NetToken to write the data struct.
361 Params.SkipCheckForCustomNetSerializerForStruct = 1U;
362
364 UE_LOG(LogNetToken, VeryVerbose, TEXT("TStructNetTokenDataStore::OnPostFreezeNetSerializerRegistry %s Descriptor: %s"), *GetTokenStoreName().ToString(), Descriptor ? TEXT("Exists") : TEXT("NULL"));
365 }
366 }
367 };
368public:
369 // Compiler tries to optimize out the NetSerializer since it isn't obvious that anything is referencing it during module compilation.
373};
374
375// Helper to implement a NetSerializer for a struct that should serialize using a NetTokenStore
376template <typename T, typename NetTokenDataStoreT = TStructNetTokenDataStore<T>>
378{
379public:
380 // Version
381 static const uint32 Version = 0;
382
383 typedef T SourceType;
386 static inline const ConfigType DefaultConfig = ConfigType();
387
388 // Iris
394};
395
396template <typename T, typename NetTokenDataStoreT>
398{
399 const FNetToken& NetToken = *reinterpret_cast<FNetToken*>(Args.Source);
400
401 // Tokens will differ, so we cannot store them in the default statehash.
402 if (Context.IsInitializingDefaultState())
403 {
404 return;
405 }
406
407 // Write token without type
408 Context.GetNetTokenStore()->WriteNetTokenWithKnownType<NetTokenDataStoreT>(Context, NetToken);
409
410 // Add to pending exports for later export
412}
413
414template <typename T, typename NetTokenDataStoreT>
416{
417 FNetToken& NetToken = *reinterpret_cast<FNetToken*>(Args.Target);
418 NetToken = Context.GetNetTokenStore()->ReadNetTokenWithKnownType<NetTokenDataStoreT>(Context);
419}
420
421template <typename T, typename NetTokenDataStoreT>
423{
424 const SourceType& SourceValue = *reinterpret_cast<const SourceType*>(Args.Source);
425 FNetToken& TargetValue = *reinterpret_cast<FNetToken*>(Args.Target);
426
427 TargetValue = FNetToken();
428
429 if (NetTokenDataStoreT* NetTokenDataStore = Context.GetNetTokenStore()->GetDataStore<NetTokenDataStoreT>())
430 {
431 TargetValue = NetTokenDataStore->GetOrCreateToken(SourceValue);
432 }
433 else
434 {
435 UE_LOG(LogIris, Error, TEXT("TStructAsNetTokenNetSerializerImpl<T>::Quantize Could not find required FNetTokenDataStore %s"), *NetTokenDataStoreT::GetTokenStoreName().ToString());
436 ensure(false);
437 }
438}
439
440template <typename T, typename NetTokenDataStoreT>
442{
443 const FNetToken& Source = *reinterpret_cast<const FNetToken*>(Args.Source);
444 SourceType& Target = *reinterpret_cast<SourceType*>(Args.Target);
445
446 if (NetTokenDataStoreT* NetTokenDataStore = Context.GetNetTokenStore()->GetDataStore<NetTokenDataStoreT>())
447 {
448 Target = NetTokenDataStore->ResolveToken(Source, Context.GetRemoteNetTokenStoreState());
449 }
450 else
451 {
452 UE_LOG(LogIris, Error, TEXT("TStructAsNetTokenNetSerializerImpl<T>::Deqquantize Could not find required FNetTokenDataStore %s"), *NetTokenDataStoreT::GetTokenStoreName().ToString());
453 ensure(false);
454
455 Target = SourceType();
456 }
457}
458template <typename T, typename NetTokenDataStoreT>
460{
461 if (Args.bStateIsQuantized)
462 {
463 const FNetToken& Value0 = *reinterpret_cast<const FNetToken*>(Args.Source0);
464 const FNetToken& Value1 = *reinterpret_cast<const FNetToken*>(Args.Source1);
465
466 // Need to compare actual Tags to properly compare non-auth and auth token
467 if (Value0.IsAssignedByAuthority() != Value1.IsAssignedByAuthority())
468 {
469 NetTokenDataStoreT* NetTokenDataStore = Context.GetNetTokenStore()->GetDataStore<NetTokenDataStoreT>();
470 const UE::Net::FNetTokenStoreState* RemoteNetTokenStoreState = Context.GetRemoteNetTokenStoreState();
471
472 const SourceType Source0 = NetTokenDataStore->ResolveToken(Value0, RemoteNetTokenStoreState);
473 const SourceType Source1 = NetTokenDataStore->ResolveToken(Value1, RemoteNetTokenStoreState);
474
475 if (Source0 != Source1)
476 {
477 return false;
478 }
479 }
480 else if (Value0 != Value1)
481 {
482 return false;
483 }
484 return true;
485 }
486 else
487 {
488 const SourceType& Value0 = *reinterpret_cast<SourceType*>(Args.Source0);
489 const SourceType& Value1 = *reinterpret_cast<SourceType*>(Args.Source1);
490
491 return Value0 == Value1;
492 }
493}
494
495} // End of namespace
496
497
498
499
500
501
502
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
#define ensure( InExpression)
Definition AssertionMacros.h:464
#define UE_NONCOPYABLE(TypeName)
Definition CoreMiscDefines.h:457
#define UE_DISABLE_OPTIMIZATION_SHIP
Definition CoreMiscDefines.h:45
#define UE_ENABLE_OPTIMIZATION_SHIP
Definition CoreMiscDefines.h:51
FString GetNameSafe(const FField *InField)
Definition Field.h:1230
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
#define LLM_SCOPE_BYTAG(...)
Definition LowLevelMemTracker.h:1099
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsError() const
Definition Archive.h:362
Definition NameTypes.h:617
Definition UnrealString.h.inl:34
Definition RefCounting.h:454
UE_FORCEINLINE_HINT bool IsValid() const
Definition RefCounting.h:594
Definition NetSerializationContext.h:31
Definition NetSerializerDelegates.h:19
Definition NetTokenStore.h:98
IRISCORE_API FNetToken CreateAndStoreTokenForKey(FNetTokenStoreKey Key)
Definition NetTokenStore.cpp:87
FNetTokenStore & TokenStore
Definition NetTokenStore.h:176
FNetTokenDataStore::FNetTokenStoreKey GetNextNetTokenStoreKey()
Definition NetTokenStore.h:408
IRISCORE_API FNetTokenDataStore::FNetTokenStoreKey GetTokenKey(FNetToken Token, const FNetTokenStoreState &TokenStoreState) const
Definition NetTokenStore.cpp:71
IRISCORE_API FNetToken GetNetTokenFromKey(FNetTokenStoreKey) const
Definition NetTokenStore.cpp:116
Definition NetTokenStore.cpp:22
Definition NetTokenStore.h:189
const FNetTokenStoreState * GetLocalNetTokenStoreState() const
Definition NetTokenStore.h:261
static IRISCORE_API void AppendExport(FNetSerializationContext &, FNetToken NetToken)
Definition NetTokenStore.cpp:537
bool IsLocalToken(const FNetToken NetToken) const
Definition NetTokenStore.h:210
Definition NetToken.h:22
bool IsValid() const
Definition NetToken.h:52
bool IsAssignedByAuthority() const
Definition NetToken.h:57
FString ToString() const
Definition NetToken.h:118
static IRISCORE_API TRefCountPtr< const FReplicationStateDescriptor > CreateDescriptorForStruct(const UStruct *InStruct, const FParameters &Parameters=FParameters())
Definition ReplicationStateDescriptorBuilder.cpp:2487
Definition StructNetTokenDataStore.h:378
FNetToken QuantizedType
Definition StructNetTokenDataStore.h:384
static const uint32 Version
Definition StructNetTokenDataStore.h:381
static void Dequantize(FNetSerializationContext &, const FNetDequantizeArgs &)
Definition StructNetTokenDataStore.h:441
static void Deserialize(FNetSerializationContext &, const FNetDeserializeArgs &)
Definition StructNetTokenDataStore.h:415
static void Quantize(FNetSerializationContext &, const FNetQuantizeArgs &)
Definition StructNetTokenDataStore.h:422
struct FNetSerializerConfig ConfigType
Definition StructNetTokenDataStore.h:385
static void Serialize(FNetSerializationContext &, const FNetSerializeArgs &)
Definition StructNetTokenDataStore.h:397
T SourceType
Definition StructNetTokenDataStore.h:383
static bool IsEqual(FNetSerializationContext &, const FNetIsEqualArgs &)
Definition StructNetTokenDataStore.h:459
static const ConfigType DefaultConfig
Definition StructNetTokenDataStore.h:386
Definition StructNetTokenDataStoreHelper.h:19
Definition StructNetTokenDataStore.h:153
const T & ResolveRemoteToken(FNetToken Token, const FNetTokenStoreState &NetTokenStoreState) const
Definition StructNetTokenDataStore.h:206
T DataType
Definition StructNetTokenDataStore.h:158
static const T & GetInvalidState()
Definition StructNetTokenDataStore.h:216
DECLARE_DELEGATE_ThreeParams(TNetSerializeTokenType, T &, FArchive &, UPackageMap *)
virtual FNetTokenStoreKey ReadTokenData(FNetSerializationContext &Context, const FNetToken &NetToken) override
Definition StructNetTokenDataStore.h:274
static TNetSerializeTokenType NetSerializeScriptDelegate
Definition StructNetTokenDataStore.h:224
static UE_DISABLE_OPTIMIZATION_SHIP TStructNetTokenDataStore< T >::FNetSerializerRegistryDelegates NetSerializerRegistryDelegates
Definition StructNetTokenDataStore.h:371
const T & ResolveToken(FNetToken Token, const FNetTokenStoreState *RemoteTokenStoreState=nullptr) const
Definition StructNetTokenDataStore.h:184
FNetToken GetOrCreateToken(const T &InData)
Definition StructNetTokenDataStore.h:166
virtual FNetTokenStoreKey ReadTokenData(FArchive &Ar, const FNetToken &NetToken, UPackageMap *Map=nullptr) override
Definition StructNetTokenDataStore.h:294
virtual void WriteTokenData(FArchive &Ar, FNetTokenStoreKey TokenStoreKey, UPackageMap *Map=nullptr) const override
Definition StructNetTokenDataStore.h:256
FNetTokenStoreKey GetOrCreatePersistentState(const T &InNetTokenData)
Definition StructNetTokenDataStore.h:309
static FName GetTokenStoreName()
Definition StructNetTokenDataStore.h:211
virtual void WriteTokenData(FNetSerializationContext &Context, FNetTokenStoreKey TokenStoreKey) const override
Definition StructNetTokenDataStore.h:229
Definition CoreNet.h:191
Definition Class.h:1720
Definition NetworkVersion.cpp:28
void WriteStruct(FNetSerializationContext &Context, NetSerializerValuePointer InValue, const FReplicationStateDescriptor *Descriptor)
Definition StructNetSerializerUtil.cpp:10
const FName GNetError_InvalidValue("Invalid value")
Definition NetErrorContext.h:18
UPTRINT NetSerializerValuePointer
Definition NetSerializer.h:139
void ReadStruct(FNetSerializationContext &Context, NetSerializerValuePointer OutValue, const FReplicationStateDescriptor *Descriptor)
Definition StructNetSerializerUtil.cpp:40
const FName GNetError_InternalError("Internal error")
Definition NetErrorContext.h:19
Definition NetSerializerConfig.h:17
Definition NetSerializer.h:259
NetSerializerValuePointer Source
Definition NetSerializer.h:261
NetSerializerValuePointer Target
Definition NetSerializer.h:263
Definition NetSerializer.h:194
NetSerializerValuePointer Target
Definition NetSerializer.h:195
Definition NetSerializer.h:274
NetSerializerValuePointer Source1
Definition NetSerializer.h:278
NetSerializerValuePointer Source0
Definition NetSerializer.h:276
bool bStateIsQuantized
Definition NetSerializer.h:280
Definition NetSerializer.h:243
NetSerializerValuePointer Target
Definition NetSerializer.h:247
NetSerializerValuePointer Source
Definition NetSerializer.h:245
Definition NetSerializer.h:183
NetSerializerValuePointer Source
Definition NetSerializer.h:185