Added support for initiating a place/scene/zone transition from the
server; chat director no longer needs to wait until we're logged on to register itself with the invocation director. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1393 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
//
|
||||
// $Id: SceneProvider.java,v 1.8 2002/04/15 16:28:03 shaper Exp $
|
||||
// $Id: SceneProvider.java,v 1.9 2002/05/26 02:24:46 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.server;
|
||||
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
import com.threerings.presents.server.ServiceFailedException;
|
||||
|
||||
@@ -26,8 +27,9 @@ public class SceneProvider extends InvocationProvider
|
||||
* Constructs a scene provider that will interact with the supplied
|
||||
* scene registry.
|
||||
*/
|
||||
public SceneProvider (SceneRegistry screg)
|
||||
public SceneProvider (InvocationManager invmgr, SceneRegistry screg)
|
||||
{
|
||||
_invmgr = invmgr;
|
||||
_screg = screg;
|
||||
}
|
||||
|
||||
@@ -101,6 +103,25 @@ public class SceneProvider extends InvocationProvider
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ejects the specified body from their current scene and sends them a
|
||||
* request to move to the specified new scene. This is the
|
||||
* scene-equivalent to {@link LocationProvider#moveBody}.
|
||||
*/
|
||||
public void moveBody (BodyObject source, int sceneId)
|
||||
{
|
||||
// first remove them from their old place
|
||||
LocationProvider.leaveOccupiedPlace(source);
|
||||
|
||||
// then send a move notification
|
||||
_invmgr.sendNotification(
|
||||
source.getOid(), MODULE_NAME, MOVE_NOTIFICATION,
|
||||
new Object[] { new Integer(sceneId) });
|
||||
}
|
||||
|
||||
/** The invocation manager with which we interact. */
|
||||
protected InvocationManager _invmgr;
|
||||
|
||||
/** The scene registry with which we interact. */
|
||||
protected SceneRegistry _screg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user