Most elegant way to communicate value of TMap between clients?

I recently changed the way I store a certain set of variables from merely a set of int variables to a single TMap&ltFString, int32> variable. This is a far more elegant way to do what I wanted, so I’m not inclined to go back. However, because of the lack of replication and RPC functionality for TMaps, it broke a certain part of my multiplayer flow.

Basically I just want to do a one-time communication of these variables at the start of the session. It’s not necessary to keep them replicated throughout the session.

Before I changed the variables to a single TMap, I used a combination of submitting the int variables from client to server in an RPC and replicating them to make sure everybody had the same values at the start of the game session. However, TMap objects cannot be replicated, and (correct me if I’m wrong) as far as I know, they can’t be passed as arguments in an RPC.


  1. How do I send the value of a TMap from a client’s GameInstance to the server’s GameState?
  2. How do I send the value of a TMap from the server’s GameState to a client’s GameState?

I can think of some crude ways (for example, sending each key-value pair in an RPC one-by-one and populating the recipient’s TMap variable with the inputs, or sending two arrays through a single RPC call and looping through them at the recipient’s side to populate the map), but I’d like to know of the most elegant way to accomplish this. What do other people do when they need to do this?