public class DatabaseManager
extends java.lang.Object
| Constructor and Description |
|---|
DatabaseManager(Banana plugin) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncAddBan(java.lang.String uuid,
java.lang.String message,
boolean tempBanned,
java.lang.Long tempBanDate)
Used to add a player who has been banned.
|
void |
asyncAddWarning(java.lang.String uuid,
java.lang.String warnMessage,
java.lang.String warner)
Used to add a warning to the database, it will be
|
void |
asyncBanIP(java.lang.String address,
java.lang.String message,
boolean tempBanned,
java.lang.Long tempBanDate)
Used to add async add an IP ban to the database
|
void |
asyncDeleteWarning(int warningID)
Used to delete a warning in the database
|
void |
asyncListWarnings(org.bukkit.entity.Player player,
java.lang.String uuid)
List the warnings to the player who is specified
|
void |
asyncRemoveBan(java.lang.String uuid)
Used to delete a ban in the database.
|
void |
asyncRemoveIPBan(java.lang.String address)
Used to async unban an ip
|
void |
asyncUpdatePlayer(java.lang.String uuid,
java.lang.String address,
java.lang.String playerName) |
static java.util.Calendar |
convertToGmt(java.util.Calendar cal) |
static boolean |
isUpating()
Used to tell if the database is set to loop (this doesn't necessarily mean it's looping, though)
|
void |
logCommand(java.lang.Enum<CommandType> commandType,
java.util.UUID senderUUID)
Used to log a command a player ran! Only really useful for commands inside of BANana
|
boolean |
populateDatabase()
Used to get the database ready for work!
|
void |
queueEntry(java.lang.String sql)
Adds an entry to be updating upon the next loop
|
static void |
setUpdating(boolean isUpdating)
Used to set if the database loop runs.
|
void |
startLoop()
Used to start the update loop...
|
boolean |
syncLoadValues()
Used to load all of the stored information into the active cache (should only be used once!)
Done in a sync thread.
|
public DatabaseManager(Banana plugin)
public static void setUpdating(boolean isUpdating)
isUpdating - public static boolean isUpating()
public void startLoop()
public void queueEntry(java.lang.String sql)
sql - The string sql to be updatedpublic boolean populateDatabase()
public boolean syncLoadValues()
public void asyncAddBan(java.lang.String uuid,
java.lang.String message,
boolean tempBanned,
java.lang.Long tempBanDate)
uuid - The uuid to banmessage - The message to ban! Cannot be null, must be some valuetempBanned - If the player is being tempbanned or nottempBanDate - If the player is being tempBanned, a long version of the date (in milliseconds) must be providedpublic void asyncRemoveBan(java.lang.String uuid)
uuid - The uuid to unbanpublic void asyncAddWarning(java.lang.String uuid,
java.lang.String warnMessage,
java.lang.String warner)
uuid - The uuid to add to the stringwarnMessage - The message that went along with the warning!public void asyncDeleteWarning(int warningID)
warningID - The row ID to deletepublic void asyncListWarnings(org.bukkit.entity.Player player,
java.lang.String uuid)
player - The player to list the warnings touuid - The uuid to fetch the warnings frompublic void logCommand(java.lang.Enum<CommandType> commandType, java.util.UUID senderUUID)
commandName - The name of the command to logsenderUUID - Thepublic void asyncBanIP(java.lang.String address,
java.lang.String message,
boolean tempBanned,
java.lang.Long tempBanDate)
address - The address to ban (wildcards might be supported D:)message - The message to go with the ban (optional)tempBanned - Set to true if this is a tempbantempBanDate - If tempBanned is set to true, you must give the date of the unbanpublic void asyncUpdatePlayer(java.lang.String uuid,
java.lang.String address,
java.lang.String playerName)
public void asyncRemoveIPBan(java.lang.String address)
address - The IP to unbanpublic static java.util.Calendar convertToGmt(java.util.Calendar cal)