Package mage.interfaces

Examples of mage.interfaces.Action


        }, true);
    }

    @Override
    public void disconnectUser(final String sessionId, final String userSessionId) throws MageException {
        execute("disconnectUser", sessionId, new Action() {
            @Override
            public void execute() {
                SessionManager.getInstance().disconnectUser(sessionId, userSessionId);
            }
        });
View Full Code Here


        });
    }

    @Override
    public void endUserSession(final String sessionId, final String userSessionId) throws MageException {
        execute("endUserSession", sessionId, new Action() {
            @Override
            public void execute() {
                SessionManager.getInstance().endUserSession(sessionId, userSessionId);
            }
        });
View Full Code Here

     * @param tableId
     * @throws MageException
     */
    @Override
    public void removeTable(final String sessionId, final UUID tableId) throws MageException {
        execute("removeTable", sessionId, new Action() {
            @Override
            public void execute() {
                UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                TableManager.getInstance().removeTable(userId, tableId);
            }
View Full Code Here

    }

    @Override
    public void sendFeedbackMessage(final String sessionId, final String username, final String title, final String type, final String message, final String email) throws MageException {
        if (title != null && message != null) {
            execute("sendFeedbackMessage", sessionId, new Action() {
                @Override
                public void execute() {
                    String host = SessionManager.getInstance().getSession(sessionId).getHost();
                    FeedbackServiceImpl.instance.feedback(username, title, type, message, email, host);
                    LogServiceImpl.instance.log(LogKeys.KEY_FEEDBACK_ADDED, sessionId, username, host);
View Full Code Here

    }
   
    @Override
    public void sendBroadcastMessage(final String sessionId, final String message) throws MageException {
        if (message != null) {
            execute("sendBroadcastMessage", sessionId, new Action() {
                @Override
                public void execute() {
                    for (User user : UserManager.getInstance().getUsers()) {
                        if (message.toLowerCase(Locale.ENGLISH).startsWith("warn")) {
                            user.fireCallback(new ClientCallback("serverMessage", null, new ChatMessage("SERVER", message, null, MessageColor.RED)));
View Full Code Here

     */
    private PriorityTimer createPlayerTimer(UUID playerId, int count) {
        final UUID initPlayerId = playerId;
        long delayMs = 250L; // run each 250 ms

        Action executeOnNoTimeLeft = new Action() {
            @Override
            public void execute() throws MageException {
                game.timerTimeout(initPlayerId);
                logger.debug("Player has no time left to end the match: " + initPlayerId + ". Conceding.");
            }
View Full Code Here

    }

    public static void main(String[] args) throws Exception {
        long delay = 250L;
        int count = 5;
        PriorityTimer timer = new PriorityTimer(count, delay, new Action() {
            @Override
            public void execute() throws MageException {
                System.out.println("Exit");
                System.exit(0);
            }
View Full Code Here

TOP

Related Classes of mage.interfaces.Action

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.