Package games.stendhal.server.core.engine.db

Examples of games.stendhal.server.core.engine.db.PostmanDAO


    // define own version in replacement of marauroa's CharacterDAO
    DAORegister.get().register(CharacterDAO.class, new StendhalCharacterDAO());

    // define additional DAOs
    DAORegister.get().register(CidDAO.class, new CidDAO());
    DAORegister.get().register(PostmanDAO.class, new PostmanDAO());
    DAORegister.get().register(StendhalBuddyDAO.class, new StendhalBuddyDAO());
    DAORegister.get().register(StendhalHallOfFameDAO.class, new StendhalHallOfFameDAO());
    DAORegister.get().register(StendhalKillLogDAO.class, new StendhalKillLogDAO ());
    DAORegister.get().register(StendhalNPCDAO.class, new StendhalNPCDAO());
    DAORegister.get().register(StendhalWebsiteDAO.class, new StendhalWebsiteDAO());
View Full Code Here


    this.player = player;
  }

  @Override
  public void execute(DBTransaction transaction) throws SQLException {
    PostmanDAO dao = DAORegister.get().get(PostmanDAO.class);
    messages = dao.getChatMessages(transaction, player.getName());
    // mark the messages delivered in the same transaction that we got them in
    dao.markMessagesDelivered(transaction, player.getName());
  }
View Full Code Here

  @Override
  public void execute(DBTransaction transaction) throws SQLException {
    CharacterDAO characterdao = DAORegister.get().get(CharacterDAO.class);
    accountName = characterdao.getAccountName(transaction, target);
    if (accountName != null) {
      PostmanDAO postmandao = DAORegister.get().get(PostmanDAO.class);
      postmandao.storeMessage(transaction, source, target, message, messagetype);
    }
  }
View Full Code Here

    public void execute(DBTransaction transaction) throws SQLException {
      CharacterDAO characterdao = DAORegister.get().get(CharacterDAO.class);
      accountName = characterdao.getAccountName(transaction, target);
      // should not really happen with taxman, but check anyway
      if (accountName != null) {
        PostmanDAO postmandao = DAORegister.get().get(PostmanDAO.class);
        List<ChatMessage> oldMessages = postmandao.getChatMessages(transaction, target);
        for (ChatMessage msg : oldMessages) {
          if (msg.getSource().equals(source) && msg.getMessage().equals(message) && msg.getMessagetype().equals("N")) {
            /*
             * If a player has already an equal undelivered message,
             * don't send a new one. It is presumably from a
             * previous check and the new one happened after a
             * reboot.
             */
            logger.debug("NOT sending a notice to '" + target + "': " + message);
            return;
          }
        }
        logger.info("sending a notice to '" + target + "': " + message);
        postmandao.storeMessage(source, target, message, "N");
      } else {
        logger.error("Not sending a Taxman notice to '" + target
            + ", because the account does not exist. Message': " + message);
      }
    }
View Full Code Here

TOP

Related Classes of games.stendhal.server.core.engine.db.PostmanDAO

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.