Updates to reflect new BodyObject.location change. We now have a ScenePlace and

ScenedBodyObject goes away.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@372 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2007-07-21 00:47:00 +00:00
parent c8b2f7212b
commit e03ddd71e8
20 changed files with 174 additions and 156 deletions
@@ -24,12 +24,14 @@ package com.threerings.whirled.server;
import com.samskivert.io.PersistenceException;
import com.samskivert.util.Invoker;
import com.threerings.crowd.data.Place;
import com.threerings.crowd.server.CrowdServer;
import com.threerings.crowd.server.PlaceManager;
import com.threerings.presents.server.PresentsServer;
import com.threerings.whirled.Log;
import com.threerings.whirled.data.Scene;
import com.threerings.whirled.data.SceneCodes;
import com.threerings.whirled.data.ScenePlace;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.server.WhirledServer;
import com.threerings.whirled.util.UpdateList;
@@ -58,6 +60,12 @@ public class SceneManager extends PlaceManager
return _updates.getUpdates(fromVersion);
}
@Override // from PlaceManager
public Place getLocation ()
{
return new ScenePlace(_plobj.getOid(), _scene.getId());
}
/**
* Called by the scene registry once the scene manager has been created (and initialized), but
* before it is started up.
@@ -100,7 +108,7 @@ public class SceneManager extends PlaceManager
// Wait until us and all of our subclasses have completely finished running didStartup
// prior to registering the scene as being ready.
PresentsServer.omgr.postRunnable(new Runnable() {
CrowdServer.omgr.postRunnable(new Runnable() {
public void run () {
_screg.sceneManagerDidStart(SceneManager.this);
}
@@ -32,7 +32,6 @@ import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.data.SceneCodes;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.data.ScenedBodyObject;
/**
* Handles a simple scene to scene move.
@@ -49,13 +48,10 @@ public class SceneMoveHandler extends AbstractSceneMoveHandler
protected void effectSceneMove (SceneManager scmgr)
throws InvocationException
{
// move to the place object associated with this scene
// move to location associated with this scene
int ploid = scmgr.getPlaceObject().getOid();
PlaceConfig config = CrowdServer.plreg.locprov.moveTo(_body, ploid);
// now that we've finally moved, we can update the user object with the new scene id
((ScenedBodyObject)_body).setSceneId(scmgr.getScene().getId());
// check to see if they need a newer version of the scene data
SceneService.SceneMoveListener listener = (SceneService.SceneMoveListener)_listener;
SceneModel model = scmgr.getScene().getSceneModel();
@@ -43,7 +43,6 @@ import com.threerings.whirled.data.Scene;
import com.threerings.whirled.data.SceneCodes;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.data.ScenedBodyObject;
import com.threerings.whirled.server.persist.SceneRepository;
import com.threerings.whirled.util.SceneFactory;
import com.threerings.whirled.util.UpdateList;
@@ -245,13 +244,10 @@ public class SceneRegistry
* Ejects the specified body from their current scene and zone. This is the zone equivalent to
* {@link LocationProvider#leaveOccupiedPlace}.
*/
public void leaveOccupiedScene (ScenedBodyObject source)
public void leaveOccupiedScene (BodyObject source)
{
// remove them from their occupied place
CrowdServer.plreg.locprov.leaveOccupiedPlace((BodyObject)source);
// and clear out their scene information
source.setSceneId(0);
// remove them from their occupied place (clears out scene info as well)
CrowdServer.plreg.locprov.leaveOccupiedPlace(source);
}
/**
@@ -21,19 +21,12 @@
package com.threerings.whirled.server;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.server.CrowdClient;
import com.threerings.whirled.data.ScenedBodyObject;
/**
* The client object used by client management on the Whirled server.
*/
public class WhirledClient extends CrowdClient
{
// documentation inherited from interface
protected void clearLocation (BodyObject bobj)
{
WhirledServer.screg.leaveOccupiedScene((ScenedBodyObject)bobj);
}
// nothing needed at the moment
}