mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-26 00:31:50 +01:00
Remove player from cache on quit.
This commit is contained in:
parent
8bf6817a5f
commit
b4aebb685c
@ -60,6 +60,10 @@ public class CacheDataSource implements DataSource {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LoadingCache<String, Optional<PlayerAuth>> getCachedAuths() {
|
||||||
|
return cachedAuths;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean isAuthAvailable(String user) {
|
public synchronized boolean isAuthAvailable(String user) {
|
||||||
return getAuth(user) != null;
|
return getAuth(user) != null;
|
||||||
|
@ -5,6 +5,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
|
|||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||||
|
import fr.xephi.authme.datasource.CacheDataSource;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.util.StringUtils;
|
import fr.xephi.authme.util.StringUtils;
|
||||||
@ -88,6 +89,10 @@ public class AsynchronousQuit {
|
|||||||
if (plugin.isEnabled()) {
|
if (plugin.isEnabled()) {
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, isOp, needToChange));
|
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() {
|
private void postLogout() {
|
||||||
|
Loading…
Reference in New Issue
Block a user