| Modifier and Type | Class and Description |
|---|---|
static class |
Database.DatabaseType |
| Modifier and Type | Method and Description |
|---|---|
void |
addShop(Shop shop,
Callback callback)
Adds a shop to the database
|
void |
connect(Callback callback)
(Re-)Connects to the the database and initializes it.
|
void |
disconnect()
Closes the connection to the database
|
abstract Connection |
getConnection() |
void |
getLastLogout(org.bukkit.entity.Player player,
Callback callback)
Get the last logout of a player
|
void |
getRevenue(org.bukkit.entity.Player player,
long logoutTime,
Callback callback)
Get the revenue a player got while he was offline
|
void |
getShops(boolean showConsoleMessages,
Callback callback)
Get all shops from the database
|
void |
isShop(int id,
Callback callback) |
void |
logEconomy(org.bukkit.entity.Player executor,
org.bukkit.inventory.ItemStack product,
org.bukkit.OfflinePlayer vendor,
Shop.ShopType shopType,
org.bukkit.Location location,
double price,
ShopBuySellEvent.Type type,
Callback callback)
Log an economy transaction to the database
|
void |
logLogout(org.bukkit.entity.Player player,
long timestamp,
Callback callback)
Log a logout to the database
|
void |
removeShop(Shop shop,
Callback callback)
Remove a shop from the database
|
public abstract Connection getConnection()
public void connect(Callback callback)
callback - Callback that - if succeeded - returns the amount of shops that were found (as int)public void removeShop(Shop shop, Callback callback)
shop - Shop to removecallback - Callback that - if succeeded - returns nullpublic void isShop(int id,
Callback callback)
id - ID of the shopcallback - Callback that - if succeeded - returns whether a shop with the given ID exists (as boolean)public void getShops(boolean showConsoleMessages,
Callback callback)
callback - Callback that - if succeeded - returns an array of all shops (as Shop[])showConsoleMessages - Whether console messages (errors or warnings) should be shownpublic void addShop(Shop shop, Callback callback)
shop - Shop to addcallback - Callback that - if succeeded - returns the ID the shop was given (as int)public void logEconomy(org.bukkit.entity.Player executor,
org.bukkit.inventory.ItemStack product,
org.bukkit.OfflinePlayer vendor,
Shop.ShopType shopType,
org.bukkit.Location location,
double price,
ShopBuySellEvent.Type type,
Callback callback)
executor - Player who bought/sold somethingproduct - ItemStack that was bought/soldvendor - Vendor of the shoplocation - Location of the shopprice - Price (buyprice or sellprice, depends on type)type - Whether the player bought or sold somethingcallback - Callback that - if succeeded - returns nullpublic void getRevenue(org.bukkit.entity.Player player,
long logoutTime,
Callback callback)
player - Player whose revenue to getlogoutTime - Time in milliseconds when he logged out the last timecallback - Callback that - if succeeded - returns the revenue the player made while offline (as double)public void logLogout(org.bukkit.entity.Player player,
long timestamp,
Callback callback)
player - Player who logged outtimestamp - Time in milliseconds when the player logged outcallback - Callback that - if succeeded - returns nullpublic void getLastLogout(org.bukkit.entity.Player player,
Callback callback)
player - Player who logged outcallback - Callback that - if succeeded - returns the time in milliseconds the player logged out (as long)public void disconnect()
Copyright © 2017. All rights reserved.