so I coded my own global tokens plugin it works great except the database will randomly loose connection and i add tokens during that and it wipes over the old token data im not sure whats wrong
Code:
public void onEnable() {
saveDefaultConfig();
Tokens.MySQL = new MySQL(this.plugin, this.plugin.getConfig().getString(
"database.host"), this.plugin.getConfig().getString(
"database.port"), this.plugin.getConfig().getString(
"database.database"), this.plugin.getConfig().getString(
"database.username"), this.plugin.getConfig().getString(
"database.password"));
Tokens.c = Tokens.MySQL.openConnection();
if (Tokens.c != null) {
initializeDatabase();
setupShop();
}
prefix = "&e&lTokens&f:&b ";
chat_color = "&d";
prefix_nocolor = "[" + this.plugin.getDescription().getName() + "] ";
this.plname = this.plugin.getDescription().getName().toLowerCase();
this.plugin.getLogger()
.info(String
.format("[%s] Has been enabled!",
new Object[] { this.plugin.getDescription()
.getName() }));
// new BukkitRunnable()
// {
// public void run()
// {
//
// Tokens.c = Tokens.MySQL.openConnection();
// }
// }.runTaskTimer(this, 0L, 20L * 60 * 10);
}
Code:
public void onDisable() {
Tokens.MySQL.closeConnection();
Tokens.c = null;
this.plugin.getLogger()
.info(String
.format("[%s] Has been disabled!",
new Object[] { this.plugin.getDescription()
.getName() }));
}
Banned forever. Reason: Scamming
