Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Bolt state objects/arrays and syncing

$
0
0
I have been moving some stuff into state recently from events. And I am not sure what Bolt does under the hood.

For example, if you have a state property of an array type of an object [MyObject] of length 8.
[MyObject] has two 4 byte integers, say [A] and [B].

If I make a change to one of the objects, say at index 5, to both members how does the sync happen?

Does bolt sync the entire array, including unchanged elements? Basically, does Bolt just do a full sync if it is sees any changes?

Does bolt only sync over the two elements that changed? And if so, is that update guaranteed to be atomic, or is it possible that I could see a situation where only one of the two elements is updated on the client? I.e. it is very useful for this update to be atomic, because otherwise it is not possible to really know when you have received enough data to act on it. You could act on it with only a partial update which would be wrong (and likely catastrophic).

I.e. it looks like the answers could be:

A. Bolt syncs the entire array over the network, in this case 64 bytes, but on the client only the changes to the two elements that actually changes are raised as property changed.
B. Bolt syncs over only the two elements A and B, but they are not atomic, so it is not guaranteed both A and B will arrive on the same frame.
C. Bolt syncs over only the two elements A and B, but the update is atomic, so the object is guaranteed to be fully updated when it arrives so if I see an update to A or B I know the entire object has been updated from the server.

Also, is there any difference between an array of primitive types (e.g. integers) and an array of bolt objects containing one element (an integer)?

Viewing all articles
Browse latest Browse all 15755

Trending Articles