diff --git a/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java b/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java index 1aaf6c003..37695516d 100644 --- a/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java +++ b/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java @@ -60,6 +60,10 @@ public class CacheDataSource implements DataSource { }); } + public LoadingCache> getCachedAuths() { + return cachedAuths; + } + @Override public synchronized boolean isAuthAvailable(String user) { return getAuth(user) != null; diff --git a/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java b/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java index adf08d064..7f716e7e6 100644 --- a/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java +++ b/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java @@ -5,6 +5,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.cache.limbo.LimboPlayer; +import fr.xephi.authme.datasource.CacheDataSource; import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.settings.Settings; import fr.xephi.authme.util.StringUtils; @@ -88,6 +89,10 @@ public class AsynchronousQuit { if (plugin.isEnabled()) { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, isOp, needToChange)); } + // remove player from cache + if (database instanceof CacheDataSource) { + ((CacheDataSource) database).getCachedAuths().invalidate(name); + } } private void postLogout() {