Package com.threerings.util

Examples of com.threerings.util.Name


     * changed notification.
     */
    @Generated(value={"com.threerings.presents.tools.GenDObjectTask"})
    public void setPlayersAt (Name value, int index)
    {
        Name ovalue = this.players[index];
        requestElementUpdate(
            PLAYERS, index, value, ovalue);
        this.players[index] = value;
    }
View Full Code Here


    protected void logon ()
    {
        // disable further logon attempts until we hear back
        setLogonEnabled(false);

        Name username = new Name(_username.getText().trim());
        String password = new String(_password.getPassword()).trim();

        String server = _ctx.getClient().getHostname();
        int port = _ctx.getClient().getPorts()[0];
        String msg = MessageBundle.tcompose("m.logging_on",
View Full Code Here

        if (_trickCardGame.getTrickState() != TrickCardGameObject.PLAYING_TRICK) {
            return; // silently ignore play attempts after timeouts
        }

        // make sure it's their turn
        Name username = ((BodyObject)client).getVisibleName();
        if (!username.equals(_trickCardGame.getTurnHolder())) {
            return;
        }

        // make sure they're on the right trick
        int pidx = _cardGame.getPlayerIndex(username);
View Full Code Here

        client.setServer(server, Client.DEFAULT_SERVER_PORTS);

        // configure the client with some credentials and logon
        if (username != null && password != null) {
            // create and set our credentials
            client.setCredentials(new UsernamePasswordCreds(new Name(username), password));
            client.logon();
        }
    }
View Full Code Here

                // configure the game config with the player names
                config.players = new Name[_playerCount];
                config.players[0] = _source.getVisibleName();
                for (int ii = 1; ii < _playerCount; ii++) {
                    config.players[ii] = new Name("simulant" + ii);
                }
                _gmgr = (GameManager)_plreg.createPlace(config);

            } catch (Exception e) {
                log.warning("Unable to create game manager", "e", e, e);
                return;
            }

            // cast the place to the game object for the game we're creating
            _gobj = (GameObject)_gmgr.getPlaceObject();

            // determine the AI player skill level
            byte skill;
            try {
                skill = Byte.parseByte(System.getProperty("skill"));
            } catch (NumberFormatException nfe) {
                skill = DEFAULT_SKILL;
            }

            for (int ii = 1; ii < _playerCount; ii++) {
                // mark all simulants as AI players
                _gmgr.setAI(ii, new GameAI(0, skill));
            }

            // resolve the simulant body objects
            ClientResolutionListener listener = new ClientResolutionListener() {
                public void clientResolved (Name username, ClientObject clobj) {
                    // hold onto the body object for later game creation
                    _sims.add(clobj);
                    // create the game if we've received all body objects
                    if (_sims.size() == (_playerCount - 1)) {
                        createSimulants();
                    }
                }
                public void resolutionFailed (Name username, Exception cause) {
                    log.warning("Unable to create simulant body object", "error", cause);
                }
            };

            // resolve client objects for all of our simulants
            for (int ii = 1; ii < _playerCount; ii++) {
                Name username = new Name("simulant" + ii);
                _clmgr.resolveClientObject(username, listener);
            }
        }
View Full Code Here

            if (invitee != null) {
                // create a game config object
                try {
                    GameConfig config = _config.getGameConfig();
                    _ctx.getParlorDirector().invite(
                        new Name(invitee), config, this);
                } catch (Exception e) {
                    log.warning("Error instantiating game config.", e);
                }
            }
View Full Code Here

            password = "test";
        }

        // create and set our credentials
        client.setCredentials(
            new UsernamePasswordCreds(new Name(username), password));

        // this is a bit of a hack, but we need to give the server long
        // enough to fully initialize and start listening on its socket
        // before we try to logon; there's no good way for this otherwise
        // wholly independent thread to wait for the server to be ready as
View Full Code Here

TOP

Related Classes of com.threerings.util.Name

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.