First attempt to fix the email registation issue

This commit is contained in:
Gabriele C 2015-07-27 15:08:40 +02:00
parent ba70b17394
commit cd3e7b5d43

View File

@ -2,6 +2,7 @@ package fr.xephi.authme.process.register;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
@ -34,12 +35,21 @@ public class ProcessSyncronousEmailRegister implements Runnable {
m.send(player, "vb_nonActiv"); m.send(player, "vb_nonActiv");
int time = Settings.getRegistrationTimeout * 20; int time = Settings.getRegistrationTimeout * 20;
int msgInterval = Settings.getWarnMessageInterval; 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) { if (time != 0) {
LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel(); BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time);
BukkitTask id = Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time);
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id); LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
} }
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel(); LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
BukkitTask nwMsg = Bukkit.getScheduler().runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval)); BukkitTask nwMsg = Bukkit.getScheduler().runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg); LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);