Package mage.server

Examples of mage.server.User


            futureTimeout.cancel(true);
        }
    }
   
    private void removeTournamentForUser() {
        User user = UserManager.getInstance().getUser(userId);
        if (user != null) {
            user.removeTournament(playerId);
        }       
    }
View Full Code Here


    public synchronized void join(UUID userId) {
        UUID playerId = userPlayerMap.get(userId);
        if (playerId == null) {
            if (logger.isDebugEnabled()) {
                User user = UserManager.getInstance().getUser(userId);
                if (user != null) {
                    logger.debug(user.getName() + " shows tournament panel  tournamentId: " + tournament.getId());
                }
            }
            return;
        }
        if (tournamentSessions.containsKey(playerId)) {
            logger.debug("player reopened tournament panel   userId: " + userId + " tournamentId: " + tournament.getId());
            return;
        }
        // first join of player
        TournamentSession tournamentSession = new TournamentSession(tournament, userId, tableId, playerId);
        tournamentSessions.put(playerId, tournamentSession);
        User user = UserManager.getInstance().getUser(userId);
        if (user != null) {
            user.addTournament(playerId, tournamentSession);
            TournamentPlayer player = tournament.getPlayer(playerId);
            player.setJoined();
            logger.debug("player " +player.getPlayer().getName()  + " - client has joined tournament " + tournament.getId());
            ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getName() + " has joined the tournament", MessageColor.BLACK, true, MessageType.STATUS);
            checkStart();
View Full Code Here

            TournamentPlayer tournamentPlayer = tournament.getPlayer(userPlayerMap.get(userId));
            if (tournamentPlayer.getDeck() != null) {
                tournament.autoSubmit(userPlayerMap.get(userId), tournamentPlayer.generateDeck());
            } else {
                StringBuilder sb = new StringBuilder();
                User user = UserManager.getInstance().getUser(userId);
                if (user != null) {
                    sb.append(user.getName());
                }
                sb.append(" - no deck found for auto submit");
                logger.fatal(sb);
                tournamentPlayer.setEliminated();
                tournamentPlayer.setStateInfo("No deck for auto submit");
View Full Code Here

            }
        }
        // replace player that quits with draft bot
        if (humans > 1) {
            String replacePlayerName = "Draftbot";
            User user = UserManager.getInstance().getUser(userId);
            TableController tableController = TableManager.getInstance().getController(tableId);
            if (tableController != null) {
                if (user != null) {
                    replacePlayerName = "Draftbot (" + user.getName() + ")";
                }
                tableController.replaceDraftPlayer(leavingPlayer.getPlayer(), replacePlayerName, "Computer - draftbot", 5);
                if (user != null) {
                    user.removeDraft(leavingPlayer.getPlayer().getId());
                    user.removeTable(leavingPlayer.getPlayer().getId());
                    user.removeTournament(leavingPlayer.getPlayer().getId());
                }
                ChatManager.getInstance().broadcast(chatId, "", leavingPlayer.getPlayer().getName() + " was replaced by draftbot", MessageColor.BLACK, true, MessageType.STATUS);
            }
            return true;
        }
View Full Code Here

TOP

Related Classes of mage.server.User

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.