From 09d6f5c92377ed2af91c0697cef6dd07a091f8e1 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Tue, 12 Jul 2016 22:10:30 +0200 Subject: [PATCH] Close #816 --- .../authme/process/logout/AsynchronousLogout.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java index 34a5b493..c24d083b 100644 --- a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java @@ -1,5 +1,6 @@ package fr.xephi.authme.process.logout; +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; @@ -8,6 +9,7 @@ import fr.xephi.authme.output.MessageKey; import fr.xephi.authme.process.AsynchronousProcess; import fr.xephi.authme.process.ProcessService; import fr.xephi.authme.process.SyncProcessManager; +import fr.xephi.authme.settings.properties.PluginSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; import org.bukkit.entity.Player; @@ -27,6 +29,9 @@ public class AsynchronousLogout implements AsynchronousProcess { @Inject private LimboCache limboCache; + @Inject + private SessionManager sessionManager; + @Inject private SyncProcessManager syncProcessManager; @@ -47,6 +52,11 @@ public class AsynchronousLogout implements AsynchronousProcess { database.updateQuitLoc(auth); } + if (service.getProperty(PluginSettings.SESSIONS_ENABLED) && (sessionManager.hasSession(name) || database.isLogged(name))) { + sessionManager.cancelSession(name); + service.send(player, MessageKey.SESSION_EXPIRED); + } + limboCache.addPlayerData(player); playerCache.removePlayer(name); database.setUnlogged(name);