Change how purge logged works at starting/stopping server

This commit is contained in:
vanhec_a 2015-10-12 15:01:57 +02:00
parent 3c0e6e06c7
commit 5b98759b61

View File

@ -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();
}