Recently I saw that TMap was not replicated for Unreal, but if I dont want to replicate it, I just want to make calculations with the TMap structure and then if I want to replicate I will move the data to a particular structure. But I got problems doing the GetKeys() of my map, it says 0 but its 60, so I dont know what to do because when I try in standalone I get the right num.
sometimes it says 60 and sometimes it says 0, like I dont know whats going on. But it is more often to see the 0 than the 60. The few times the right value appears it is in the first execution of the game once u open the engine
I need to add to this. HasAuthority works a bit different on Listen Server setups. Host client is the server, so logic that’s supposed to work just on server will always execute on the host client.
that empty map on the client is expected because TMaps dont replicate, the client just has its own local copy while the server has the filled one.
do all inventory writes on the server behind an authority gate and replicate the results down through replicated structs or subobjects, the client should only read.
you can also try Blueprint Object Replication, a networking tool for Unreal Engine that models each inventory item as its own replicated object with repnotifies: https://www.fab.com/listings/e26dcf07-7c78-4e67-8e56-272cf6df8021