Package com.threerings.presents.client

Examples of com.threerings.presents.client.Client


            Name username = new Name(requireParameter("username"));
            String authkey = requireParameter("authkey");
            String server = getCodeBase().getHost();

            Client client = _client.getContext().getClient();

            // indicate which server to which we should connect
            client.setServer(server, Client.DEFAULT_SERVER_PORTS);

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

            // we want to hide the client frame when we logoff
            client.addClientObserver(new ClientAdapter() {
                @Override
                public void clientDidLogoff (Client c)
                {
                    _frame.setVisible(false);
                }
View Full Code Here


    public void stop ()
    {
        if (_client != null) {
            // hide the frame and log off
            _frame.setVisible(false);
            Client client = _client.getContext().getClient();
            if (client.isLoggedOn()) {
                client.logoff(false);
            }
        }
    }
View Full Code Here

                                            server, String.valueOf(port));
        _status.append(_msgs.xlate(msg) + "\n");

        // configure the client with some credentials and logon
        Credentials creds = new UsernamePasswordCreds(username, password);
        Client client = _ctx.getClient();
        client.setCredentials(creds);
        client.logon();
    }
View Full Code Here

        // position everything and show the frame
        _frame.setSize(800, 600);
        SwingUtil.centerWindow(_frame);
        _frame.setVisible(true);

        Client client = _client.getContext().getClient();

        log.info("Using", "server", server);
        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

     */
    protected void createContextServices ()
        throws IOException
    {
        // create the handles on our various services
        _client = new Client(null, RunQueue.AWT);

        // create our managers and directors
        _locdir = new LocationDirector(_ctx);
        _occdir = new OccupantDirector(_ctx);
        _pardtr = new ParlorDirector(_ctx);
View Full Code Here

        frame.setSize(800, 600);
        SwingUtil.centerWindow(frame);
        frame.setVisible(true);

        // start up the client
        Client client = _client.getParlorContext().getClient();
        log.info("Connecting to localhost.");
        client.setServer("localhost", Client.DEFAULT_SERVER_PORTS);

        // we want to exit when we logged off or failed to log on
        client.addClientObserver(new ClientAdapter() {
            @Override
            public void clientFailedToLogon (Client c, Exception cause) {
                log.info("Client failed to logon: " + cause);
                System.exit(0);
            }
            @Override
            public void clientDidLogoff (Client c) {
                System.exit(0);
            }
        });

        // configure the client with some credentials and logon
        String username = System.getProperty("username");
        if (username == null) {
            username =
                "bob" + ((int)(Math.random() * Integer.MAX_VALUE) % 500);
        }
        String password = System.getProperty("password");
        if (password == null) {
            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
View Full Code Here

    {
        // create our context
        _ctx = createContext();

        // create the handles on our various services
        _client = new Client(null, RunQueue.AWT);

        // create our managers and directors
        _msgmgr = new MessageManager(getMessageManagerPrefix());
        _locdir = new LocationDirector(_ctx);
        _occdir = new OccupantDirector(_ctx);
View Full Code Here

TOP

Related Classes of com.threerings.presents.client.Client

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.