Refactoring storage - WIP. Towards #32
This commit is contained in:
@@ -95,7 +95,7 @@ public class BungeeListener extends AbstractListener implements Listener {
|
||||
final PendingConnection c = e.getConnection();
|
||||
|
||||
if (!cache.isOnlineMode()) {
|
||||
UUID uuid = plugin.getDatastore().getUUID(c.getName());
|
||||
UUID uuid = plugin.getDatastore().getUUID(c.getName()).getOrDefault(null);
|
||||
if (uuid != null) {
|
||||
cache.addToCache(c.getUniqueId(), uuid);
|
||||
} else {
|
||||
@@ -105,7 +105,7 @@ public class BungeeListener extends AbstractListener implements Listener {
|
||||
plugin.getDatastore().saveUUIDData(c.getName(), c.getUniqueId());
|
||||
}
|
||||
} else {
|
||||
UUID uuid = plugin.getDatastore().getUUID(c.getName());
|
||||
UUID uuid = plugin.getDatastore().getUUID(c.getName()).getOrDefault(null);
|
||||
if (uuid == null) {
|
||||
plugin.getApiProvider().fireEventAsync(new UserFirstLoginEvent(c.getUniqueId(), c.getName()));
|
||||
}
|
||||
|
||||
@@ -268,4 +268,10 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin {
|
||||
public void doSync(Runnable r) {
|
||||
r.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAsyncRepeating(Runnable r, long interval) {
|
||||
long millis = interval * 50L; // convert from ticks to milliseconds
|
||||
getProxy().getScheduler().schedule(this, r, millis, millis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user