Pre-process permissions and apply immediately on login events

This commit is contained in:
Luck
2016-10-04 14:57:00 +01:00
Unverified
parent 13bccd1d3f
commit 82789328c1
6 changed files with 83 additions and 16 deletions
@@ -41,12 +41,12 @@ abstract class FlatfileDatastore extends Datastore {
private final Logger actionLogger = Logger.getLogger("lp_actions");
private Map<String, String> uuidCache = new ConcurrentHashMap<>();
final File pluginDir;
private final File pluginDir;
private File uuidData;
private File actionLog;
File usersDir;
File groupsDir;
File tracksDir;
File uuidData;
File actionLog;
FlatfileDatastore(LuckPermsPlugin plugin, String name, File pluginDir) {
super(plugin, name);
@@ -70,7 +70,9 @@ public class AbstractListener {
final UuidCache cache = plugin.getUuidCache();
final User user = plugin.getUserManager().get(cache.getUUID(uuid));
plugin.getUserManager().unload(user);
if (user != null) {
plugin.getUserManager().unload(user);
}
// Unload the user from memory when they disconnect;
cache.clearCache(uuid);