mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
Attempt to fix #678 by changing RegisterProcessor to a task
This commit is contained in:
parent
e525e0c5db
commit
23c8c0769f
@ -8,6 +8,7 @@ import com.djrapitops.plan.system.processing.processors.info.PlayerPageUpdatePro
|
||||
import com.djrapitops.plan.system.processing.processors.player.*;
|
||||
import com.djrapitops.plugin.api.systems.NotificationCenter;
|
||||
import com.djrapitops.plugin.api.utility.log.Log;
|
||||
import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -96,7 +97,7 @@ public class PlayerOnlineListener implements Listener {
|
||||
|
||||
SessionCache.getInstance().cacheSession(uuid, new Session(uuid, time, world, gm));
|
||||
|
||||
Processing.submit(
|
||||
RunnableFactory.createNew("Player Register: " + uuid,
|
||||
new RegisterProcessor(uuid, player::getFirstPlayed, playerName,
|
||||
new IPUpdateProcessor(uuid, address, time),
|
||||
new NameProcessor(uuid, playerName, displayName),
|
||||
|
@ -8,6 +8,7 @@ import com.djrapitops.plan.system.processing.processors.info.PlayerPageUpdatePro
|
||||
import com.djrapitops.plan.system.processing.processors.player.*;
|
||||
import com.djrapitops.plugin.api.systems.NotificationCenter;
|
||||
import com.djrapitops.plugin.api.utility.log.Log;
|
||||
import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.data.key.Keys;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
@ -99,7 +100,7 @@ public class SpongePlayerListener {
|
||||
|
||||
SessionCache.getInstance().cacheSession(uuid, new Session(uuid, time, world, gm));
|
||||
|
||||
Processing.submit(
|
||||
RunnableFactory.createNew("Player Register: " + uuid,
|
||||
new RegisterProcessor(uuid, () -> time, playerName,
|
||||
new IPUpdateProcessor(uuid, address, time),
|
||||
new NameProcessor(uuid, playerName, displayName),
|
||||
|
@ -5,8 +5,8 @@
|
||||
package com.djrapitops.plan.system.processing.processors.player;
|
||||
|
||||
import com.djrapitops.plan.system.database.databases.Database;
|
||||
import com.djrapitops.plan.system.processing.CriticalRunnable;
|
||||
import com.djrapitops.plan.system.processing.Processing;
|
||||
import com.djrapitops.plugin.task.AbsRunnable;
|
||||
import com.djrapitops.plugin.utilities.Verify;
|
||||
|
||||
import java.util.UUID;
|
||||
@ -17,7 +17,7 @@ import java.util.function.Supplier;
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class RegisterProcessor implements CriticalRunnable {
|
||||
public class RegisterProcessor extends AbsRunnable {
|
||||
|
||||
private final UUID uuid;
|
||||
private final Supplier<Long> registered;
|
||||
@ -25,6 +25,7 @@ public class RegisterProcessor implements CriticalRunnable {
|
||||
private final Runnable[] afterProcess;
|
||||
|
||||
public RegisterProcessor(UUID uuid, Supplier<Long> registered, String name, Runnable... afterProcess) {
|
||||
super(RegisterProcessor.class.getSimpleName());
|
||||
this.uuid = uuid;
|
||||
this.registered = registered;
|
||||
this.name = name;
|
||||
@ -46,6 +47,7 @@ public class RegisterProcessor implements CriticalRunnable {
|
||||
for (Runnable runnable : afterProcess) {
|
||||
Processing.submit(runnable);
|
||||
}
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user