diff --git a/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java b/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java index d5bd3f255..3ddf4c8d4 100644 --- a/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java +++ b/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java @@ -1,5 +1,5 @@ // -// $Id: SimulatorManager.java,v 1.3 2001/12/19 23:30:47 shaper Exp $ +// $Id: SimulatorManager.java,v 1.4 2001/12/20 01:11:18 shaper Exp $ package com.threerings.micasa.simulator.server; @@ -115,6 +115,9 @@ public class SimulatorManager BodyObject bobj = (BodyObject)object; bobj.username = "simulant" + (_sims.size() + 1); + // map the simulant into the server body set + SimulatorServer.mapBody(bobj.username, bobj); + // hold onto it for later game creation _sims.add(bobj); diff --git a/src/java/com/threerings/micasa/simulator/server/SimulatorServer.java b/src/java/com/threerings/micasa/simulator/server/SimulatorServer.java index 4e563da0d..4f0a3df02 100644 --- a/src/java/com/threerings/micasa/simulator/server/SimulatorServer.java +++ b/src/java/com/threerings/micasa/simulator/server/SimulatorServer.java @@ -1,8 +1,9 @@ // -// $Id: SimulatorServer.java,v 1.2 2001/12/19 23:30:47 shaper Exp $ +// $Id: SimulatorServer.java,v 1.3 2001/12/20 01:11:18 shaper Exp $ package com.threerings.micasa.simulator.server; +import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.server.CrowdServer; import com.threerings.micasa.Log; @@ -31,6 +32,21 @@ public class SimulatorServer extends CrowdServer Log.info("Simulator server initialized."); } + /** + * Called by the simulator manager to map a username to a particular + * body object. This should only be called from the dobjmgr thread. + * + *

This is copied from {@link CrowdServer#mapBody} as that + * implementation is protected and cannot be referenced by classes in + * the simulator package, but we know what we're doing and so we + * knowingly expose this functionality to other classes in our + * package. + */ + protected static void mapBody (String username, BodyObject bodobj) + { + _bodymap.put(username, bodobj); + } + public static void main (String[] args) { SimulatorServer server = new SimulatorServer();