Package org.jdesktop.wonderland.client.comms

Examples of org.jdesktop.wonderland.client.comms.WonderlandSession


            } else {
                rc.setSceneRoot(rootNode);
            }

            // TODO: shouldn't this just be a call to adjustCollisionSystem()?
            WonderlandSession session = cell.getCellCache().getSession();
            CollisionSystem collisionSystem = ClientContextJME.getCollisionSystem(session.getSessionManager(), "Default");


            CollisionComponent cc=null;

            cc = setupCollision(collisionSystem, rootNode);
View Full Code Here


        CollisionComponent cc = entity.getComponent(CollisionComponent.class);
        if (collisionEnabled==false && pickingEnabled==false && cc!=null)
            entity.removeComponent(CollisionComponent.class);

        if (cc==null) {
            WonderlandSession session = cell.getCellCache().getSession();
            CollisionSystem collisionSystem = ClientContextJME.getCollisionSystem(session.getSessionManager(), "Default");
            cc = setupCollision(collisionSystem, rootNode);
            entity.addComponent(CollisionComponent.class, cc);
            return;
        }
View Full Code Here

            re.initCause(ioe);
            throw re;
        }

        // create a new session
        WonderlandSession curSession = null;
        try {

            // keep trying to log in until we succeed.  Pause 5 seconds between
            // login attempts
            boolean loggedIn = false;
View Full Code Here

        Set<BigInteger> ids = new HashSet<BigInteger>();
       
        for (int i = 0; i < CLIENT_COUNT; i++) {
            // create the first session & login
            WonderlandSession session = new WonderlandSessionImpl(serverInfo);
            session.login(new LoginParameters(username, password.toCharArray()));
       
            logger.info("Login with id " + session.getID());
           
            assert session.getID() != null : "Session ID is null";
            assert !ids.contains(session.getID()) : "Duplicate id " + session.getID();
           
            ids.add(session.getID());
        }
      
        // test is finished
    }
View Full Code Here

            }
            CellID cellID = new CellID(cellIDInt);

            // Fetch the client-side Cell cache and find the Cell with the
            // dropped CellID
            WonderlandSession session = LoginManager.getPrimary().getPrimarySession();
            CellCache cache = ClientContext.getCellCache(session);
            if (cache == null) {
                LOGGER.warning("Unable to find Cell cache for session " + session);
                return;
            }
            Cell draggedCell = cache.getCell(cellID);
            if (draggedCell == null) {
                LOGGER.warning("Unable to find dragged Cell with ID " + cellID);
                return;
            }

            // Find out what Cell ID this was dropped over. This will form the
            // new parent. If the Cell is dropped over the world root, then set
            // the CellID to InvalidCellID
            CellID parentCellID = CellID.getInvalidCellID();
            SortedTreeNode treeNode = (SortedTreeNode) path.getLastPathComponent();
            Object userObject = treeNode.getUserObject();
            Cell newParent = null;
            if (userObject instanceof Cell && !(userObject instanceof EnvironmentCell)) {
                parentCellID = ((Cell) userObject).getCellID();
                newParent = (Cell) userObject;
                if (draggedCell.equals(newParent) == true) {
                    // User dropped cell on itself, return !
                    return;
                }
            }

            // Find the world transform of the new parent. If there is no new
            // parent (e.g. if the Cell is to be placed at the world root), then
            // use a null transform.
            CellTransform newParentWorld = new CellTransform(null, null);
            if (newParent != null) {
                newParentWorld = newParent.getWorldTransform();
            }

            CellTransform newChildLocal = ScenegraphUtils.computeChildTransform(
                    newParentWorld, draggedCell.getWorldTransform());

            // Send a message to the server indicating the change in the
            // parent. We need to send this over the cell edit connection,
            // rather than the cell connection.
            CellEditChannelConnection connection =
                    (CellEditChannelConnection) session.getConnection(
                    CellEditConnectionType.CLIENT_TYPE);
            connection.send(new CellReparentMessage(cellID, parentCellID, newChildLocal));

            // Turn off the selected node border and repaint the tree.
            dragOverTreeNode = null;
View Full Code Here

        // read the username and properties from files
        String username = System.getProperty("sgs.user", "sample");
        String password = System.getProperty("sgs.password", "sample");

        // create the session & login
        WonderlandSession session = new WonderlandSessionImpl(serverInfo);
        session.login(new LoginParameters(username, password.toCharArray()));
          
        logger.info("Login suceeded");
    
        // attach client
        session.connect(new TestOneClient());
       
        // wait for end-session message
        waitForFinish();
    }
View Full Code Here

        // read the username and properties from files
        String username = System.getProperty("sgs.user", "sample");
        String password = System.getProperty("sgs.password", "sample");

        // create the client & login
        WonderlandSession session = new WonderlandSessionImpl(serverInfo);
        session.login(new LoginParameters(username, password.toCharArray()));

        logger.info("Login suceeded");
       
        testMessages(session);
        testDetached();
        testReattach(session);
       
        logger.info("Tests complete");
        session.logout();
    }
View Full Code Here

                    LOGGER.log(Level.SEVERE, "Exception during upload", t);
                    return;
                }

                // Now create the cells for the new content
                WonderlandSession session =
                        LoginManager.getPrimary().getPrimarySession();
                CellEditChannelConnection connection =
                        (CellEditChannelConnection) session.getConnection(
                        CellEditConnectionType.CLIENT_TYPE);
                for (DeployedModel info : deploymentInfo) {
                    CellID parentCellID = null;
                    CellCreateMessage msg = new CellCreateMessage(
                            parentCellID, info.getCellServerState());
View Full Code Here

        CellPermissions perms = new CellPermissions();

        // add the current user as an owner
        ServerSessionManager primarySM = LoginManager.getPrimary();
        if (primarySM != null) {
            WonderlandSession primarySession = primarySM.getPrimarySession();
            if (primarySession != null) {
                Principal owner = new Principal(
                        primarySession.getUserID().getUsername(),
                        Principal.Type.USER);
                perms.getOwners().add(owner);
            }
        }
View Full Code Here

            Cell cell = event.getCell();
            String cellName = BUNDLE.getString("Copy_Of");
            cellName = MessageFormat.format(cellName, cell.getName());

            // If we want to delete, send a message to the server as such
            WonderlandSession session =
                    LoginManager.getPrimary().getPrimarySession();
            CellEditChannelConnection connection =
                    (CellEditChannelConnection) session.getConnection(
                    CellEditConnectionType.CLIENT_TYPE);
            CellDuplicateMessage msg =
                    new CellDuplicateMessage(cell.getCellID(), cellName);
            connection.send(msg);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.comms.WonderlandSession

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.