Package mage.server

Examples of mage.server.User


            gameView.setOpponentHands(handCards);
        }
    }

    public void removeGame() {
        User user = UserManager.getInstance().getUser(userId);
        if (user != null) {
            user.removeGame(playerId);
        }
    }
View Full Code Here


        this.isPlayer = isPlayer;
    }

    public boolean init() {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameInit", game.getId(), getGameView()));
                return true;
            }
        }
        return false;
    }
View Full Code Here

        return false;
    }

    public void update() {
        if (!killed) {
                User user = UserManager.getInstance().getUser(userId);
                if (user != null) {
                    user.fireCallback(new ClientCallback("gameUpdate", game.getId(), getGameView()));
                }
        }
    }
View Full Code Here

        }
    }

    public void inform(final String message) {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameInform", game.getId(), new GameClientMessage(getGameView(), message)));
            }
        }
    }
View Full Code Here

        }
    }

    public void informPersonal(final String message) {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameInformPersonal", game.getId(), new GameClientMessage(getGameView(), message)));
            }
        }
    }
View Full Code Here

        }
    }

    public void gameOver(final String message) {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.removeGameWatchInfo(game.getId());
                user.fireCallback(new ClientCallback("gameOver", game.getId(), message));
            }
        }
    }
View Full Code Here

        }
    }

    public void gameError(final String message) {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameError", game.getId(), message));
            }
        }
    }
View Full Code Here

        this.userId = userId;
    }

    public void replay() {
        replay.start();
        User user = UserManager.getInstance().getUser(userId);
        if (user != null) {
            user.fireCallback(new ClientCallback("replayInit", replay.getGame().getId(), new GameView(replay.next(), replay.getGame(), null)));
        }
    }
View Full Code Here

        updateGame(replay.previous(), replay.getGame());
    }

    @Override
    public void gameResult(final String result) {
        User user = UserManager.getInstance().getUser(userId);
        if (user != null) {
            user.fireCallback(new ClientCallback("replayDone", replay.getGame().getId(), result));
        }
        ReplayManager.getInstance().endReplay(replay.getGame().getId(), userId);
    }
View Full Code Here

    private void updateGame(final GameState state, Game game) {
        if (state == null) {
            gameResult("game ended");
        }
        else {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("replayUpdate", replay.getGame().getId(), new GameView(state, game, null)));
            }
        }
    }
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.