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<FString, 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.
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?
Follow this question
Once you sign in you will be able to subscribe for any updates here