From 9d72060717bada267bfcb1ff59e8c6cbab9b4cb9 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sun, 3 Feb 2002 03:09:06 +0000 Subject: [PATCH] Added setFooImmediate versions of BodyObject setters and use setUsernameImmediate in sessionWillStart() so that entities later down the line of session startup processing can reference values set earlier in the process without having to wait for them to be applied by the dobjmgr. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@920 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/crowd/data/BodyObject.dobj | 14 +++++++++++++- .../com/threerings/crowd/server/CrowdClient.java | 9 ++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/crowd/data/BodyObject.dobj b/src/java/com/threerings/crowd/data/BodyObject.dobj index c3a1a0251..7b15917ca 100644 --- a/src/java/com/threerings/crowd/data/BodyObject.dobj +++ b/src/java/com/threerings/crowd/data/BodyObject.dobj @@ -1,5 +1,5 @@ // -// $Id: BodyObject.dobj,v 1.5 2001/10/11 04:07:51 mdb Exp $ +// $Id: BodyObject.dobj,v 1.6 2002/02/03 03:09:06 mdb Exp $ package com.threerings.crowd.data; @@ -29,11 +29,23 @@ public class BodyObject extends ClientObject requestAttributeChange(USERNAME, username); } + public void setUsernameImmediate (String username) + { + this.username = username; + requestAttributeChange(USERNAME, username); + } + public void setLocation (int location) { requestAttributeChange(LOCATION, new Integer(location)); } + public void setLocationImmediate (int location) + { + this.location = location; + requestAttributeChange(LOCATION, new Integer(location)); + } + protected void toString (StringBuffer buf) { super.toString(buf); diff --git a/src/java/com/threerings/crowd/server/CrowdClient.java b/src/java/com/threerings/crowd/server/CrowdClient.java index 17783fb6b..4ad493740 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.5 2001/12/03 22:01:57 mdb Exp $ +// $Id: CrowdClient.java,v 1.6 2002/02/03 03:09:06 mdb Exp $ package com.threerings.crowd.server; @@ -19,8 +19,11 @@ public class CrowdClient extends PresentsClient // cast our client object to a body object _bodobj = (BodyObject)_clobj; - // and configure our username - _bodobj.setUsername(_username); + // 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); // register our body object mapping CrowdServer.mapBody(_username, _bodobj);