While TMaps are not supported for replication, previously one workaround for this was to wrap the TMap property in a container struct. Users could then implement a custom NetSerialize function for this struct and the map. However, FHeaderParser::ValidateScriptStructOkForNet throws an error in this case unless the struct's TMap property is marked as NotReplicated, which may lead to confusion if the map is actually being serialized across the network.
Create a struct with a TMap UPROPERTY and a custom NetSerialize function. Use this struct as a replicated property on an actor/object, or pass it as a parameter to a RPC. UHT will generate the following error:
"Maps are not supported for Replication or RPCs. Map <Map Name> in <Property Outer Name>. Origin <Struct Name>"
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-137102 in the post.
5 |
Component | UE - Networking |
---|---|
Affects Versions | 4.27, 5.0 |
Target Fix | 5.0.1 |
Created | Dec 9, 2021 |
---|---|
Resolved | Jan 27, 2022 |
Updated | Jan 28, 2022 |