#1113 Handle LimboPlayer tasks via LimboService
- Add methods to LimboService for handling messages to make it the only relevant Limbo class for outside classes - Move LimboPlayerTaskManager to limbo package and make it package-private - Create MessageTask and TimeoutTask immediately when LimboPlayer is created - #1112 MessageTask: improve efficiency by keeping reference to Player
This commit is contained in:
@@ -3,9 +3,9 @@ package fr.xephi.authme.command.executable.captcha;
|
||||
import fr.xephi.authme.command.PlayerCommand;
|
||||
import fr.xephi.authme.data.CaptchaManager;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.data.limbo.LimboService;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.task.LimboPlayerTaskManager;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -23,7 +23,7 @@ public class CaptchaCommand extends PlayerCommand {
|
||||
private CommonService commonService;
|
||||
|
||||
@Inject
|
||||
private LimboPlayerTaskManager limboPlayerTaskManager;
|
||||
private LimboService limboService;
|
||||
|
||||
@Override
|
||||
public void runCommand(Player player, List<String> arguments) {
|
||||
@@ -43,7 +43,7 @@ public class CaptchaCommand extends PlayerCommand {
|
||||
if (isCorrectCode) {
|
||||
commonService.send(player, MessageKey.CAPTCHA_SUCCESS);
|
||||
commonService.send(player, MessageKey.LOGIN_MESSAGE);
|
||||
limboPlayerTaskManager.unmuteMessageTask(player);
|
||||
limboService.unmuteMessageTask(player);
|
||||
} else {
|
||||
String newCode = captchaManager.generateCode(player.getName());
|
||||
commonService.send(player, MessageKey.CAPTCHA_WRONG_ERROR, newCode);
|
||||
|
||||
Reference in New Issue
Block a user