mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-01-15 20:22:07 +01:00
Second attempt to fix email registration
This commit is contained in:
parent
79e6574232
commit
90d8fc8548
@ -1,7 +1,7 @@
|
|||||||
package fr.xephi.authme.process.register;
|
package fr.xephi.authme.process.register;
|
||||||
|
|
||||||
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,15 +34,17 @@ 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) {
|
if (time != 0) {
|
||||||
LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel();
|
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).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 = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
|
||||||
|
|
||||||
player.saveData();
|
player.saveData();
|
||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||||
|
Loading…
Reference in New Issue
Block a user