diff --git a/bin/gendobj b/bin/gendobj index 9a88efc8f..754d172e7 100755 --- a/bin/gendobj +++ b/bin/gendobj @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: gendobj,v 1.6 2002/02/09 00:10:19 mdb Exp $ +# $Id: gendobj,v 1.7 2002/02/20 23:35:42 mdb Exp $ # # gendobj is used to generate DObject source file definitons basded on # abbreviated declarations. Because DObject fields all have standard @@ -184,7 +184,8 @@ sub print_dobj_setters /** * Requests that the specified element be added to the - * $field set. + * $field set. The set will not change until the event is + * actually propagated through the system. */ public void addTo$cfield (DSet.Element elem) { @@ -193,7 +194,8 @@ sub print_dobj_setters /** * Requests that the element matching the supplied key be removed from - * the $field set. + * the $field set. The set will not change until the + * event is actually propagated through the system. */ public void removeFrom$cfield (Object key) { @@ -202,7 +204,8 @@ sub print_dobj_setters /** * Requests that the specified element be updated in the - * $field set. + * $field set. The set will not change until the event is + * actually propagated through the system. */ public void update$cfield (DSet.Element elem) { @@ -213,10 +216,15 @@ sub print_dobj_setters * Requests that the $field field be set to the * specified value. Generally one only adds, updates and removes * elements of a distributed set, but certain situations call for a - * complete replacement of the set value. + * complete replacement of the set value. The local value will be + * updated immediately and an event will be propagated through the + * system to notify all listeners that the attribute did + * change. Proxied copies of this object (on clients) will apply the + * value change when they received the attribute changed notification. */ public void set$cfield (DSet value) { + this.$field = $field; requestAttributeChange($fcode, value); } EOF @@ -226,7 +234,8 @@ EOF /** * Requests that the specified oid be added to the - * $field oid list. + * $field oid list. The list will not change until the + * event is actually propagated through the system. */ public void addTo$cfield (int oid) { @@ -235,7 +244,8 @@ EOF /** * Requests that the specified oid be removed from the - * $field oid list. + * $field oid list. The list will not change until the + * event is actually propagated through the system. */ public void removeFrom$cfield (int oid) { @@ -248,20 +258,13 @@ EOF /** * Requests that the $field field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void set$cfield ($type $field) - { - requestAttributeChange($fcode, $dobjval); - } - - /** - * Requests that the $field field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void set${cfield}Immediate ($type $field) { this.$field = $field; requestAttributeChange($fcode, $dobjval); diff --git a/src/java/com/threerings/crowd/data/BodyObject.java b/src/java/com/threerings/crowd/data/BodyObject.java index ab985a094..e8ed3680b 100644 --- a/src/java/com/threerings/crowd/data/BodyObject.java +++ b/src/java/com/threerings/crowd/data/BodyObject.java @@ -1,5 +1,5 @@ // -// $Id: BodyObject.java,v 1.1 2002/02/08 23:10:36 mdb Exp $ +// $Id: BodyObject.java,v 1.2 2002/02/20 23:35:42 mdb Exp $ package com.threerings.crowd.data; @@ -26,20 +26,13 @@ public class BodyObject extends ClientObject /** * Requests that the username field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void setUsername (String username) - { - requestAttributeChange(USERNAME, username); - } - - /** - * Requests that the username field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void setUsernameImmediate (String username) { this.username = username; requestAttributeChange(USERNAME, username); @@ -47,20 +40,13 @@ public class BodyObject extends ClientObject /** * Requests that the location field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void setLocation (int location) - { - requestAttributeChange(LOCATION, new Integer(location)); - } - - /** - * Requests that the location field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void setLocationImmediate (int location) { this.location = location; requestAttributeChange(LOCATION, new Integer(location)); diff --git a/src/java/com/threerings/crowd/data/PlaceObject.java b/src/java/com/threerings/crowd/data/PlaceObject.java index 29845b793..2d382f89d 100644 --- a/src/java/com/threerings/crowd/data/PlaceObject.java +++ b/src/java/com/threerings/crowd/data/PlaceObject.java @@ -1,5 +1,5 @@ // -// $Id: PlaceObject.java,v 1.2 2002/02/08 23:54:25 mdb Exp $ +// $Id: PlaceObject.java,v 1.3 2002/02/20 23:35:42 mdb Exp $ package com.threerings.crowd.data; @@ -28,7 +28,8 @@ public class PlaceObject extends DObject /** * Requests that the specified oid be added to the - * occupants oid list. + * occupants oid list. The list will not change until the + * event is actually propagated through the system. */ public void addToOccupants (int oid) { @@ -37,7 +38,8 @@ public class PlaceObject extends DObject /** * Requests that the specified oid be removed from the - * occupants oid list. + * occupants oid list. The list will not change until the + * event is actually propagated through the system. */ public void removeFromOccupants (int oid) { @@ -46,7 +48,8 @@ public class PlaceObject extends DObject /** * Requests that the specified element be added to the - * occupantInfo set. + * occupantInfo set. The set will not change until the event is + * actually propagated through the system. */ public void addToOccupantInfo (DSet.Element elem) { @@ -55,7 +58,8 @@ public class PlaceObject extends DObject /** * Requests that the element matching the supplied key be removed from - * the occupantInfo set. + * the occupantInfo set. The set will not change until the + * event is actually propagated through the system. */ public void removeFromOccupantInfo (Object key) { @@ -64,7 +68,8 @@ public class PlaceObject extends DObject /** * Requests that the specified element be updated in the - * occupantInfo set. + * occupantInfo set. The set will not change until the event is + * actually propagated through the system. */ public void updateOccupantInfo (DSet.Element elem) { @@ -75,10 +80,15 @@ public class PlaceObject extends DObject * Requests that the occupantInfo field be set to the * specified value. Generally one only adds, updates and removes * elements of a distributed set, but certain situations call for a - * complete replacement of the set value. + * complete replacement of the set value. The local value will be + * updated immediately and an event will be propagated through the + * system to notify all listeners that the attribute did + * change. Proxied copies of this object (on clients) will apply the + * value change when they received the attribute changed notification. */ public void setOccupantInfo (DSet value) { + this.occupantInfo = occupantInfo; requestAttributeChange(OCCUPANT_INFO, value); } } diff --git a/src/java/com/threerings/crowd/server/CrowdClient.java b/src/java/com/threerings/crowd/server/CrowdClient.java index 4ad493740..04e48eabc 100644 --- a/src/java/com/threerings/crowd/server/CrowdClient.java +++ b/src/java/com/threerings/crowd/server/CrowdClient.java @@ -1,5 +1,5 @@ // -// $Id: CrowdClient.java,v 1.6 2002/02/03 03:09:06 mdb Exp $ +// $Id: CrowdClient.java,v 1.7 2002/02/20 23:35:42 mdb Exp $ package com.threerings.crowd.server; @@ -19,11 +19,8 @@ public class CrowdClient extends PresentsClient // cast our client object to a body object _bodobj = (BodyObject)_clobj; - // and configure our username (we use the setImmediate form so - // that entities later in the session start processing can access - // fields set in the body object without having to wait for them - // to be flushed through the dobject queue) - _bodobj.setUsernameImmediate(_username); + // and configure our username + _bodobj.setUsername(_username); // register our body object mapping CrowdServer.mapBody(_username, _bodobj); diff --git a/src/java/com/threerings/micasa/lobby/table/TableLobbyObject.java b/src/java/com/threerings/micasa/lobby/table/TableLobbyObject.java index db625aefa..b7e7564c2 100644 --- a/src/java/com/threerings/micasa/lobby/table/TableLobbyObject.java +++ b/src/java/com/threerings/micasa/lobby/table/TableLobbyObject.java @@ -1,5 +1,5 @@ // -// $Id: TableLobbyObject.java,v 1.1 2002/02/08 23:55:24 mdb Exp $ +// $Id: TableLobbyObject.java,v 1.2 2002/02/20 23:35:42 mdb Exp $ package com.threerings.micasa.lobby.table; @@ -43,7 +43,8 @@ public class TableLobbyObject /** * Requests that the specified element be added to the - * tableSet set. + * tableSet set. The set will not change until the event is + * actually propagated through the system. */ public void addToTableSet (DSet.Element elem) { @@ -52,7 +53,8 @@ public class TableLobbyObject /** * Requests that the element matching the supplied key be removed from - * the tableSet set. + * the tableSet set. The set will not change until the + * event is actually propagated through the system. */ public void removeFromTableSet (Object key) { @@ -61,7 +63,8 @@ public class TableLobbyObject /** * Requests that the specified element be updated in the - * tableSet set. + * tableSet set. The set will not change until the event is + * actually propagated through the system. */ public void updateTableSet (DSet.Element elem) { @@ -72,10 +75,15 @@ public class TableLobbyObject * Requests that the tableSet field be set to the * specified value. Generally one only adds, updates and removes * elements of a distributed set, but certain situations call for a - * complete replacement of the set value. + * complete replacement of the set value. The local value will be + * updated immediately and an event will be propagated through the + * system to notify all listeners that the attribute did + * change. Proxied copies of this object (on clients) will apply the + * value change when they received the attribute changed notification. */ public void setTableSet (DSet value) { + this.tableSet = tableSet; requestAttributeChange(TABLE_SET, value); } } diff --git a/src/java/com/threerings/parlor/game/GameManager.java b/src/java/com/threerings/parlor/game/GameManager.java index 1eece6ca0..daec9b8f8 100644 --- a/src/java/com/threerings/parlor/game/GameManager.java +++ b/src/java/com/threerings/parlor/game/GameManager.java @@ -1,5 +1,5 @@ // -// $Id: GameManager.java,v 1.22 2002/02/15 03:42:32 mdb Exp $ +// $Id: GameManager.java,v 1.23 2002/02/20 23:35:42 mdb Exp $ package com.threerings.parlor.game; @@ -220,11 +220,8 @@ public class GameManager extends PlaceManager { // figure out who won... - // transition to the game over state (do so using setImmediate so - // that game manager code doesn't have to keep its own "immediate" - // game over indicator in order to prevent stray, post-end-game - // events from messing things up) - _gameobj.setStateImmediate(GameObject.GAME_OVER); + // transition to the game over state + _gameobj.setState(GameObject.GAME_OVER); // wait until we hear the game state transition on the game object // to invoke our game over code so that we can be sure that any diff --git a/src/java/com/threerings/parlor/game/GameObject.java b/src/java/com/threerings/parlor/game/GameObject.java index 9cda19cd7..a7085e36f 100644 --- a/src/java/com/threerings/parlor/game/GameObject.java +++ b/src/java/com/threerings/parlor/game/GameObject.java @@ -1,5 +1,5 @@ // -// $Id: GameObject.java,v 1.2 2002/02/13 03:21:28 mdb Exp $ +// $Id: GameObject.java,v 1.3 2002/02/20 23:35:42 mdb Exp $ package com.threerings.parlor.game; @@ -52,20 +52,13 @@ public class GameObject extends PlaceObject /** * Requests that the state field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void setState (int state) - { - requestAttributeChange(STATE, new Integer(state)); - } - - /** - * Requests that the state field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void setStateImmediate (int state) { this.state = state; requestAttributeChange(STATE, new Integer(state)); @@ -73,20 +66,13 @@ public class GameObject extends PlaceObject /** * Requests that the isRated field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void setIsRated (boolean isRated) - { - requestAttributeChange(IS_RATED, new Boolean(isRated)); - } - - /** - * Requests that the isRated field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void setIsRatedImmediate (boolean isRated) { this.isRated = isRated; requestAttributeChange(IS_RATED, new Boolean(isRated)); @@ -94,20 +80,13 @@ public class GameObject extends PlaceObject /** * Requests that the players field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void setPlayers (String[] players) - { - requestAttributeChange(PLAYERS, players); - } - - /** - * Requests that the players field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void setPlayersImmediate (String[] players) { this.players = players; requestAttributeChange(PLAYERS, players); diff --git a/tests/src/java/com/threerings/presents/server/TestObject.java b/tests/src/java/com/threerings/presents/server/TestObject.java index a6254f3d1..d2749c507 100644 --- a/tests/src/java/com/threerings/presents/server/TestObject.java +++ b/tests/src/java/com/threerings/presents/server/TestObject.java @@ -1,5 +1,5 @@ // -// $Id: TestObject.java,v 1.1 2002/02/08 23:17:38 mdb Exp $ +// $Id: TestObject.java,v 1.2 2002/02/20 23:35:42 mdb Exp $ package com.threerings.presents.server; @@ -25,20 +25,13 @@ public class TestObject extends DObject /** * Requests that the foo field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void setFoo (int foo) - { - requestAttributeChange(FOO, new Integer(foo)); - } - - /** - * Requests that the foo field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void setFooImmediate (int foo) { this.foo = foo; requestAttributeChange(FOO, new Integer(foo)); @@ -46,20 +39,13 @@ public class TestObject extends DObject /** * Requests that the bar field be set to the specified - * value. + * value. The local value will be updated immediately and an event + * will be propagated through the system to notify all listeners that + * the attribute did change. Proxied copies of this object (on + * clients) will apply the value change when they received the + * attribute changed notification. */ public void setBar (String bar) - { - requestAttributeChange(BAR, bar); - } - - /** - * Requests that the bar field be set to the - * specified value and immediately updates the state of the object - * to reflect the change. This should only be called on the - * server and only then if you know what you're doing. - */ - public void setBarImmediate (String bar) { this.bar = bar; requestAttributeChange(BAR, bar); @@ -67,7 +53,8 @@ public class TestObject extends DObject /** * Requests that the specified oid be added to the - * list oid list. + * list oid list. The list will not change until the + * event is actually propagated through the system. */ public void addToList (int oid) { @@ -76,7 +63,8 @@ public class TestObject extends DObject /** * Requests that the specified oid be removed from the - * list oid list. + * list oid list. The list will not change until the + * event is actually propagated through the system. */ public void removeFromList (int oid) {