Closed mdalpiaz closed 6 months ago
Sounds like a good idea!
In case of aborted loading, the server will just send out the state of objects (matrix for each object) and snapshots ("clear snapshot" followed by "add snapshot" for each existing on server);
One thing i just realized - new clients should probably also get such a "synchronization" package about objects and snapshots, if a dataset is already loaded when they connect.
I will add the synchronization procedure to the document at the client connected command, so new clients get synchronized properly.
Can we really just set the object state first and then add all the snapshots? When we take a snapshot, rotate the object, then take another snapshot, the first one still has the coordinates of the old slice plane? Doing a sync would then take these old coordinates and slice the NEW object at these. --> The first snapshot is wrong.
If we do snapshot slices only in accordance to local space (with the object as reference), the object could be manipulated in any way and it would work again.
If we do snapshot slices only in accordance to local space (with the object as reference), the object could be manipulated in any way and it would work again.
Yes I think this is the only reliable way.
Following the previous pull request, these are the proposed changes to handle desynchronization while loading datasets. My last comment from the previous pull request is copied here:
I think you're right, we should keep the current implementation. If we change datasets successfully, the state of objects is already reset, so they are always in sync.
However, one case in which it would make sense to NAK the clients would be the following: The server wants to change to a dataset, that a client doesn't have. The client simultaneously sends a object manipulation command (which reaches the server after dataset load was sent --> message is discarded). The client answers with NAK (it doesn't have the dataset).
Now we have two states: The server in the state before the object manipulation command (because discarded). The client after manipulating the object (the command doesn't require acknowledgement).
One way to resolve this, could be to "mark" clients which have sent commands while in the dataset loading process, and in case they NAK, send the state of the server to these clients (objects positions, snapshots, etc.). What do you think about it?