From 5b98759b61611106b379ead6fb5f1de2287ff14a Mon Sep 17 00:00:00 2001 From: vanhec_a Date: Mon, 12 Oct 2015 15:01:57 +0200 Subject: [PATCH] Change how purge logged works at starting/stopping server --- src/main/java/fr/xephi/authme/AuthMe.java | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 98b8f1c25..6596ae53b 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -263,19 +263,17 @@ public class AuthMe extends JavaPlugin { } // Reload support hook - if (Settings.reloadSupport) { - if (database != null) { - int playersOnline = Utils.getOnlinePlayers().size(); - if (playersOnline < 1) { - database.purgeLogged(); - } else { - for (PlayerAuth auth : database.getLoggedPlayers()) { - if (auth == null) - continue; - auth.setLastLogin(new Date().getTime()); - database.updateSession(auth); - PlayerCache.getInstance().addPlayer(auth); - } + if (database != null) { + int playersOnline = Utils.getOnlinePlayers().size(); + if (playersOnline < 1) { + database.purgeLogged(); + } else if (Settings.reloadSupport) { + for (PlayerAuth auth : database.getLoggedPlayers()) { + if (auth == null) + continue; + auth.setLastLogin(new Date().getTime()); + database.updateSession(auth); + PlayerCache.getInstance().addPlayer(auth); } } } @@ -564,7 +562,6 @@ public class AuthMe extends JavaPlugin { } } PlayerCache.getInstance().removePlayer(name); - database.setUnlogged(name); player.saveData(); }