#762 - Move all sessions stuff to new SessionManager class

This commit is contained in:
Gnat008
2016-06-27 13:50:16 -04:00
parent 0c96a3113b
commit 1326606f37
7 changed files with 209 additions and 36 deletions
@@ -2,6 +2,7 @@ package fr.xephi.authme.process.join;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.SessionManager;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.cache.limbo.LimboCache;
@@ -55,6 +56,9 @@ public class AsynchronousJoin implements AsynchronousProcess {
@Inject
private LimboCache limboCache;
@Inject
private SessionManager sessionManager;
@Inject
private PluginHooks pluginHooks;
@@ -135,9 +139,8 @@ public class AsynchronousJoin implements AsynchronousProcess {
// Session logic
if (service.getProperty(PluginSettings.SESSIONS_ENABLED) && (playerCache.isAuthenticated(name) || database.isLogged(name))) {
if (plugin.getSessions().containsKey(name)) {
plugin.getSessions().get(name).cancel();
plugin.getSessions().remove(name);
if (sessionManager.hasSession(name)) {
sessionManager.cancelSession(name);
}
PlayerAuth auth = database.getAuth(name);
database.setUnlogged(name);