mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-20 07:01:22 +01:00
Lets delete the columns from explore database when the world is not exist
This commit is contained in:
parent
e7f7c7deb0
commit
74a97f5d34
@ -96,9 +96,7 @@ public class ExploreManager {
|
||||
String names = res.getString(ExploreDataTableFields.playerNames.getCollumn());
|
||||
int id = res.getInt("id");
|
||||
|
||||
JobsWorld jobsWorld = null;
|
||||
if (worldName != null)
|
||||
jobsWorld = Util.getJobsWorld(worldName);
|
||||
JobsWorld jobsWorld = Util.getJobsWorld(worldName);
|
||||
if (jobsWorld == null)
|
||||
jobsWorld = Util.getJobsWorld(worldId);
|
||||
|
||||
|
@ -2463,7 +2463,16 @@ public abstract class JobsDAO {
|
||||
prest = conn.prepareStatement("SELECT * FROM `" + DBTables.ExploreDataTable.getTableName() + "`;");
|
||||
res = prest.executeQuery();
|
||||
while (res.next()) {
|
||||
Jobs.getExplore().load(res);
|
||||
String worldName = res.getString(ExploreDataTableFields.worldname.getCollumn());
|
||||
if (worldName == null || Bukkit.getWorld(worldName) == null) {
|
||||
PreparedStatement prest2 = null;
|
||||
prest2 = conn.prepareStatement("DELETE FROM `" + DBTables.ExploreDataTable.getTableName() + "` WHERE `" + ExploreDataTableFields.worldname.getCollumn() + "` = ?;");
|
||||
prest2.setString(1, worldName);
|
||||
prest2.execute();
|
||||
close(prest2);
|
||||
} else {
|
||||
Jobs.getExplore().load(res);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user