Package com.threerings.whirled.spot.data

Examples of com.threerings.whirled.spot.data.SpotScene


                "user", body.who(), "sceneId", sceneId, "portalId", portalId);
            throw new InvocationException(SpotCodes.INTERNAL_ERROR);
        }

        // obtain the destination scene and location id
        SpotScene rss = (SpotScene)srcmgr.getScene();
        Portal dest = rss.getPortal(portalId);

        // give the source scene manager a chance to do access control
        String errmsg = srcmgr.mayTraversePortal(body, dest);
        if (errmsg != null) {
            throw new InvocationException(errmsg);
        }

        // make sure this portal has valid info
        if (dest == null || !dest.isValid()) {
            log.warning("Traverse portal with invalid portal",
                "user", body.who(), "scene", srcmgr.where(), "pid", portalId, "portal", dest,
                "portals", rss.getPortals());
            throw new InvocationException(SpotCodes.NO_SUCH_PORTAL);
        }

        // resolve their destination scene
        resolveScene(dest.targetSceneId,
View Full Code Here


     * notified of success or failure.
     */
    public boolean traversePortal (int portalId, ResultListener<PlaceConfig> rl)
    {
        // look up the destination scene and location
        SpotScene scene = (SpotScene)_scdir.getScene();
        if (scene == null) {
            log.warning("Requested to traverse portal when we have no scene", "portalId", portalId);
            return false;
        }

        // sanity check the server's notion of what scene we're in with our notion of it
        int sceneId = _scdir.getScene().getId();
        int clSceneId = ScenePlace.getSceneId((BodyObject)_ctx.getClient().getClientObject());
        if (sceneId != clSceneId) {
            log.warning("Client and server differ in opinion of what scene we're in",
                "sSceneId", clSceneId, "cSceneId", sceneId);
            return false;
        }

        // find the portal they're talking about
        Portal dest = scene.getPortal(portalId);
        if (dest == null) {
            log.warning("Requested to traverse non-existent portal",
                "portalId", portalId, "portals", scene.getPortals());
            return false;
        }

        // prepare to move to this scene (sets up pending data)
        if (!_scdir.prepareMoveTo(dest.targetSceneId, rl)) {
View Full Code Here

                listener.requestCompleted(_pendingLoc);
            }
            return;
        }

        SpotScene scene = (SpotScene)_scdir.getScene();
        if (scene == null) {
            log.warning("Requested to change locations, but we're not currently in any scene",
                "loc", loc);
            if (listener != null) {
                listener.requestFailed(new Exception("m.cant_get_there"));
View Full Code Here

     * user's cluster.
     * @param listener will be notified of success or failure.
     */
    public void joinCluster (int froid, final ResultListener<Void> listener)
    {
        SpotScene scene = (SpotScene)_scdir.getScene();
        if (scene == null) {
            log.warning("Requested to join cluster, but we're not currently in any scene",
                "froid", froid);
            if (listener != null) {
                listener.requestFailed(new Exception("m.cant_get_there"));
View Full Code Here

     * cluster and refused to deliver the request.
     */
    public boolean requestClusterSpeak (String message, byte mode)
    {
        // make sure we're currently in a scene
        SpotScene scene = (SpotScene)_scdir.getScene();
        if (scene == null) {
            log.warning("Requested to speak to cluster, but we're not currently in any scene",
                "message", message);
            return false;
        }
View Full Code Here

    /**
     * Move the specified body to the default portal, if possible.
     */
    protected void moveToDefaultPortal (BodyObject body)
    {
        SpotScene scene = (SpotScene)getScene();
        if (scene == null) {
            log.warning("No scene in moveBodyToDefaultPortal()?",
                "who", body.who(), "where", where());
            return;
        }

        try {
            Location eloc = scene.getDefaultEntrance().getLocation();
            handleChangeLoc(body, eloc);
        } catch (InvocationException ie) {
            log.warning("Could not move user to default portal",
                "where", where(), "who", body.who(), "error", ie);
        }
View Full Code Here

TOP

Related Classes of com.threerings.whirled.spot.data.SpotScene

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.