From cd3e7b5d431fd54eaedfdc090083ebfca15cd598 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Mon, 27 Jul 2015 15:08:40 +0200 Subject: [PATCH] First attempt to fix the email registation issue --- .../register/ProcessSyncronousEmailRegister.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/xephi/authme/process/register/ProcessSyncronousEmailRegister.java b/src/main/java/fr/xephi/authme/process/register/ProcessSyncronousEmailRegister.java index e7510eae0..c0c9e3fd0 100644 --- a/src/main/java/fr/xephi/authme/process/register/ProcessSyncronousEmailRegister.java +++ b/src/main/java/fr/xephi/authme/process/register/ProcessSyncronousEmailRegister.java @@ -2,6 +2,7 @@ package fr.xephi.authme.process.register; import org.bukkit.Bukkit; import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitTask; import fr.xephi.authme.AuthMe; @@ -34,11 +35,20 @@ public class ProcessSyncronousEmailRegister implements Runnable { m.send(player, "vb_nonActiv"); int time = Settings.getRegistrationTimeout * 20; int msgInterval = Settings.getWarnMessageInterval; + + BukkitScheduler sched = plugin.getServer().getScheduler(); + +// if (time != 0) { +// LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel(); +// BukkitTask id = Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time); +// LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id); +// } + if (time != 0) { - LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel(); - BukkitTask id = Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time); + BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time); LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id); } + LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel(); BukkitTask nwMsg = Bukkit.getScheduler().runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));