mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 12:06:15 +01:00
Possible fix...
This commit is contained in:
parent
8e6608d613
commit
7266a2a875
@ -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
|
||||
*/
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user