Possible fix...

This commit is contained in:
boy0001 2014-12-14 12:34:44 +11:00
parent 8e6608d613
commit 7266a2a875
2 changed files with 21 additions and 1 deletions

View File

@ -184,6 +184,13 @@ public class PlotMain extends JavaPlugin {
*/
private static LinkedHashMap<String, HashMap<PlotId, Plot>> plots;
/**
* Return an instance of MySQL
*/
public static MySQL getMySQL() {
return mySQL;
}
/**
* Check for expired plots
*/

View File

@ -53,7 +53,7 @@ public class SQLManager implements AbstractDB {
public final String CREATE_HELPERS;
public final String CREATE_PLOT;
// Private Final
private final Connection connection;
private Connection connection;
private final String prefix;
/**
@ -81,6 +81,19 @@ public class SQLManager implements AbstractDB {
"INSERT INTO `" + prefix + "plot_helpers` (`plot_plot_id`, `user_uuid`) values ";
CREATE_PLOT =
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)";
//schedule reconnect
Bukkit.getScheduler().scheduleSyncRepeatingTask(PlotMain.getMain(), new Runnable(){
public void run(){
try {
connection = PlotMain.getMySQL().openConnection();
}
catch (Exception e) {
e.printStackTrace();
}
}
}, 500000, 500000);
}
public void setTimout() {