Class StendhalWebsiteDAO

java.lang.Object
games.stendhal.server.core.engine.db.StendhalWebsiteDAO

public class StendhalWebsiteDAO extends Object
database access for the redundant tables used on the website
  • Constructor Details

    • StendhalWebsiteDAO

      public StendhalWebsiteDAO()
  • Method Details

    • clearOnlineStatus

      public void clearOnlineStatus(DBTransaction transaction) throws SQLException
      clears the online status of all players (used on server startup)
      Parameters:
      transaction - DBTransaction
      Throws:
      SQLException - in case of an database error
    • setOnlineStatus

      public void setOnlineStatus(DBTransaction transaction, String playerName, boolean online) throws SQLException
      sets the online status of a particular player
      Parameters:
      transaction - DBTransaction
      playerName - name of player
      online - true, if the player is online; false otherwise
      Throws:
      SQLException - in case of an database error
    • clearOnlineStatus

      public void clearOnlineStatus()
      clears the online status of all players (used on server startup)
    • logTradeEvent

      public void logTradeEvent(DBTransaction transaction, String charname, String itemname, int itemid, int quantity, int price, String stats, Timestamp timestamp) throws SQLException
      logs a trade event
      Parameters:
      transaction - DBTransaction
      charname - name of character
      itemname - name of item
      itemid - id of item
      quantity - quantity
      price - price
      stats - description of item
      timestamp - timestamp
      Throws:
      SQLException - in case of an database error
    • updateCharStats

      protected int updateCharStats(DBTransaction transaction, Player player, Timestamp timestamp) throws SQLException
      updates the statistics information about a player
      Parameters:
      transaction - DBTransaction
      player - Player
      timestamp - timestamp
      Returns:
      number of updates rows
      Throws:
      SQLException - in case of an database error
    • insertIntoCharStats

      protected void insertIntoCharStats(DBTransaction transaction, Player player, Timestamp timestamp) throws SQLException
      Insert statistics information about a new player
      Parameters:
      transaction - DBTransaction
      player - Player
      Throws:
      SQLException - in case of an database error