Class StendhalWebsiteDAO
java.lang.Object
games.stendhal.server.core.engine.db.StendhalWebsiteDAO
database access for the redundant tables used on the website
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclears the online status of all players (used on server startup)voidclearOnlineStatus(DBTransaction transaction) clears the online status of all players (used on server startup)protected voidinsertIntoCharStats(DBTransaction transaction, Player player, Timestamp timestamp) Insert statistics information about a new playervoidlogTradeEvent(DBTransaction transaction, String charname, String itemname, int itemid, int quantity, int price, String stats, Timestamp timestamp) logs a trade eventvoidsetOnlineStatus(DBTransaction transaction, String playerName, boolean online) sets the online status of a particular playerprotected intupdateCharStats(DBTransaction transaction, Player player, Timestamp timestamp) updates the statistics information about a player
-
Constructor Details
-
StendhalWebsiteDAO
public StendhalWebsiteDAO()
-
-
Method Details
-
clearOnlineStatus
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- DBTransactionplayerName- name of playeronline- 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- DBTransactioncharname- name of characteritemname- name of itemitemid- id of itemquantity- quantityprice- pricestats- description of itemtimestamp- 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- DBTransactionplayer- Playertimestamp- 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- DBTransactionplayer- Player- Throws:
SQLException- in case of an database error
-