mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +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;
|
private static LinkedHashMap<String, HashMap<PlotId, Plot>> plots;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an instance of MySQL
|
||||||
|
*/
|
||||||
|
public static MySQL getMySQL() {
|
||||||
|
return mySQL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for expired plots
|
* Check for expired plots
|
||||||
*/
|
*/
|
||||||
|
@ -53,7 +53,7 @@ public class SQLManager implements AbstractDB {
|
|||||||
public final String CREATE_HELPERS;
|
public final String CREATE_HELPERS;
|
||||||
public final String CREATE_PLOT;
|
public final String CREATE_PLOT;
|
||||||
// Private Final
|
// Private Final
|
||||||
private final Connection connection;
|
private Connection connection;
|
||||||
private final String prefix;
|
private final String prefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,6 +81,19 @@ public class SQLManager implements AbstractDB {
|
|||||||
"INSERT INTO `" + prefix + "plot_helpers` (`plot_plot_id`, `user_uuid`) values ";
|
"INSERT INTO `" + prefix + "plot_helpers` (`plot_plot_id`, `user_uuid`) values ";
|
||||||
CREATE_PLOT =
|
CREATE_PLOT =
|
||||||
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)";
|
"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() {
|
public void setTimout() {
|
||||||
|
Loading…
Reference in New Issue
Block a user