mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 10:45:23 +01:00
Fix merge from master
This commit is contained in:
parent
fae7286776
commit
811ceaf7ff
@ -3,7 +3,6 @@ package fr.xephi.authme.command.executable.captcha;
|
|||||||
import fr.xephi.authme.command.PlayerCommand;
|
import fr.xephi.authme.command.PlayerCommand;
|
||||||
import fr.xephi.authme.data.CaptchaManager;
|
import fr.xephi.authme.data.CaptchaManager;
|
||||||
import fr.xephi.authme.data.auth.PlayerCache;
|
import fr.xephi.authme.data.auth.PlayerCache;
|
||||||
import fr.xephi.authme.command.CommandService;
|
|
||||||
import fr.xephi.authme.command.PlayerCommand;
|
import fr.xephi.authme.command.PlayerCommand;
|
||||||
import fr.xephi.authme.data.limbo.LimboCache;
|
import fr.xephi.authme.data.limbo.LimboCache;
|
||||||
import fr.xephi.authme.message.MessageKey;
|
import fr.xephi.authme.message.MessageKey;
|
||||||
@ -43,8 +42,8 @@ public class CaptchaCommand extends PlayerCommand {
|
|||||||
private void checkCaptcha(Player player, String captchaCode) {
|
private void checkCaptcha(Player player, String captchaCode) {
|
||||||
final boolean isCorrectCode = captchaManager.checkCode(player.getName(), captchaCode);
|
final boolean isCorrectCode = captchaManager.checkCode(player.getName(), captchaCode);
|
||||||
if (isCorrectCode) {
|
if (isCorrectCode) {
|
||||||
commandService.send(player, MessageKey.CAPTCHA_SUCCESS);
|
commonService.send(player, MessageKey.CAPTCHA_SUCCESS);
|
||||||
commandService.send(player, MessageKey.LOGIN_MESSAGE);
|
commonService.send(player, MessageKey.LOGIN_MESSAGE);
|
||||||
limboCache.getPlayerData(player.getName()).getMessageTask().setMuted(false);
|
limboCache.getPlayerData(player.getName()).getMessageTask().setMuted(false);
|
||||||
} else {
|
} else {
|
||||||
String newCode = captchaManager.generateCode(player.getName());
|
String newCode = captchaManager.generateCode(player.getName());
|
||||||
|
@ -2,7 +2,7 @@ package fr.xephi.authme.command.executable.captcha;
|
|||||||
|
|
||||||
import fr.xephi.authme.data.CaptchaManager;
|
import fr.xephi.authme.data.CaptchaManager;
|
||||||
import fr.xephi.authme.data.auth.PlayerCache;
|
import fr.xephi.authme.data.auth.PlayerCache;
|
||||||
import fr.xephi.authme.command.CommandService;
|
import fr.xephi.authme.service.CommonService;
|
||||||
import fr.xephi.authme.data.limbo.LimboCache;
|
import fr.xephi.authme.data.limbo.LimboCache;
|
||||||
import fr.xephi.authme.data.limbo.LimboPlayer;
|
import fr.xephi.authme.data.limbo.LimboPlayer;
|
||||||
import fr.xephi.authme.message.MessageKey;
|
import fr.xephi.authme.message.MessageKey;
|
||||||
|
@ -20,6 +20,9 @@ import org.mockito.Mock;
|
|||||||
import org.mockito.junit.MockitoJUnitRunner;
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
|
|
||||||
import static fr.xephi.authme.service.BukkitService.TICKS_PER_SECOND;
|
import static fr.xephi.authme.service.BukkitService.TICKS_PER_SECOND;
|
||||||
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
|
import static org.mockito.ArgumentMatchers.anyLong;
|
||||||
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
@ -97,7 +100,7 @@ public class LimboPlayerTaskManagerTest {
|
|||||||
// given
|
// given
|
||||||
String name = "Tester1";
|
String name = "Tester1";
|
||||||
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
LimboPlayer limboPlayer = mock(LimboPlayer.class);
|
||||||
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
|
|
||||||
given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(0);
|
given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(0);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
|
Loading…
Reference in New Issue
Block a user