From ee59c74bbbef527fa24ddd878dd11aac4316bba2 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 26 Sep 2017 18:15:11 +0300 Subject: [PATCH] Fixed Processors not being called for Registered players. --- .../systems/listeners/PlanPlayerListener.java | 16 +++++------- .../info/NetworkPageUpdateProcessor.java | 25 +++++++++++++++++++ .../processing/player/RegisterProcessor.java | 3 ++- 3 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 Plan/src/main/java/com/djrapitops/plan/systems/processing/info/NetworkPageUpdateProcessor.java diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/listeners/PlanPlayerListener.java b/Plan/src/main/java/com/djrapitops/plan/systems/listeners/PlanPlayerListener.java index 78ab89b55..56b0f7b4c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/listeners/PlanPlayerListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/listeners/PlanPlayerListener.java @@ -4,8 +4,7 @@ import com.djrapitops.plugin.utilities.player.Fetch; import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.data.Session; import main.java.com.djrapitops.plan.systems.cache.DataCache; -import main.java.com.djrapitops.plan.systems.info.InformationManager; -import main.java.com.djrapitops.plan.systems.processing.Processor; +import main.java.com.djrapitops.plan.systems.processing.info.NetworkPageUpdateProcessor; import main.java.com.djrapitops.plan.systems.processing.player.*; import main.java.com.djrapitops.plan.utilities.MiscUtils; import org.bukkit.entity.Player; @@ -96,17 +95,14 @@ public class PlanPlayerListener implements Listener { cache.cacheSession(uuid, Session.start(time, world, gm)); + IPUpdateProcessor ipUpdateProcessor = new IPUpdateProcessor(uuid, ip); + NameProcessor nameProcessor = new NameProcessor(uuid, playerName, displayName); plugin.addToProcessQueue( new RegisterProcessor(uuid, player.getFirstPlayed(), time, playerName, playersOnline, - new IPUpdateProcessor(uuid, ip), - new NameProcessor(uuid, playerName, displayName) + ipUpdateProcessor, + nameProcessor ), - new Processor(plugin.getInfoManager()) { - @Override - public void process() { - object.updateNetworkPageContent(); - } - } + new NetworkPageUpdateProcessor(plugin.getInfoManager()) ); } diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/processing/info/NetworkPageUpdateProcessor.java b/Plan/src/main/java/com/djrapitops/plan/systems/processing/info/NetworkPageUpdateProcessor.java new file mode 100644 index 000000000..76efe1d64 --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/systems/processing/info/NetworkPageUpdateProcessor.java @@ -0,0 +1,25 @@ +/* + * Licence is provided in the jar as license.yml also here: + * https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml + */ +package main.java.com.djrapitops.plan.systems.processing.info; + +import main.java.com.djrapitops.plan.systems.info.InformationManager; +import main.java.com.djrapitops.plan.systems.processing.Processor; + +/** + * //TODO Class Javadoc Comment + * + * @author Rsl1122 + */ +public class NetworkPageUpdateProcessor extends Processor { + + public NetworkPageUpdateProcessor(InformationManager object) { + super(object); + } + + @Override + public void process() { + object.updateNetworkPageContent(); + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java b/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java index 7744cb600..071d23fb4 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java @@ -57,7 +57,8 @@ public class RegisterProcessor extends PlayerProcessor { db.getActionsTable().insertAction(uuid, new Action(time, Actions.FIRST_SESSION, "Online: " + playersOnline + " Players")); } catch (SQLException e) { Log.toLog(this.getClass().getName(), e); + } finally { + plugin.addToProcessQueue(afterProcess); } - plugin.addToProcessQueue(afterProcess); } } \ No newline at end of file