Package com.threerings.presents.server

Examples of com.threerings.presents.server.InvocationException


            Integer.valueOf(target.getOid()));
        if (info == null) {
            log.warning("Have no occinfo for cluster target " +
                        "[where=" + where() + ", init=" + initiator.who() +
                        ", target=" + target.who() + "].");
            throw new InvocationException(INTERNAL_ERROR);
        }

        if (!info.isClusterable()) {
            throw new InvocationException(StageCodes.ERR_CANNOT_CLUSTER);
        }
    }
View Full Code Here


        // obtain the source scene
        SpotSceneManager srcmgr = (SpotSceneManager)getSceneManager(sceneId);
        if (srcmgr == null) {
            log.warning("Traverse portal missing source scene",
                "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,
                     new SpotSceneMoveHandler(_locman, srcmgr, body, destSceneVer, dest, listener));
View Full Code Here

        BodyObject source = _locator.forClient(caller);
        int cSceneId = ScenePlace.getSceneId(source);
        if (cSceneId != sceneId) {
            log.info("Rejecting changeLocation for invalid scene",
                "user", source.who(), "insid", cSceneId, "wantsid", sceneId, "loc", loc);
            throw new InvocationException(SpotCodes.INVALID_LOCATION);
        }

        // look up the scene manager for the specified scene
        SpotSceneManager smgr = (SpotSceneManager)getSceneManager(sceneId);
        if (smgr == null) {
            log.warning("User requested to change location from non-existent scene",
                "user", source.who(), "sceneId", sceneId, "loc", loc);
            throw new InvocationException(SpotCodes.INTERNAL_ERROR);
        }

        // pass the buck to yon scene manager
        smgr.handleChangeLoc(source, loc);
View Full Code Here

        // look up the scene manager for the specified scene
        SpotSceneManager smgr = (SpotSceneManager)getSceneManager(sceneId);
        if (smgr == null) {
            log.warning("User requested to join cluster from non-existent scene",
                "user", source.who(), "sceneId", sceneId, "foid", friendOid);
            throw new InvocationException(SpotCodes.INTERNAL_ERROR);
        }

        // pass the buck to yon scene manager
        smgr.handleJoinCluster(source, friendOid);
View Full Code Here

    {
        // make sure they are in our scene
        if (!_ssobj.occupants.contains(source.getOid())) {
            log.warning("Refusing change loc from non-scene occupant",
                "where", where(), "who", source.who(), "loc", loc);
            throw new InvocationException(INTERNAL_ERROR);
        }

        // let our derived classes decide if this is an OK place to stand
        if (!validateLocation(source, loc)) {
            throw new InvocationException(INVALID_LOCATION);
        }

        // update the user's location information in the scene which will indicate to the client
        // that their avatar should be moved from its current position to their new position
        updateLocation(source, loc);
View Full Code Here

        // otherwise see if they sent us the user's oid
        DObject tobj = _omgr.getObject(targetOid);
        if (!(tobj instanceof BodyObject)) {
            log.info("Can't join cluster, missing target",
                "creator", joiner.who(), "targetOid", targetOid);
            throw new InvocationException(NO_SUCH_CLUSTER);
        }

        // make sure we're in the same scene as said user
        BodyObject friend = (BodyObject)tobj;
        if (friend.getPlaceOid() != joiner.getPlaceOid()) {
            log.info("Refusing cluster join from non-proximate user",
                "joiner", joiner.who(), "jloc", joiner.location, "target", friend.who(),
                "tloc", friend.location);
            throw new InvocationException(NO_SUCH_CLUSTER);
        }

        // see if the friend is already in a cluster
        clrec = getCluster(friend.getOid());
        if (clrec != null) {
View Full Code Here

        throws InvocationException
    {
        if (!(caller instanceof ZonedBodyObject)) {
            log.warning("Request to switch zones by non-ZonedBodyObject",
                "clobj", caller.getClass());
            throw new InvocationException(ZoneCodes.INTERNAL_ERROR);
        }

        // look up the caller's current zone id and make sure it is happy about their departure
        // from the current zone
        BodyObject body = _locator.forClient(caller);
        ZoneManager ozmgr = getZoneManager(((ZonedBodyObject)caller).getZoneId());
        if (ozmgr != null) {
            String msg = ozmgr.ratifyBodyExit(body);
            if (msg != null) {
                throw new InvocationException(msg);
            }
        }

        // look up the zone manager for the zone
        ZoneManager zmgr = getZoneManager(zoneId);
        if (zmgr == null) {
            log.warning("Requested to enter a zone for which we have no manager",
                "user", body.who(), "zoneId", zoneId);
            throw new InvocationException(ZoneCodes.NO_SUCH_ZONE);
        }

        // resolve the zone and move the user
        zmgr.resolveZone(zoneId, createZoneMoveHandler(zmgr, body, sceneId, sceneVer, listener));
    }
View Full Code Here

            throws InvocationException
        {
            if (!(body instanceof ClusteredBodyObject)) {
                log.warning("Refusing to add non-clustered body to cluster",
                    "cloid", _clobj.getOid(), "size", size(), "who", body.who());
                throw new InvocationException(INTERNAL_ERROR);
            }

            // if they're already in the cluster, do nothing
            if (containsKey(body.getOid())) {
                return false;
            }

            // make sure we can add this body
            if (!canAddBody(this, body)) {
//                 Log.debug("Cluster full, refusing growth " + this + ".");
                throw new InvocationException(CLUSTER_FULL);
            }

            // make sure our intrepid joiner is not in any another cluster
            removeFromCluster(body.getOid());
View Full Code Here

        BodyObject source = (BodyObject)caller;

        // ensure that the invitee is online at present
        BodyObject target = _locator.lookupBody(invitee);
        if (target == null) {
            throw new InvocationException(INVITEE_NOT_ONLINE);
        }

        int inviteId = invite(source, target, config);
        listener.inviteReceived(inviteId);
    }
View Full Code Here

            listener.requestProcessed();

        } catch (InstantiationException ie) {
            log.warning("Error instantiating game manager " +
                        "[for=" + caller.who() + ", config=" + config + "].", ie);
            throw new InvocationException(INTERNAL_ERROR);
        }
    }
View Full Code Here

TOP

Related Classes of com.threerings.presents.server.InvocationException

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.