#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
@@ -5,6 +5,7 @@ import com.google.common.io.ByteStreams;
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.datasource.DataSource;
@@ -29,6 +30,9 @@ public class BungeeCordMessage implements PluginMessageListener {
@Inject
private PlayerCache playerCache;
@Inject
private SessionManager sessionManager;
@Inject
private AuthMe plugin;
@@ -61,9 +65,8 @@ public class BungeeCordMessage implements PluginMessageListener {
playerCache.updatePlayer(auth);
dataSource.setLogged(name);
//START 03062016 sgdc3: should fix #731 but we need to recode this mess
if (plugin.getSessions().containsKey(name)) {
plugin.getSessions().get(name).cancel();
plugin.getSessions().remove(name);
if (sessionManager.hasSession(name)) {
sessionManager.cancelSession(name);
}
//END