Package mage.remote

Examples of mage.remote.SessionImpl


        public ClientMock(String username) {
            this.username = username;
        }

        public void connect() {
            session = new SessionImpl(this);
            Connection connection = new Connection();
            connection.setUsername(username);
            connection.setHost("localhost");
            connection.setPort(17171);
            connection.setProxyType(Connection.ProxyType.NONE);
View Full Code Here


        for (int i = 0; i < EXECUTION_COUNT; i++) {
            Connection connection = createConnection(TEST_USER_NAME + i);

            SimpleMageClient mageClient = new SimpleMageClient();
            Session session = new SessionImpl(mageClient);

            session.connect(connection);
            UUID roomId = session.getMainRoomId();

            GameTypeView gameTypeView = session.getGameTypes().get(0);
            log.info("Game type view: " + gameTypeView.getName());
            MatchOptions options = createGameOptions(gameTypeView, session);

            TableView table = session.createTable(roomId, options);

            if (!session.joinTable(roomId, table.getTableId(), TEST_USER_NAME + i, "Human", 1, deckList,"")) {
                log.error("Error while joining table");
                Assert.assertTrue("Error while joining table", false);
                return;
            }

            /*** Connect with a second player ***/
            Connection connection2 = createConnection(TEST_USER_NAME_2 + i);
            SimpleMageClient mageClient2 = new SimpleMageClient();
            Session session2 = new SessionImpl(mageClient2);
            session2.connect(connection2);
            UUID roomId2 = session2.getMainRoomId();

            // connect to the table with the same deck
            if (!session2.joinTable(roomId2, table.getTableId(), TEST_USER_NAME_2 + i, "Human", 1, deckList,"")) {
                log.error("Error while joining table");
                Assert.assertTrue("Error while joining table", false);
                return;
            }

View Full Code Here

     */
    private boolean testSimpleGame0(DeckCardLists deckList, int i) throws InterruptedException {
        Connection connection = createConnection(TEST_USER_NAME + i);

        SimpleMageClient mageClient = new SimpleMageClient();
        Session session = new SessionImpl(mageClient);

        session.connect(connection);

        mageClient.setSession(session);
        UUID roomId = session.getMainRoomId();

        GameTypeView gameTypeView = session.getGameTypes().get(0);
        log.info("Game type view: " + gameTypeView.getName());
        MatchOptions options = createGameOptions(gameTypeView, session);

        TableView table = session.createTable(roomId, options);

        if (!session.joinTable(roomId, table.getTableId(), TEST_USER_NAME + i, "Human", 1, deckList,"")) {
            log.error("Error while joining table");
            Assert.assertTrue("Error while joining table", false);
            return true;
        }

        /*** Connect with a second player ***/
        Connection connection2 = createConnection(TEST_USER_NAME_2 + i);
        SimpleMageClient mageClient2 = new SimpleMageClient();
        Session session2 = new SessionImpl(mageClient2);
        session2.connect(connection2);

        mageClient2.setSession(session2);
        UUID roomId2 = session2.getMainRoomId();

        // connect to the table with the same deck
        if (!session2.joinTable(roomId2, table.getTableId(), TEST_USER_NAME_2 + i, "Human", 1, deckList,"")) {
            log.error("Error while joining table");
            Assert.assertTrue("Error while joining table", false);
            return true;
        }

View Full Code Here

        });

        initComponents();
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
            session = new SessionImpl(this);
            connectDialog = new ConnectDialog();
        } catch (Exception ex) {
            logger.fatal("", ex);
        }
       
View Full Code Here

        setSize(1024, 768);
        SettingsManager.getInstance().setScreenWidthAndHeight(1024, 768);
        DialogManager.updateParams(768, 1024, false);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);

        session = new SessionImpl(this);
        callbackClient = new CallbackClientImpl(this);
        connectDialog = new ConnectDialog();
        desktopPane.add(connectDialog, JLayeredPane.POPUP_LAYER);
        errorDialog = new ErrorDialog();
        errorDialog.setLocation(100, 100);
View Full Code Here

TOP

Related Classes of mage.remote.SessionImpl

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.