mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-02-12 03:59:22 +00:00
Possible fix...
This commit is contained in:
parent
8e6608d613
commit
7266a2a875
2 changed files with 21 additions and 1 deletions
|
@ -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 a new issue