Modified distributed object attribute setting such that attributes are

*always* set immediately because after some deliberation, we decided that
doing that led to less unexpectedly annoying behavior than having to wait
for the event to propagate to see the new value.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1062 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-20 23:35:42 +00:00
parent fec59f61a8
commit 5f18acd3d8
8 changed files with 100 additions and 132 deletions
@@ -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
@@ -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 <code>state</code> 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 <code>state</code> field be set to the
* specified value and immediately updates the state of the object
* to reflect the change. This should <em>only</em> 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 <code>isRated</code> 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 <code>isRated</code> field be set to the
* specified value and immediately updates the state of the object
* to reflect the change. This should <em>only</em> 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 <code>players</code> 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 <code>players</code> field be set to the
* specified value and immediately updates the state of the object
* to reflect the change. This should <em>only</em> 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);