public class SceneRegistry extends Object implements SceneCodes, SceneProvider
The scene repository also takes care of bridging from the blocking, synchronous world of the scene repository to the non-blocking asynchronous world of the distributed object event queue. Thus its interfaces for accessing scenes are structured so as to not block the dobjmgr thread while waiting for scenes to be read from or written to the repository.
Note: All access to the scene registry should take place from the dobjmgr thread.
| Modifier and Type | Class and Description |
|---|---|
static interface |
SceneRegistry.ConfigFactory
Used to create
PlaceConfig instances for scenes. |
static interface |
SceneRegistry.ResolutionListener
Because scenes must be loaded from the scene repository and this must not be done on the
dobjmgr thread, the interface for resolving scenes requires that the entity that wishes for
a scene to be resolved implement this callback interface so that it can be notified when a
scene has been loaded and initialized.
|
SCENE_UPDATE, WHIRLED_GROUP| Constructor and Description |
|---|
SceneRegistry(com.threerings.presents.server.InvocationManager invmgr)
Constructs a scene registry.
|
| Modifier and Type | Method and Description |
|---|---|
SceneManager |
getSceneManager(int sceneId)
Fetches the scene manager associated with the specified scene.
|
SceneRepository |
getSceneRepository()
Returns a reference to the scene repository in use by this registry.
|
void |
leaveOccupiedScene(com.threerings.crowd.data.BodyObject source)
Ejects the specified body from their current scene and zone.
|
void |
moveBody(com.threerings.crowd.data.BodyObject source,
int sceneId)
Ejects the specified body from their current scene and sends them a request to move to the
specified new scene.
|
void |
moveTo(com.threerings.presents.data.ClientObject caller,
int sceneId,
int sceneVer,
SceneService.SceneMoveListener listener)
|
void |
resolveScene(int sceneId,
SceneRegistry.ResolutionListener target)
Requests that the specified scene be resolved, which means loaded into the server and
initialized if the scene is not currently active.
|
String |
where(int sceneId)
Returns
SceneManager.where() for the specified scene or null:sceneId if
no scene manager exists for that scene. |
@Inject public SceneRegistry(com.threerings.presents.server.InvocationManager invmgr)
public SceneManager getSceneManager(int sceneId)
public SceneRepository getSceneRepository()
public String where(int sceneId)
SceneManager.where() for the specified scene or null:sceneId if
no scene manager exists for that scene.public void resolveScene(int sceneId,
SceneRegistry.ResolutionListener target)
resolveScene(int, com.threerings.whirled.server.SceneRegistry.ResolutionListener) returns).sceneId - the id of the scene to resolve.target - a reference to a callback instance that will be notified when the scene has
been resolved (which may be immediately if the scene is already active).public void moveTo(com.threerings.presents.data.ClientObject caller,
int sceneId,
int sceneVer,
SceneService.SceneMoveListener listener)
SceneProviderSceneService.moveTo(int, int, com.threerings.whirled.client.SceneService.SceneMoveListener) request.moveTo in interface SceneProviderpublic void moveBody(com.threerings.crowd.data.BodyObject source,
int sceneId)
LocationProvider.moveTo(com.threerings.presents.data.ClientObject, int, com.threerings.crowd.client.LocationService.MoveListener).public void leaveOccupiedScene(com.threerings.crowd.data.BodyObject source)
LocationProvider.leavePlace(com.threerings.presents.data.ClientObject).Copyright © 2015. All rights reserved.