Fix Purge Wipe Data
This commit is contained in:
parent
d926d9ac83
commit
90ae238c15
2
pom.xml
2
pom.xml
@ -24,7 +24,7 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<version>3.2.1-DEV-1</version>
|
<version>3.2.1-DEV-2</version>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import java.io.OutputStream;
|
|||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -118,7 +119,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
instance = this;
|
instance = this;
|
||||||
authme = instance;
|
authme = instance;
|
||||||
|
|
||||||
authmeLogger.setParent(this.getLogger());
|
authmeLogger.setParent(this.getLogger());
|
||||||
|
|
||||||
citizens = new CitizensCommunicator(this);
|
citizens = new CitizensCommunicator(this);
|
||||||
@ -147,12 +148,11 @@ public class AuthMe extends JavaPlugin {
|
|||||||
this.getLogger().setFilter(new ConsoleFilter());
|
this.getLogger().setFilter(new ConsoleFilter());
|
||||||
Bukkit.getLogger().setFilter(new ConsoleFilter());
|
Bukkit.getLogger().setFilter(new ConsoleFilter());
|
||||||
Logger.getLogger("Minecraft").setFilter(new ConsoleFilter());
|
Logger.getLogger("Minecraft").setFilter(new ConsoleFilter());
|
||||||
Logger.getLogger("AuthMe").setFilter(new ConsoleFilter());
|
authmeLogger.setFilter(new ConsoleFilter());
|
||||||
try {
|
|
||||||
org.apache.logging.log4j.core.Logger coreLogger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger();
|
// Set Log4J Filter
|
||||||
coreLogger.addFilter(new Log4JFilter());
|
org.apache.logging.log4j.core.Logger coreLogger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger();
|
||||||
} catch (Exception e) {
|
coreLogger.addFilter(new Log4JFilter());
|
||||||
} catch (NoClassDefFoundError e) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Load MailApi
|
//Load MailApi
|
||||||
@ -173,7 +173,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
//Check ChestShop
|
//Check ChestShop
|
||||||
checkChestShop();
|
checkChestShop();
|
||||||
|
|
||||||
//Check Essentials
|
//Check Essentials
|
||||||
checkEssentials();
|
checkEssentials();
|
||||||
|
|
||||||
@ -593,8 +593,9 @@ public class AuthMe extends JavaPlugin {
|
|||||||
if (!Settings.usePurge) {
|
if (!Settings.usePurge) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long days = Settings.purgeDelay * 86400000;
|
Calendar calendar = Calendar.getInstance();
|
||||||
long until = new Date().getTime() - days;
|
calendar.add(Calendar.DATE, -(Settings.purgeDelay));
|
||||||
|
long until = calendar.getTimeInMillis();
|
||||||
List<String> cleared = this.database.autoPurgeDatabase(until);
|
List<String> cleared = this.database.autoPurgeDatabase(until);
|
||||||
ConsoleLogger.info("AutoPurgeDatabase : " + cleared.size() + " accounts removed.");
|
ConsoleLogger.info("AutoPurgeDatabase : " + cleared.size() + " accounts removed.");
|
||||||
if (cleared.isEmpty())
|
if (cleared.isEmpty())
|
||||||
@ -734,7 +735,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
} catch (Exception e) {}
|
} catch (Exception e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCountryCode(InetAddress ip) {
|
public String getCountryCode(InetAddress ip) {
|
||||||
try {
|
try {
|
||||||
if (ls == null)
|
if (ls == null)
|
||||||
@ -745,7 +746,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
} catch (Exception e) {}
|
} catch (Exception e) {}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void switchAntiBotMod(boolean mode) {
|
public void switchAntiBotMod(boolean mode) {
|
||||||
this.antibotMod = mode;
|
this.antibotMod = mode;
|
||||||
Settings.switchAntiBotMod(mode);
|
Settings.switchAntiBotMod(mode);
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -102,8 +103,9 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
long days = Long.parseLong(args[1]) * 86400000;
|
Calendar calendar = Calendar.getInstance();
|
||||||
long until = new Date().getTime() - days;
|
calendar.add(Calendar.DATE, -(Integer.parseInt(args[1])));
|
||||||
|
long until = calendar.getTimeInMillis();
|
||||||
List<String> purged = database.autoPurgeDatabase(until);
|
List<String> purged = database.autoPurgeDatabase(until);
|
||||||
sender.sendMessage("Deleted " + purged.size() + " user accounts");
|
sender.sendMessage("Deleted " + purged.size() + " user accounts");
|
||||||
if (Settings.purgeEssentialsFile && plugin.ess != null)
|
if (Settings.purgeEssentialsFile && plugin.ess != null)
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ author: Xephi59
|
|||||||
website: http://dev.bukkit.org/bukkit-plugins/authme-recoded/
|
website: http://dev.bukkit.org/bukkit-plugins/authme-recoded/
|
||||||
description: AuthMe prevents people, which aren't logged in, from doing stuff like placing blocks, moving, typing commands or seeing the inventory of the current player.
|
description: AuthMe prevents people, which aren't logged in, from doing stuff like placing blocks, moving, typing commands or seeing the inventory of the current player.
|
||||||
main: fr.xephi.authme.AuthMe
|
main: fr.xephi.authme.AuthMe
|
||||||
version: 3.2.1-DEV-1
|
version: 3.2.1-DEV-2
|
||||||
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag, Essentials, EssentialsSpawn]
|
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag, Essentials, EssentialsSpawn]
|
||||||
commands:
|
commands:
|
||||||
register:
|
register:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user