mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-24 12:16:36 +01:00
Fixed purge include parameter not functioning correctly for SQLite databases
This commit is contained in:
parent
888df067f9
commit
3194c35bb9
@ -285,18 +285,22 @@ public class PurgeCommand extends Consumer {
|
||||
boolean error = false;
|
||||
if (!excludeTables.contains(table)) {
|
||||
try {
|
||||
boolean purge = true;
|
||||
String timeLimit = "";
|
||||
if (purgeTables.contains(table)) {
|
||||
String blockRestriction = "";
|
||||
String blockRestriction = "(";
|
||||
if (hasBlockRestriction && restrictTables.contains(table)) {
|
||||
blockRestriction = "type IN(" + includeBlockFinal + ") AND ";
|
||||
blockRestriction = "type NOT IN(" + includeBlockFinal + ") OR (type IN(" + includeBlockFinal + ") AND ";
|
||||
}
|
||||
else if (hasBlockRestriction) {
|
||||
purge = false;
|
||||
}
|
||||
|
||||
if (argWid > 0 && worldTables.contains(table)) {
|
||||
timeLimit = " WHERE (" + blockRestriction + "wid = '" + argWid + "' AND (time >= '" + timeEnd + "' OR time < '" + timeStart + "')) OR (" + blockRestriction + "wid != '" + argWid + "')";
|
||||
timeLimit = " WHERE (" + blockRestriction + "wid = '" + argWid + "' AND (time >= '" + timeEnd + "' OR time < '" + timeStart + "'))) OR (wid != '" + argWid + "')";
|
||||
}
|
||||
else if (argWid == 0) {
|
||||
timeLimit = " WHERE " + blockRestriction + "(time >= '" + timeEnd + "' OR time < '" + timeStart + "')";
|
||||
else if (argWid == 0 && purge) {
|
||||
timeLimit = " WHERE " + blockRestriction + "(time >= '" + timeEnd + "' OR time < '" + timeStart + "'))";
|
||||
}
|
||||
}
|
||||
query = "INSERT INTO " + purgePrefix + table + " SELECT " + columns + " FROM " + ConfigHandler.prefix + table + timeLimit;
|
||||
|
Loading…
Reference in New Issue
Block a user