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.

Steps to Reproduce

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>"

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-137102 in the post.

Login to Vote

Won't Fix
ComponentUE - Networking
Affects Versions4.275.0
Target Fix5.0.1
CreatedDec 9, 2021
ResolvedJan 27, 2022
UpdatedJan 28, 2022