From 3751f0ad9b0b8bcc7bf88bbf9474e81864746cfe Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 3 Aug 2001 02:28:20 +0000 Subject: [PATCH] Created a party client which sets up the username in the body object. Modified the party server to configure the cher services to use our party client. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@163 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/crowd/server/CrowdClient.java | 29 +++++++++++++++++++ .../threerings/crowd/server/CrowdServer.java | 5 +++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/java/com/threerings/crowd/server/CrowdClient.java diff --git a/src/java/com/threerings/crowd/server/CrowdClient.java b/src/java/com/threerings/crowd/server/CrowdClient.java new file mode 100644 index 000000000..30e8f74bb --- /dev/null +++ b/src/java/com/threerings/crowd/server/CrowdClient.java @@ -0,0 +1,29 @@ +// +// $Id: CrowdClient.java,v 1.1 2001/08/03 02:28:20 mdb Exp $ + +package com.threerings.cocktail.party.server; + +import com.threerings.cocktail.cher.server.CherClient; +import com.threerings.cocktail.party.data.BodyObject; + +/** + * The party client extends the cher client and does some initializations + * necessary for the party services. + */ +public class PartyClient extends CherClient +{ + protected void sessionWillStart () + { + // cast our client object to a body object + _bodobj = (BodyObject)_clobj; + + // and configure our username + _bodobj.setUsername(_username); + } + + protected void sessionWillResume () + { + } + + protected BodyObject _bodobj; +} diff --git a/src/java/com/threerings/crowd/server/CrowdServer.java b/src/java/com/threerings/crowd/server/CrowdServer.java index ebddb5eb3..ec88e4f04 100644 --- a/src/java/com/threerings/crowd/server/CrowdServer.java +++ b/src/java/com/threerings/crowd/server/CrowdServer.java @@ -1,5 +1,5 @@ // -// $Id: CrowdServer.java,v 1.3 2001/08/02 01:47:56 mdb Exp $ +// $Id: CrowdServer.java,v 1.4 2001/08/03 02:28:20 mdb Exp $ package com.threerings.cocktail.party.server; @@ -34,6 +34,9 @@ public class PartyServer extends CherServer // bind the party server config into the namespace config.bindProperties(CONFIG_KEY, CONFIG_PATH); + // configure the client to use our party client + clmgr.setClientClass(PartyClient.class); + // configure the client to use the body object clmgr.setClientObjectClass(BodyObject.class);