From c0ea2d8ec3f4409729c358f5053cf7843b5af162 Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 29 Oct 2016 21:14:59 +0100 Subject: [PATCH] Fix data not being loaded sync when the plugin starts --- .../main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java | 6 +++--- .../main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java | 6 +++--- .../main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java index ee4951da..76f5d444 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java @@ -211,11 +211,11 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { if (mins > 0) { long ticks = mins * 60 * 20; getServer().getScheduler().runTaskTimerAsynchronously(this, () -> updateTaskBuffer.request(), 20L, ticks); - } else { - // Update online users - updateTaskBuffer.request(); } + // run an update instantly. + updateTaskBuffer.requestDirectly(); + // register tasks getServer().getScheduler().runTaskTimer(this, BukkitSenderFactory.get(this), 1L, 1L); getServer().getScheduler().runTaskTimerAsynchronously(this, new ExpireTemporaryTask(this), 60L, 60L); diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java index 2e9ceac8..eaae9c19 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java @@ -164,11 +164,11 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin { int mins = getConfiguration().getSyncTime(); if (mins > 0) { getProxy().getScheduler().schedule(this, new UpdateTask(this), mins, mins, TimeUnit.MINUTES); - } else { - // Update online users - updateTaskBuffer.request(); } + // run an update instantly. + updateTaskBuffer.requestDirectly(); + // register tasks getProxy().getScheduler().schedule(this, BungeeSenderFactory.get(this), 50L, 50L, TimeUnit.MILLISECONDS); // 20 times per second (once per "tick") getProxy().getScheduler().schedule(this, new ExpireTemporaryTask(this), 3L, 3L, TimeUnit.SECONDS); diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java index 58564c9d..651190d1 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java @@ -206,11 +206,11 @@ public class LPSpongePlugin implements LuckPermsPlugin { if (mins > 0) { scheduler.createTaskBuilder().async().interval(mins, TimeUnit.MINUTES).execute(new UpdateTask(this)) .submit(LPSpongePlugin.this); - } else { - // Update online users - updateTaskBuffer.request(); } + // run an update instantly. + updateTaskBuffer.requestDirectly(); + // register tasks scheduler.createTaskBuilder().intervalTicks(1L).execute(SpongeSenderFactory.get(this)).submit(this); scheduler.createTaskBuilder().async().intervalTicks(60L).execute(new ExpireTemporaryTask(this)).submit(this);