Fixed Processors not being called for Registered players.

This commit is contained in:
Rsl1122 2017-09-26 18:15:11 +03:00
parent 80bc5650bc
commit ee59c74bbb
3 changed files with 33 additions and 11 deletions

View File

@ -4,8 +4,7 @@ import com.djrapitops.plugin.utilities.player.Fetch;
import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.Session; import main.java.com.djrapitops.plan.data.Session;
import main.java.com.djrapitops.plan.systems.cache.DataCache; 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.info.NetworkPageUpdateProcessor;
import main.java.com.djrapitops.plan.systems.processing.Processor;
import main.java.com.djrapitops.plan.systems.processing.player.*; import main.java.com.djrapitops.plan.systems.processing.player.*;
import main.java.com.djrapitops.plan.utilities.MiscUtils; import main.java.com.djrapitops.plan.utilities.MiscUtils;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -96,17 +95,14 @@ public class PlanPlayerListener implements Listener {
cache.cacheSession(uuid, Session.start(time, world, gm)); cache.cacheSession(uuid, Session.start(time, world, gm));
IPUpdateProcessor ipUpdateProcessor = new IPUpdateProcessor(uuid, ip);
NameProcessor nameProcessor = new NameProcessor(uuid, playerName, displayName);
plugin.addToProcessQueue( plugin.addToProcessQueue(
new RegisterProcessor(uuid, player.getFirstPlayed(), time, playerName, playersOnline, new RegisterProcessor(uuid, player.getFirstPlayed(), time, playerName, playersOnline,
new IPUpdateProcessor(uuid, ip), ipUpdateProcessor,
new NameProcessor(uuid, playerName, displayName) nameProcessor
), ),
new Processor<InformationManager>(plugin.getInfoManager()) { new NetworkPageUpdateProcessor(plugin.getInfoManager())
@Override
public void process() {
object.updateNetworkPageContent();
}
}
); );
} }

View File

@ -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<InformationManager> {
public NetworkPageUpdateProcessor(InformationManager object) {
super(object);
}
@Override
public void process() {
object.updateNetworkPageContent();
}
}

View File

@ -57,7 +57,8 @@ public class RegisterProcessor extends PlayerProcessor {
db.getActionsTable().insertAction(uuid, new Action(time, Actions.FIRST_SESSION, "Online: " + playersOnline + " Players")); db.getActionsTable().insertAction(uuid, new Action(time, Actions.FIRST_SESSION, "Online: " + playersOnline + " Players"));
} catch (SQLException e) { } catch (SQLException e) {
Log.toLog(this.getClass().getName(), e); Log.toLog(this.getClass().getName(), e);
} finally {
plugin.addToProcessQueue(afterProcess);
} }
plugin.addToProcessQueue(afterProcess);
} }
} }