![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "CoreTypes.h"#include "Net/Core/NetToken/NetToken.h"#include "UObject/NameTypes.h"#include "Containers/Array.h"#include "Containers/Map.h"#include "Templates/Tuple.h"#include "NetTokenStore.generated.h"Go to the source code of this file.
Classes | |
| struct | FNetTokenStoreTypeIdPair |
| class | UNetTokenTypeIdConfig |
| class | UE::Net::FNetTokenDataStore |
| class | UE::Net::FNetTokenDataStore::FNetTokenStoreKey |
| class | UE::Net::FNetTokenStore |
| struct | UE::Net::FNetTokenStore::FInitParams |
Namespaces | |
| namespace | UE |
| namespace | UE::Net |
| namespace | UE::Net::Private |
Macros | |
| #define | UE_NET_VALIDATE_NETTOKENTYPE 1 |
| #define UE_NET_VALIDATE_NETTOKENTYPE 1 |
The idea with NetTokens is to allow export of "stable"-pieces of data such as string and names by replacing them with a NetToken during quantization/serialization. The data associated with a NetToken is then exported separately from the data. As soon as the exported data has been acknowledged the data will only be serialized using the NetToken.
As both Client and Server can communicate NetTokens, each side can end up assigning different tokens that will differs from each other. Here is a high-level overview of the algorithm which works slightly differently based on if using Iris replication or the old replication system.
The sending side looks-up or creates a NetToken for the Data being serialized. Servers will mark assigned NetTokens as authoritative, while clients generate a temporary NetToken. When a network bunch/batch that contains NetToken is being sent, there is a per-connection look-up to see if we need to append and serialize exports or not, if the data associated with the token has been acknowledged the token will not be exported again.
On the receiving side, imported exports are always guaranteed to have been processed before we attempt to read received data containing NetTokens which allows the receiving side to resolve the NetToken to get the actual data.
The implementation details differs a bit depending on if we are using iris replication or old style replication.
A current example that us used by both systems is GameplayTags, For Iris: See GameplayTagNetSerializer.cpp, for the old replication system: See: GameplayTagContainer.cpp.