Package mage.server

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


      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

  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

  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

  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

  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

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.