Keep track of the client object id in the agent object (this will allow WhirledGameManager.validateUser to check out a dispatch from a bureau client)

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5152 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Jamie Doornbos
2008-06-05 00:16:46 +00:00
parent 63d228ee4c
commit 443ad8e139
3 changed files with 109 additions and 61 deletions
@@ -37,6 +37,9 @@ public class AgentObject extends DObject
/** The field name of the <code>className</code> field. */
public static final String CLASS_NAME = "className";
/** The field name of the <code>clientOid</code> field. */
public static final String CLIENT_OID = "clientOid";
// AUTO-GENERATED: FIELDS END
/** The id of the bureau the agent is running in. This is normally a unique id corresponding
@@ -56,6 +59,10 @@ public class AgentObject extends DObject
* used depends on the type of bureau and will be resolve in the bureau client. */
public String className;
/** The id of the client running this agent (only set after the agent is assigned to a
* bureau and run). */
public int clientOid;
// AUTO-GENERATED: METHODS START
/**
* Requests that the <code>bureauId</code> field be set to the
@@ -120,5 +127,21 @@ public class AgentObject extends DObject
CLASS_NAME, value, ovalue);
this.className = value;
}
/**
* Requests that the <code>clientOid</code> field be set to the
* specified 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 setClientOid (int value)
{
int ovalue = this.clientOid;
requestAttributeChange(
CLIENT_OID, Integer.valueOf(value), Integer.valueOf(ovalue));
this.clientOid = value;
}
// AUTO-GENERATED: METHODS END
}
@@ -320,6 +320,7 @@ public class BureauRegistry
switch (found.state) {
case Bureau.STARTED:
found.bureau.agentStates.put(found.agent, Bureau.RUNNING);
found.agent.setClientOid(client.getOid());
break;
case Bureau.STILL_BORN: