Fixes for property setting via atomic test-and-set:
- Moved property testing, so that it happens before any propertySet events are dispatched. In the previous version, testing happened while processing the set event on the server - but since by that time client events have already been sent, it introduced the possibility of short-lived inconsistencies between client and server data models. - Introduced a separate EZ API call for test and set - not only does it perform the test, but unlike regular set, it does not cache the new value ahead of time. Instead the new value will have to arrive from the server, at some future point. - Trimmed PropertySetEvent and other handlers back down - they don't need to carry any of the test info around, after it's already been performed. Also cut redundant testing on the clients. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@195 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -28,14 +28,16 @@ public interface EZGame
|
||||
public void set (String propName, Object value, int index);
|
||||
|
||||
/**
|
||||
* Set a property that will be distributed.
|
||||
* Set a property that will be distributed, if the previous value
|
||||
* matches the test value.
|
||||
*/
|
||||
public void set (String propName, Object value, boolean testAndSet);
|
||||
public void testAndSet (String propName, Object value, Object testValue);
|
||||
|
||||
/**
|
||||
* Set a property that will be distributed.
|
||||
* Set a property that will be distributed, if the previous value
|
||||
* matches the test value.
|
||||
*/
|
||||
public void set (String propName, Object value, int index, boolean testAndSet);
|
||||
public void testAndSet (String propName, Object value, Object testValue, int index);
|
||||
|
||||
/**
|
||||
* Register an object to receive whatever events it should receive,
|
||||
|
||||
Reference in New Issue
Block a user