Examples of fireCallback()


Examples of mage.server.User.fireCallback()

    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));
            }
        }
    }

    public void gameError(final String message) {
View Full Code Here

Examples of mage.server.User.fireCallback()

    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));
            }
        }
    }

    public void setKilled() {
View Full Code Here

Examples of mage.server.User.fireCallback()

    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)));
        }
    }

    public void stop() {
        gameResult("stopped replay");
View Full Code Here

Examples of mage.server.User.fireCallback()

    @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);
    }

    private void updateGame(final GameState state, Game game) {
View Full Code Here

Examples of mage.server.User.fireCallback()

            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

Examples of mage.server.User.fireCallback()

        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                if (futureTimeout != null && !futureTimeout.isDone()) {
                    int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS);
                    user.fireCallback(new ClientCallback("draftInit", draft.getId(), new DraftClientMessage(getDraftPickView(remaining))));
                }
                return true;
            }
        }
        return false;
View Full Code Here

Examples of mage.server.User.fireCallback()

    public void update() {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("draftUpdate", draft.getId(), getDraftView()));
            }
        }
    }

    // not used
View Full Code Here

Examples of mage.server.User.fireCallback()

    //
    public void inform(final String message) {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("draftInform", draft.getId(), new DraftClientMessage(getDraftView(), message)));
            }
        }
    }

    public void draftOver() {
View Full Code Here

Examples of mage.server.User.fireCallback()

    public void draftOver() {
        if (!killed) {
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("draftOver", draft.getId()));
            }
        }
    }

    public void pickCard(int timeout) {
View Full Code Here

Examples of mage.server.User.fireCallback()

    public void pickCard(int timeout) {
        if (!killed) {
            setupTimeout(timeout);
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("draftPick", draft.getId(), new DraftClientMessage(getDraftPickView(timeout))));
            }
        }
    }

    private synchronized void setupTimeout(int seconds) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.