SyncListStruct callback on host doesn't have latest state

Hi all,

I am getting a behaviour with a SyncListStruct that I do not understand.

I have implemented a SyncListStruct which is successfully synchronising across the network. I query the list inside the [SyncListChanged] callback to retrieve the latest values. On clients, this works as expected. However, on the host I receive the state of the list before the sync. If I then query the SyncListStruct again a second or so after the callback has fired, I receive the latest list correctly.

The behaviour I am seeing suggests that the [SyncListChanged] callback is triggered slightly early on hosts only. Could this be possible? This is especially strange to me as the server is the one who updated the list originally, which is then synced to clients.

Briefly, my set up is not complex:

Thanks in advance,
Andy

Thanks for the report. I would suggest you file a bug.

Sure, will do.

For future reference, I think this behaviour was caused by writing into the list inside a loop via array index.

So instead of…

list[ i ] = struct;

…I instead do…

list.Remove(struct);
list.Add(struct);

…then this behaviour does not occur.

@Pelican_7

I would like to confirm that, outside of your bug, you have gotten a SyncListStruct to function properly? I ask because I cannot get one to do so. It is always null on the client side. Unity 5.1.3f1.