Examples of fireCallback()


Examples of mage.server.Session.fireCallback()

  @Override
  public void gameResult(final String result) {
    Session session = SessionManager.getInstance().getSession(sessionId);
    if (session != null)
      session.fireCallback(new ClientCallback("replayDone", result));
  }

  private void updateGame(final GameState state, Game game) {
    if (state == null) {
      gameResult("game ended");
View Full Code Here

Examples of mage.server.Session.fireCallback()

      gameResult("game ended");
    }
    else {
      Session session = SessionManager.getInstance().getSession(sessionId);
      if (session != null)
        session.fireCallback(new ClientCallback("replayUpdate", new GameView(state, game)));
    }
  }

}
View Full Code Here

Examples of mage.server.Session.fireCallback()

  public boolean init(final GameView gameView) {
    if (!killed) {
      Session session = SessionManager.getInstance().getSession(sessionId);
      if (session != null) {
        session.clearAck();
        session.fireCallback(new ClientCallback("gameInit", gameView));
        if (waitForAck("gameInit"))
          return true;
      }
    }
    return false;
View Full Code Here

Examples of mage.server.Session.fireCallback()

  public void update(final GameView gameView) {
    if (!killed) {
      Session session = SessionManager.getInstance().getSession(sessionId);
      if (session != null)
        session.fireCallback(new ClientCallback("gameUpdate", gameView));
    }
  }

  public void inform(final String message, final GameView gameView) {
    if (!killed) {
View Full Code Here

Examples of mage.server.Session.fireCallback()

  public void inform(final String message, final GameView gameView) {
    if (!killed) {
      Session session = SessionManager.getInstance().getSession(sessionId);
      if (session != null)
        session.fireCallback(new ClientCallback("gameInform", new GameClientMessage(gameView, message)));
    }
  }

  public void gameOver(final String message) {
    if (!killed) {
View Full Code Here

Examples of mage.server.Session.fireCallback()

  public void gameOver(final String message) {
    if (!killed) {
      Session session = SessionManager.getInstance().getSession(sessionId);
      if (session != null)
        session.fireCallback(new ClientCallback("gameOver", message));
    }
  }

  protected void handleRemoteException(RemoteException ex) {
    logger.log(Level.SEVERE, null, ex);
View Full Code Here

Examples of mage.server.User.fireCallback()

    public void ask(final String question)  {
        if (!killed) {
            setupTimeout();
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question)));
            }
        }
    }

    public void target(final String question, final CardsView cardView, final Set<UUID> targets, final boolean required, final Map<String, Serializable> options) {
View Full Code Here

Examples of mage.server.User.fireCallback()

    public void target(final String question, final CardsView cardView, final Set<UUID> targets, final boolean required, final Map<String, Serializable> options) {
        if (!killed) {
            setupTimeout();
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameTarget", game.getId(), new GameClientMessage(getGameView(), question, cardView, targets, required, options)));
            }
        }
    }

    public void select(final String message, final Map<String, Serializable> options) {
View Full Code Here

Examples of mage.server.User.fireCallback()

    public void select(final String message, final Map<String, Serializable> options) {
        if (!killed) {
            setupTimeout();
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameSelect", game.getId(), new GameClientMessage(getGameView(), message, options)));
            }
        }
    }

    public void chooseAbility(final AbilityPickerView abilities) {
View Full Code Here

Examples of mage.server.User.fireCallback()

    public void chooseAbility(final AbilityPickerView abilities) {
        if (!killed) {
            setupTimeout();
            User user = UserManager.getInstance().getUser(userId);
            if (user != null) {
                user.fireCallback(new ClientCallback("gameChooseAbility", game.getId(), abilities));
            }
        }
    }

    public void choosePile(final String message, final CardsView pile1, final CardsView pile2) {
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.