mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-02-12 03:59:22 +00:00
WE SERIOUSLY NEED TO FIX THIS ISSUE AT SOME POINT
(THIS IS NOT THE OFFICIAL FIX, JUST A TEMPORARY THING)
This commit is contained in:
parent
f0d2fd93dd
commit
8e6608d613
1 changed files with 22 additions and 0 deletions
|
@ -66,6 +66,8 @@ public class SQLManager implements AbstractDB {
|
||||||
// Private final
|
// Private final
|
||||||
connection = c;
|
connection = c;
|
||||||
prefix = p;
|
prefix = p;
|
||||||
|
// Set timout
|
||||||
|
setTimout();
|
||||||
// Public final
|
// Public final
|
||||||
SET_OWNER =
|
SET_OWNER =
|
||||||
"UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?";
|
"UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?";
|
||||||
|
@ -81,6 +83,22 @@ public class SQLManager implements AbstractDB {
|
||||||
"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(?, ?, ?, ?)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTimout() {
|
||||||
|
runTask(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
final PreparedStatement statement = connection.prepareStatement("SET GLOBAL wait_timeout =28800;");
|
||||||
|
statement.executeUpdate();
|
||||||
|
statement.close();
|
||||||
|
} catch (final SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Logger.add(LogLevel.DANGER, "Could not reset MySQL timout.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Plot owner
|
* Set Plot owner
|
||||||
*
|
*
|
||||||
|
@ -265,6 +283,10 @@ public class SQLManager implements AbstractDB {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void createTables(final String database, final boolean add_constraint) throws SQLException {
|
public void createTables(final String database, final boolean add_constraint) throws SQLException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final boolean mysql = database.equals("mysql");
|
final boolean mysql = database.equals("mysql");
|
||||||
final Statement stmt = connection.createStatement();
|
final Statement stmt = connection.createStatement();
|
||||||
if (mysql) {
|
if (mysql) {
|
||||||
|
|
Loading…
Reference in a new issue