From 752ee2fe8ba2334cdee0bc3aa23f5dcbe9dba8e1 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 9 Sep 2002 23:22:28 +0000 Subject: [PATCH] added static moveBodyToDefaultPortal() git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1669 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../whirled/spot/server/SpotSceneManager.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java index 56c926c25..c7d3890d3 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java +++ b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java @@ -1,5 +1,5 @@ // -// $Id: SpotSceneManager.java,v 1.17 2002/08/20 18:21:45 mdb Exp $ +// $Id: SpotSceneManager.java,v 1.18 2002/09/09 23:22:28 ray Exp $ package com.threerings.whirled.spot.server; @@ -15,6 +15,7 @@ import com.threerings.presents.server.InvocationException; import com.threerings.crowd.chat.SpeakProvider; import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.data.OccupantInfo; +import com.threerings.crowd.server.CrowdServer; import com.threerings.whirled.server.SceneManager; import com.threerings.whirled.spot.Log; @@ -31,6 +32,24 @@ import com.threerings.whirled.spot.util.SpotSceneUtil; public class SpotSceneManager extends SceneManager implements SpotCodes { + /** + * Move the specified body to the default portal, if possible. + */ + public static void moveBodyToDefaultPortal (BodyObject body) + { + SpotSceneManager mgr = (SpotSceneManager) + CrowdServer.plreg.getPlaceManager(body.location); + if (mgr != null) { + SpotSceneModel model = (SpotSceneModel) mgr.getSceneModel(); + try { + mgr.handleChangeLocRequest(body, model.defaultEntranceId); + } catch (InvocationException ie) { + Log.warning("Could not walk user to default portal [error=" + + ie + "]."); + } + } + } + /** * Prepares a mapping for an entering body, indicating that they will * be entering at the specified location id. When the time comes to