Tarray replication & ShooterGame

Hi,

I see thoses instructions on Tarray replication : https://docs.unrealengine.com/latest/INT/Programming/Gameplay/Framework/Networking/Replication/Implementation/DynamicArrays/index.html

But in shooter game for the Inventory (on character class), the GetReplicationList part is not written.

Does the documentation is out of date or does the shooter game code is not “safe” ?

Thanks,

This looks a little out of date, but we’re in the process right now on updating these as we speak :slight_smile:

GetReplicationList has been deprecated, and replace with GetLifetimeReplicatedProps.

Ultimately, to replicate an array, you simply need to register it within that function with the DOREPLIFETIME macro.

If arrays are very large and don’t change a lot, you can opt-in to a system mentioned in the link you posted. In this system, you can have more control over when the engine checks the elements for changes, and puts some of the burden on you to manually mark array elements as changed. It is a little more work, but can be beneficial if it saves a lot of computation time.

Wow, this information took me quite some time to find. I thought it was weird that I couldn’t find the method in the documentation or that the UHT didn’t generate a stub for it.