Class StendhalWebsiteDAO
java.lang.Object
games.stendhal.server.core.engine.db.StendhalWebsiteDAO
database access for the redundant tables used on the website
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clears the online status of all players (used on server startup)void
clearOnlineStatus(DBTransaction transaction)
clears the online status of all players (used on server startup)protected void
insertIntoCharStats(DBTransaction transaction, Player player, Timestamp timestamp)
Insert statistics information about a new playervoid
logTradeEvent(DBTransaction transaction, String charname, String itemname, int itemid, int quantity, int price, String stats, Timestamp timestamp)
logs a trade eventvoid
setOnlineStatus(DBTransaction transaction, String playerName, boolean online)
sets the online status of a particular playerprotected int
updateCharStats(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 SQLExceptionsets 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 SQLExceptionlogs 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 SQLExceptionupdates 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 SQLExceptionInsert statistics information about a new player- Parameters:
transaction
- DBTransactionplayer
- Player- Throws:
SQLException
- in case of an database error
-