#1055 Remove multiple "please register" messages

Part 1:
- Use only one message entry for "Please register", that may have to be adapted to reflect the proper /register arguments
- Remove other message entries from code and from the messages files

Breaking change: reg_email_msg is also removed
This commit is contained in:
ljacqu 2017-01-07 09:01:03 +01:00
parent 044e3e3845
commit 385f7d6b1d
39 changed files with 13 additions and 295 deletions

View File

@ -59,7 +59,7 @@ public class RecoverEmailCommand extends PlayerCommand {
PlayerAuth auth = dataSource.getAuth(playerName); // TODO: Create method to get email only
if (auth == null) {
commonService.send(player, MessageKey.REGISTER_EMAIL_MESSAGE);
commonService.send(player, MessageKey.USAGE_REGISTER);
return;
}

View File

@ -64,18 +64,6 @@ public enum MessageKey {
/** Please, register to the server with the command "/register <password> <ConfirmPassword>" */
REGISTER_MESSAGE("reg_msg"),
/** Please, register to the server with the command "/register <password>" */
REGISTER_NO_REPEAT_MESSAGE("reg_no_repeat_msg"),
/** Please, register to the server with the command "/register <email> <confirmEmail>" */
REGISTER_EMAIL_MESSAGE("reg_email_msg"),
/** Please, register to the server with the command "/register <email>" */
REGISTER_EMAIL_NO_REPEAT_MESSAGE("reg_email_no_repeat_msg"),
/** Please, register to the server with the command "/register <password> <email>" */
REGISTER_PASSWORD_EMAIL_MESSAGE("reg_psw_email_msg"),
/** You have exceeded the maximum number of registrations (%reg_count/%max_acc %reg_names) for your connection! */
MAX_REGISTER_EXCEEDED("max_reg", "%max_acc", "%reg_count", "%reg_names"),

View File

@ -8,8 +8,6 @@ import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.AsynchronousProcess;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.util.Utils;
import org.bukkit.entity.Player;
import javax.inject.Inject;
@ -65,10 +63,7 @@ public class AsyncAddEmail implements AsynchronousProcess {
if (dataSource.isAuthAvailable(player.getName())) {
service.send(player, MessageKey.LOGIN_MESSAGE);
} else {
MessageKey registerMessage = Utils.getRegisterMessage(
service.getProperty(RegistrationSettings.REGISTRATION_TYPE),
service.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT));
service.send(player, registerMessage);
service.send(player, MessageKey.REGISTER_MESSAGE);
}
}

View File

@ -7,8 +7,6 @@ import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.AsynchronousProcess;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.util.Utils;
import org.bukkit.entity.Player;
import javax.inject.Inject;
@ -68,10 +66,7 @@ public class AsyncChangeEmail implements AsynchronousProcess {
if (dataSource.isAuthAvailable(player.getName())) {
service.send(player, MessageKey.LOGIN_MESSAGE);
} else {
MessageKey registerMessage = Utils.getRegisterMessage(
service.getProperty(RegistrationSettings.REGISTRATION_TYPE),
service.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT));
service.send(player, registerMessage);
service.send(player, MessageKey.REGISTER_MESSAGE);
}
}
}

View File

@ -1,67 +0,0 @@
package fr.xephi.authme.settings.properties;
import fr.xephi.authme.message.MessageKey;
/**
* Type of arguments used for the login command.
*/
public enum RegistrationArgumentType {
/** /register [password] */
PASSWORD(Execution.PASSWORD, 1, MessageKey.REGISTER_NO_REPEAT_MESSAGE),
/** /register [password] [password] */
PASSWORD_WITH_CONFIRMATION(Execution.PASSWORD, 2, MessageKey.REGISTER_MESSAGE),
/** /register [email] */
EMAIL(Execution.EMAIL, 1, MessageKey.REGISTER_EMAIL_NO_REPEAT_MESSAGE),
/** /register [email] [email] */
EMAIL_WITH_CONFIRMATION(Execution.EMAIL, 2, MessageKey.REGISTER_EMAIL_MESSAGE),
/** /register [password] [email] */
PASSWORD_WITH_EMAIL(Execution.PASSWORD, 1, MessageKey.REGISTER_PASSWORD_EMAIL_MESSAGE);
private final Execution execution;
private final int requiredNumberOfArgs;
private final MessageKey messageKey;
/**
* Constructor.
*
* @param execution the registration process
* @param requiredNumberOfArgs the required number of arguments
*/
RegistrationArgumentType(Execution execution, int requiredNumberOfArgs, MessageKey messageKey) {
this.execution = execution;
this.requiredNumberOfArgs = requiredNumberOfArgs;
this.messageKey = messageKey;
}
/**
* @return the registration execution that is used for this argument type
*/
public Execution getExecution() {
return execution;
}
public MessageKey getMessageKey(){
return messageKey;
}
/**
* @return number of arguments required to process the register command
*/
public int getRequiredNumberOfArgs() {
return requiredNumberOfArgs;
}
/**
* Registration execution (the type of registration).
*/
public enum Execution {
PASSWORD,
EMAIL
}
}

View File

@ -10,7 +10,6 @@ import fr.xephi.authme.service.BukkitService;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.settings.properties.RestrictionSettings;
import fr.xephi.authme.util.Utils;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
@ -96,9 +95,7 @@ public class LimboPlayerTaskManager {
if (isRegistered) {
return MessageKey.LOGIN_MESSAGE;
} else {
return Utils.getRegisterMessage(
settings.getProperty(RegistrationSettings.REGISTRATION_TYPE),
settings.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT));
return MessageKey.REGISTER_MESSAGE;
}
}

View File

@ -1,9 +1,6 @@
package fr.xephi.authme.util;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.register.RegisterSecondaryArgument;
import fr.xephi.authme.process.register.RegistrationType;
import java.util.regex.Pattern;
@ -62,30 +59,4 @@ public final class Utils {
return Runtime.getRuntime().availableProcessors();
}
/**
* Returns the proper message key for the given registration types.
*
* @param registrationType the registration type
* @param secondaryArgType secondary argument type for the register command
* @return the message key
*/
// TODO #1037: Remove this method
public static MessageKey getRegisterMessage(RegistrationType registrationType,
RegisterSecondaryArgument secondaryArgType) {
if (registrationType == RegistrationType.PASSWORD) {
if (secondaryArgType == RegisterSecondaryArgument.CONFIRMATION) {
return MessageKey.REGISTER_MESSAGE;
} else if (secondaryArgType == RegisterSecondaryArgument.NONE) {
return MessageKey.REGISTER_NO_REPEAT_MESSAGE;
} else { /* EMAIL_MANDATORY || EMAIL_OPTIONAL */
return MessageKey.REGISTER_PASSWORD_EMAIL_MESSAGE;
}
} else { /* registrationType == EMAIL */
if (secondaryArgType == RegisterSecondaryArgument.NONE) {
return MessageKey.REGISTER_EMAIL_NO_REPEAT_MESSAGE;
} else { /* CONFIRMATION || EMAIL_MANDATORY || EMAIL_OPTIONAL */
return MessageKey.REGISTER_EMAIL_MESSAGE;
}
}
}
}

View File

@ -17,10 +17,6 @@ no_perm: '&cНямаш Достъп!'
error: '&fПолучи се грешка; Моля свържете се с админ'
login_msg: '&cМоля влез с "/login парола"'
reg_msg: '&cМоля регистрирай се с "/register <парола> <парола>"'
reg_no_repeat_msg: '&cМоля регистрирай се с "/register <парола>"'
reg_email_msg: '&cМоля регистрирай се с "/register <имейл> <имейл>"'
reg_email_no_repeat_msg: '&cМоля регистрирай се с "/register <имейл>"'
reg_psw_email_msg: '&cМоля регистрирай се с "/register <парола> <имейл>"'
usage_unreg: '&cКоманда: /unregister парола'
pwd_changed: '&cПаролата е променена!'
user_unknown: '&cПотребителя не е регистриран'

View File

@ -23,7 +23,6 @@ no_perm: '&4Você não tem permissão para executar esta ação!'
error: '&4Ocorreu um erro inesperado, por favor contacte um administrador!'
login_msg: '&cPor favor, faça o login com o comando "/login <senha>"'
reg_msg: '&3Por favor, registre-se com o comando "/register <senha> <senha>"'
reg_email_msg: '&3Por favor, registre-se com o comando "/register <email> <email>"'
usage_unreg: '&cUse: /unregister <senha>'
pwd_changed: '&2Senha alterada com sucesso!'
user_unknown: '&cEste usuário não está registrado!'
@ -77,7 +76,4 @@ kicked_admin_registered: 'Um administrador registrou você, por favor faça logi
incomplete_email_settings: 'Erro: Nem todas as configurações necessárias estão definidas para o envio de e-mails. Entre em contato com um administrador.'
recovery_code_sent: 'Um código de recuperação para redefinir sua senha foi enviada para o seu e-mail.'
recovery_code_incorrect: 'O código de recuperação esta incorreto! Use /email recovery [email] para gerar um novo!'
reg_no_repeat_msg: '&3Por favor, registre-se usando "/register <senha>"'
reg_email_no_repeat_msg: '&3Por favor, registre-se usando "/register <email>"'
reg_psw_email_msg: '&3Por favor, registre-se usando "/register <senha> <email>"'
email_send_failure: '&cO e-mail não pôde ser enviado, reporte isso a um administrador!'

View File

@ -20,10 +20,6 @@ no_perm: '&cNa tento příkaz nemáš dostatečné pravomoce.'
error: '&cVyskytla se chyba - kontaktujte prosím administrátora ...'
login_msg: '&cProsím přihlaš se pomocí "/login TvojeHeslo".'
reg_msg: '&cProsím zaregistruj se pomocí "/register <heslo> <ZnovuHeslo>"'
reg_no_repeat_msg: '&cProsím zaregistruj se pomocí "/register <heslo>"'
reg_email_msg: '&cProsím zaregistruj se pomocí "/register <email> <potvrzení_emailu>"'
reg_email_no_repeat_msg: '&cProsím zaregistruj se pomocí "/register <email>"'
reg_psw_email_msg: '&cProsím zaregistruj se pomocí "/register <heslo> <email>"'
usage_unreg: '&cPoužij: "/unregister TvojeHeslo".'
pwd_changed: '&cHeslo změněno!'
user_unknown: '&cUživatelské jméno není zaregistrováno.'
@ -77,4 +73,4 @@ kicked_admin_registered: 'Admin vás právě zaregistroval; Přihlašte se pros
incomplete_email_settings: 'Chyba: chybí některé důležité informace pro odeslání emailu. Kontaktujte prosím admina.'
email_send_failure: 'Email nemohl být odeslán. Kontaktujte prosím admina.'
recovery_code_sent: 'Kód pro obnovení hesla byl odeslán na váš email.'
recovery_code_incorrect: 'Kód pro není správný! Použijte příkaz /email recovery [email] pro vygenerování nového.'
recovery_code_incorrect: 'Kód pro není správný! Použijte příkaz /email recovery [email] pro vygenerování nového.'

View File

@ -16,10 +16,6 @@ no_perm: '&4Du hast keine Rechte, um diese Aktion auszuführen!'
error: '&4Ein Fehler ist aufgetreten. Bitte kontaktiere einen Administrator.'
login_msg: '&cBitte logge dich ein mit "/login <passwort>"'
reg_msg: '&3Bitte registriere dich mit "/register <passwort> <passwortBestätigen>"'
reg_email_msg: '&3Bitte registriere dich mit "/register <email> <emailBestätigen>"'
reg_no_repeat_msg: '&3Bitte registriere dich mit "/register <passwort>"'
reg_email_no_repeat_msg: '&3Bitte registriere dich mit "/register <email>"'
reg_psw_email_msg: '&3Bitte registriere dich mit "/register <passwort> <email>"'
usage_unreg: '&cBenutze: /unregister <passwort>'
pwd_changed: '&2Passwort geändert!'
user_unknown: '&cBenutzername nicht registriert!'

View File

@ -20,10 +20,6 @@ no_perm: '&4You don''t have the permission to perform this action!'
error: '&4An unexpected error occurred, please contact an administrator!'
login_msg: '&cPlease, login with the command "/login <password>"'
reg_msg: '&3Please, register to the server with the command "/register <password> <ConfirmPassword>"'
reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
reg_email_msg: '&3Please, register to the server with the command "/register <email> <confirmEmail>"'
reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
usage_unreg: '&cUsage: /unregister <password>'
pwd_changed: '&2Password changed successfully!'
user_unknown: '&cThis user isn''t registered!'

View File

@ -18,10 +18,6 @@ no_perm: '&cNo tienes permiso'
error: '&fHa ocurrido un error. Por favor contacta al administrador.'
login_msg: '&cInicia sesión con "/login contraseña"'
reg_msg: '&cPor favor, regístrate con "/register <contraseña> <confirmarContraseña">'
reg_no_repeat_msg: '&cPor favor, regístrate con "/register <contraseña>"'
reg_email_msg: '&cPor favor, regístrate con "/register <email> <confirmarEmail>"'
reg_email_no_repeat_msg: '&cPor favor, regístrate con "/register <email>"'
reg_psw_email_msg: '&cPor favor, regístrate con "/register <contraseña> <email>"'
usage_unreg: '&cUso: /unregister contraseña'
pwd_changed: '&c¡Contraseña cambiada!'
user_unknown: '&cUsuario no registrado'

View File

@ -17,7 +17,6 @@ no_perm: '&cBaimenik ez'
error: '&fErrorea; Mesedez jarri kontaktuan administratzaile batekin'
login_msg: '&cMesedez erabili "/login pasahitza" saioa hasteko'
reg_msg: '&cMesedez erabili "/register pasahitza pasahitza" erregistratzeko'
reg_email_msg: '&cMesdez erabili "/register <email> <confirmEmail>" erregistratzeko'
usage_unreg: '&cErabili: /unregister password'
pwd_changed: '&cPasahitza aldatu duzu!'
user_unknown: '&cErabiltzailea ez dago erregistratuta'
@ -52,9 +51,6 @@ country_banned: '[AuthMe] Zure herrialdea blokeatuta dago zerbitzari honetan'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_nick: '&cYou can''t use your name as password, please choose another one...'
# TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'

View File

@ -17,10 +17,6 @@ no_perm: '&cEi oikeuksia'
error: '&fVirhe: Ota yhteys palveluntarjoojaan!'
login_msg: '&cKirjaudu palvelimmelle komennolla "/login salasana"'
reg_msg: '&cRekisteröidy palvelimellemme komennolla "/register <salasana> <salasana>"'
reg_no_repeat_msg: '&cRekisteröidy palvelimellemme komennolla "/register <salasana>"'
reg_email_msg: '&cRekisteröi sähköpostisi komennolla "/register <sposti> <spostiUudelleen>"'
reg_email_no_repeat_msg: '&cRekisteröi sähköpostisi komennolla "/register <sposti>"'
reg_psw_email_msg: '&cRekisteröi sähköpostisi komennolla "/register <salasana> <sposti>"'
usage_unreg: '&cKäyttötapa: /unregister password'
pwd_changed: '&cSalasana vaihdettu!!'
user_unknown: '&cSalasanat eivät täsmää'

View File

@ -21,10 +21,6 @@ password_error_chars: '&4Ton mot de passe contient des caractères non autorisé
error: '&fUne erreur est apparue, veuillez contacter un administrateur.'
login_msg: '&cPour vous connecter, utilisez: /login motdepasse'
reg_msg: '&cPour vous inscrire, utilisez "/register <motdepasse> <confirmermotdepasse>"'
reg_no_repeat_msg: '&cPour vous inscrire, utilisez "/register <motdepasse>"'
reg_email_no_repeat_msg: '&cPour vous inscrire, utilisez "/register <email>"'
reg_psw_email_msg: '&cPour vous inscrire, utilisez "/register <motdepasse> <email>"'
reg_email_msg: '&cPour vous inscrire, utilisez "/register <email> <confirmEmail>"'
usage_unreg: '&cPour supprimer ce compte, utilisez: /unregister <motdepasse>'
pwd_changed: '&aMot de passe changé avec succès !'
user_unknown: '&cCe compte n''est pas enregistré.'

View File

@ -18,10 +18,6 @@ no_perm: '&cNon tes o permiso'
error: '&fOcurriu un erro; contacta cun administrador'
login_msg: '&cPor favor, identifícate con "/login <password>"'
reg_msg: '&cPor favor, rexístrate con "/register <contrasinal> <confirmarContrasinal>"'
reg_no_repeat_msg: '&cPor favor, rexístrate con "/register <contrasinal>"'
reg_email_msg: '&cPor favor, rexístrate con "/register <email> <confirmarEmail>"'
reg_email_no_repeat_msg: '&cPor favor, rexístrate con "/register <email>"'
reg_psw_email_msg: '&cPor favor, rexístrate con "/register <contrasinal> <email>"'
usage_unreg: '&cUso: /unregister <contrasinal>'
pwd_changed: '&cCambiouse o contrasinal!'
user_unknown: '&cEse nome de usuario non está rexistrado'

View File

@ -25,7 +25,6 @@ login: '&aSikeresen beléptél!'
wrong_pwd: '&4Hibás jelszó!'
user_unknown: '&cEz a felhasználó nincs regisztrálva!'
reg_msg: '&cKérlek Regisztrálj: "/register <jelszó> <jelszó ismét>"'
reg_email_msg: '&cKérlek regisztrálj: "/register <email> <email ismét>"'
unsafe_spawn: 'A kilépési helyzeted nem biztonságos, ezért elteleportálunk a kezdő pozícióra.'
max_reg: '&cElérted a maximálisan beregisztrálható karakterek számát. (%reg_count/%max_acc %reg_names)!'
password_error: 'A két jelszó nem egyezik!'
@ -74,7 +73,4 @@ recovery_code_incorrect: 'A visszaállító kód helytelen volt! Használd a kö
recovery_code_sent: 'A jelszavad visszaállításához szükséges kódot sikeresen kiküldtük az email címedre!'
email_show: '&2A jelenlegi email-ed a következő: &f%email'
show_no_email: '&2Ehhez a felhasználóhoz jelenleg még nincs email hozzárendelve.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO email_send_failure: 'The email could not be sent. Please contact an administrator.'

View File

@ -16,7 +16,6 @@ no_perm: '&4Kamu tidak mempunyai izin melakukan ini!'
error: '&4Terjadi kesalahan tak dikenal, silahkan hubungi Administrator!'
login_msg: '&cSilahkan login menggunakan command "/login <password>"'
reg_msg: '&3Silahkan mendaftar ke server menggunakan command "/register <password> <ulangiPassword>"'
reg_email_msg: '&3Silahkan mendaftar ke server menggunakan command "/register <email> <ulangiEmail>"'
pwd_changed: '&2Berhasil mengubah password!'
user_unknown: '&cUser ini belum terdaftar!'
password_error: '&cPassword tidak cocok, silahkan periksa dan ulangi kembali!'
@ -58,9 +57,6 @@ antibot_auto_disabled: '&2[AntiBotService] AntiBot dimatikan setelah %m menit!'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO usage_reg: '&cUsage: /register <password> <ConfirmPassword>'
# TODO usage_unreg: '&cUsage: /unregister <password>'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'

View File

@ -21,10 +21,6 @@ no_perm: '&4Non hai il permesso di eseguire questa operazione.'
error: '&4Qualcosa è andato storto, riporta questo errore ad un amministratore!'
login_msg: '&cPer favore, esegui l''autenticazione con il comando: "/login <password>"'
reg_msg: '&3Per favore, esegui la registrazione con il comando: "/register <password> <confermaPassword>"'
reg_no_repeat_msg: '&3Per favore, esegui la registrazione con il comando: "/register <password>"'
reg_email_msg: '&3Per favore, esegui la registrazione con il comando: "/register <email> <confermaEmail>"'
reg_email_no_repeat_msg: '&3Per favore, esegui la registrazione con il comando: "/register <email>"'
reg_psw_email_msg: '&3Per favore, esegui la registrazione con il comando: "/register <password> <email>"'
usage_unreg: '&cUtilizzo: /unregister <password>'
pwd_changed: '&2Password cambiata correttamente!'
user_unknown: '&cL''utente non ha ancora eseguito la registrazione.'

View File

@ -20,7 +20,6 @@ no_perm: '&c권한이 없습니다'
error: '&f오류가 발생했습니다; 관리자에게 문의해주세요'
login_msg: '&c접속 하실려면 "/login 비밀번호"를 치세요'
reg_msg: '&c가입하실려면 "/register 비밀번호 비밀번호재입력"을 치세요'
reg_email_msg: '&c가입하실려면 "/register <이메일> <이메일재입력>을 치세요"'
usage_unreg: '&c사용법: /unregister 비밀번호'
pwd_changed: '&c비밀번호를 변경했습니다!'
user_unknown: '&c사용자이름은 가입되지 않았습니다'
@ -62,9 +61,6 @@ antibot_auto_disabled: '[AuthMe] 봇차단모드가 %m 분 후에 자동적으
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_nick: '&cYou can''t use your name as password, please choose another one...'
# TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'

View File

@ -44,10 +44,6 @@ kick_fullserver: '&cServeris yra pilnas, Atsiprasome.'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_msg: '&3Please, register to the server with the command "/register <email> <confirmEmail>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_nick: '&cYou can''t use your name as password, please choose another one...'
# TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'

View File

@ -19,10 +19,6 @@ no_perm: '&cGeen toegang!'
error: 'Error: neem contact op met een administrator!'
login_msg: '&cLog in met "/login <wachtwoord>"'
reg_msg: '&cRegistreer met "/register <wachtwoord> <herhaalWachtwoord>"'
reg_no_repeat_msg: '&3Registreer met "/register <wachtwoord>"'
reg_email_msg: '&3Registreer met "/register <E-mail> <herhaalE-mail>"'
reg_email_no_repeat_msg: '&3Registreer met "/register <E-mail>"'
reg_psw_email_msg: '&3Registreer met "/register <wachtwoord> <E-mail>"'
usage_unreg: '&cGebruik: /unregister password'
pwd_changed: '&cWachtwoord aangepast!'
user_unknown: '&cGebruikersnaam niet geregistreerd'

View File

@ -10,10 +10,6 @@ reg_only: '&fTylko zarejestrowani uzytkownicy maja do tego dostep!'
valid_session: '&cSesja logowania'
login_msg: '&2Prosze sie zalogowac przy uzyciu &6/login <haslo>'
reg_msg: '&2Prosze sie zarejestrowac przy uzyciu &6/register <haslo> <powtorzHaslo>'
reg_no_repeat_msg: '&2Prosze sie zarejestrowac przy uzyciu &6/register <haslo>'
reg_email_msg: '&cStworz prosze konto komenda "/register <email> <powtorzEmail>"'
reg_email_no_repeat_msg: '&cStworz prosze konto komenda "/register <email>"'
reg_psw_email_msg: '&cStworz prosze konto komenda "/register <haslo> <email>"'
timeout: '&fUplynal limit czasu zalogowania'
wrong_pwd: '&cNiepoprawne haslo'
logout: '&cPomyslnie wylogowany'

View File

@ -17,7 +17,6 @@ no_perm: '&cSem Permissões'
error: '&fOcorreu um erro; Por favor contacte um admin'
login_msg: '&cIdentifique-se com "/login password"'
reg_msg: '&cPor favor registe-se com "/register password confirmePassword"'
reg_email_msg: '&ePor favor registe-se com "/register <email> <confirmarEmail>"'
usage_unreg: '&cUse: /unregister password'
pwd_changed: '&cPassword alterada!'
user_unknown: '&cUsername não registado'
@ -44,7 +43,6 @@ kick_fullserver: '&cO servidor está actualmente cheio, lamentamos!'
usage_email_add: '&fUse: /email add <email> <confirmeEmail> '
usage_email_change: '&fUse: /email change <emailAntigo> <emailNovo> '
usage_email_recovery: '&fUse: /email recovery <email>'
email_add: '/email add <email> <confirmeEmail>'
new_email_invalid: 'Novo email inválido!'
old_email_invalid: 'Email antigo inválido!'
email_invalid: 'Email inválido!'
@ -67,9 +65,6 @@ password_error_unsafe: '&cA senha escolhida não é segura, por favor, escolha o
kick_antibot: 'Modo de protecção anti-Bot está habilitado! Tem que espere alguns minutos antes de entrar no servidor.'
email_exists: '&cUm e-mail de recuperação já foi enviado! Pode descartá-lo e enviar um novo usando o comando abaixo:'
invalid_name_case: 'Deve se juntar usando nome de usuário %valid, não %invalid.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'
# TODO tempban_max_logins: '&cYou have been temporarily banned for failing to log in too many times.'

View File

@ -15,7 +15,6 @@ no_perm: '&4Nu ai permisiunea!'
error: '&4A aparut o eroare, te rugam contacteaza un membru din staff!'
login_msg: '&cTe rugam sa te autentifici folosind comanda "/login <parola>"'
reg_msg: '&3Te rugam sa te inregistrezi folosind comanda "/register <parola> <parola>"'
reg_email_msg: '&3Te rugam sa te inregistrezi folosind comanda "/register <email> <email>"'
max_reg: '&cTe-ai inregistrat cu prea multe counturi (%reg_count/%max_acc %reg_names) pentru conexiunea ta!'
usage_reg: '&cFoloseste comanda: /register <parola> <parola>'
usage_unreg: '&cFoloseste comanda: /unregister <parola>'
@ -74,7 +73,4 @@ kicked_admin_registered: 'Un administrator tocmai te-a inregistrat, te rog auten
incomplete_email_settings: 'Eroare: nu toate setarile necesare pentru trimiterea email-ului sunt facute! Te rugam contacteaza un administrator.'
recovery_code_sent: 'Un cod de recuperare a parolei a fost trimis catre email-ul tau.'
recovery_code_incorrect: 'Codul de recuperare nu este corect! Foloseste /email recovery [email] pentru a genera unul nou.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO email_send_failure: 'The email could not be sent. Please contact an administrator.'

View File

@ -20,7 +20,6 @@ reg_msg: '&a&lРегистрация: &e&l/reg ПАРОЛЬ ПОВТОРАР
password_error_nick: '&c&lВы не можете использовать ваш ник в роли пароля'
password_error_unsafe: '&c&lВы не можете использовать небезопасный пароль'
regex: '&c&lВаш пароль содержит запрещенные символы. Разрешенные символы: REG_EX'
reg_email_msg: '&c&lРегистрация: &e&l/reg EMAIL ПОВТОР_EMAIL'
usage_unreg: '&c&lИспользование: &e&l/unregister ПАРОЛЬ'
pwd_changed: '&2Пароль изменен!'
user_unknown: '&c&lТакой игрок не зарегистрирован'
@ -76,7 +75,4 @@ email_show: '&2Ваш текущий адрес электронной почт
show_no_email: '&2В данный момент к вашему аккаунте не привязана электронная почта.'
recovery_code_sent: 'Код восстановления для сброса пароля был отправлен на вашу электронную почту.'
recovery_code_incorrect: 'Код восстановления неверный! Введите /email recovery [email], чтобы отправить новый код'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO email_send_failure: 'The email could not be sent. Please contact an administrator.'

View File

@ -13,7 +13,6 @@ reg_only: '&fVstup iba pre registrovanych! Navstiv http://example.com pre regist
valid_session: '&cZapamätané prihlásenie'
login_msg: '&cPrihlás sa príkazom "/login heslo"'
reg_msg: '&cZaregistruj sa príkazom "/register heslo zopakujHeslo"'
reg_email_msg: '&cPlease register with "/register <email> <confirmEmail>"'
timeout: '&fVyprsal cas na prihlásenie'
wrong_pwd: '&cZadal si zlé heslo'
logout: '&cBol si úspesne odhláseny'
@ -43,9 +42,6 @@ recovery_email: '&cZabudol si heslo? Pouzi príkaz /email recovery <tvojEmail>'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_nick: '&cYou can''t use your name as password, please choose another one...'
# TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'

View File

@ -17,7 +17,6 @@ no_perm: '&4Bunu yapmak icin iznin yok!'
error: '&4Beklenmedik bir hata olustu, yetkili ile iletisime gecin!'
login_msg: '&cLutfen giris komutunu kullanin "/login <sifre>"'
reg_msg: '&3Lutfen kayit komutunu kullanin "/register <sifre> <TekrarSifre>"'
reg_email_msg: '&3Lutfen kayit komutunu kullanin "/register <eposta> <tekrarEposta>"'
usage_unreg: '&cKullanim: /unregister <sifre>'
pwd_changed: '&2Sifre basariyla degistirildi!'
user_unknown: '&cBu oyuncu kayitli degil!'
@ -64,9 +63,6 @@ invalid_name_case: 'Oyuna %valid isminde katilmalisin. %invalid ismini kullanara
# TODO denied_command: '&cIn order to use this command you must be authenticated!'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'

View File

@ -20,7 +20,6 @@ no_perm: '&4У вас недостатньо прав, щоб застосува
error: '&4[AuthMe] Error. Будь ласка, повідомте адміністратора!'
login_msg: '&cДля авторизації, введіть команду "/login <пароль>"'
reg_msg: '&3Перш ніж почати гру, вам потрібно зареєструвати свій нікнейм!%nl%&3Для цього просто введіть команду "/register <пароль> <повторПароля>"'
reg_email_msg: 'Перш ніж почати гру, вам потрібно зареєструвати свій нікнейм, використавши свою діючу електронну пошту!%nl%&3Для цього просто введіть команду "/register <e-mail> <e-mail повторно>"'
usage_unreg: '&cСинтаксис: /unregister <пароль>'
pwd_changed: '&2Пароль успішно змінено!'
user_unknown: '&cЦей гравець не є зареєстрованим.'
@ -70,9 +69,6 @@ accounts_owned_self: 'Кількість ваших твінк‒акаунті
accounts_owned_other: 'Кількість твінк‒акаунтів гравця %name: %count'
kicked_admin_registered: 'Адміністратор вас зареєстрував; Будь ласка, авторизуйтесь знову!'
incomplete_email_settings: '&4[AuthMe] Error: Не всі необхідні налаштування є встановленими, щоб надсилати електронну пошту. Будь ласка, повідомте адміністратора!'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'
# TODO email_send_failure: 'The email could not be sent. Please contact an administrator.'

View File

@ -17,7 +17,6 @@ no_perm: '&4Bạn không có quyền truy cập lệnh này!'
error: '&4Lỗi! Vui lòng liên hệ quản trị viên hoặc admin'
login_msg: '&cXin vui lòng đăng nhập bằng lệnh "/login <mật khẩu>"'
reg_msg: '&2Xin vui lòng đăng ký tài khoản với lệnh "/register <mật khẩu> <nhập lại mật khẩu>"'
reg_email_msg: '&2Sử dụng email để đăng ký tham gia máy chủ với lệnh "/register <email> <nhập lại email>"'
usage_unreg: '&cSử dụng: /unregister <mật khẩu>'
pwd_changed: '&2Thay đổi mật khẩu thành công!'
user_unknown: '&cNgười dùng này đã được đăng ký!'
@ -65,9 +64,6 @@ invalid_name_case: 'Bạn nên vào máy chủ với tên đăng nhập là %val
# TODO denied_command: '&cIn order to use this command you must be authenticated!'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'

View File

@ -21,7 +21,6 @@ no_perm: '&8[&6玩家系统&8] &c没有权限'
error: '&8[&6玩家系统&8] &f发现错误请联系管理员'
login_msg: '&8[&6玩家系统&8] &c请输入“/login <密码>”以登录'
reg_msg: '&8[&6玩家系统&8] &c请输入“/register <密码> <再输入一次以确定密码>”以注册'
reg_email_msg: '&8[&6玩家系统&8] &c请输入 "/register <邮箱> <确认电子邮件>"'
usage_unreg: '&8[&6玩家系统&8] &c正确用法“/unregister <密码>”'
pwd_changed: '&8[&6玩家系统&8] &c密码已成功修改'
user_unknown: '&8[&6玩家系统&8] &c此用户名还未注册过'
@ -68,9 +67,6 @@ invalid_name_case: '&8[&6玩家系统&8] &c你应该使用「%valid」而并非
# TODO denied_command: '&cIn order to use this command you must be authenticated!'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'

View File

@ -21,7 +21,6 @@ no_perm: '&8[&6用戶系統&8] &b嗯你想幹甚麼'
error: '&8[&6用戶系統&8] &f發生錯誤請與管理員聯絡。'
login_msg: '&8[&6用戶系統&8] &c請使用這個指令來登入 《 /login <密碼> 》'
reg_msg: '&8[&6用戶系統&8] &c請使用這個指令來註冊 《 /register <密碼> <重覆密碼> 》'
reg_email_msg: '&8[&6用戶系統&8] &c請使用這個指令來註冊 《 /register <電郵> <重覆電郵> 》'
usage_unreg: '&8[&6用戶系統&8] &f用法 《 /unregister <密碼> 》'
pwd_changed: '&8[&6用戶系統&8] &c你成功更換了你的密碼 '
user_unknown: '&8[&6用戶系統&8] &c此用戶名沒有已登記資料。'
@ -68,9 +67,6 @@ invalid_name_case: '&8[&6用戶系統&8] &4警告&c你應該使用「%valid
# TODO denied_command: '&cIn order to use this command you must be authenticated!'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'

View File

@ -20,7 +20,6 @@ no_perm: '&4您沒有執行此操作的權限!'
error: '&4發生錯誤!請聯繫伺服器管理員!'
login_msg: '&c [請先登入] 請按T , 然後輸入 "/login [你的密碼]" 。'
reg_msg: '&3[請先注冊] 請按T , 然後輸入 "/register [你的密碼] [重覆確認你的密碼]" 來注冊。'
reg_email_msg: '&3[請先注冊] 請按T , 然後輸入 /register [你的電郵地址] [重覆確認你的電郵地址] 來注冊。'
usage_unreg: '&c使用方法: "/unregister <你的密碼>"'
pwd_changed: '&2密碼已更變!'
user_unknown: '&c此用戶尚未注冊!'
@ -72,3 +71,6 @@ kicked_admin_registered: '管理員剛剛註冊了您; 請重新登錄。'
incomplete_email_settings: '缺少必要的配置來為發送電子郵件。請聯繫管理員。'
recovery_code_sent: '已將重設密碼的恢復代碼發送到您的電子郵件。'
recovery_code_incorrect: '恢復代碼錯誤!使用指令: "/email recovery [電郵地址]" 生成新的一個恢復代碼。'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'
# TODO email_send_failure: 'The email could not be sent. Please contact an administrator.'

View File

@ -21,7 +21,6 @@ no_perm: '&b【AuthMe】&6你沒有使用該指令的權限。'
error: '&b【AuthMe】&6發生錯誤請聯繫管理員'
login_msg: '&b【AuthMe】&6請使用 &c"/login <密碼>" &6來登入。'
reg_msg: '&b【AuthMe】&6請使用 "&c/register <密碼> <確認密碼>" 來註冊。'
reg_email_msg: '&b【AuthMe】&6請使用 &c"/register <email> <重複Email>" 來註冊'
usage_unreg: '&b【AuthMe】&6用法: &c"/unregister <密碼>"'
pwd_changed: '&b【AuthMe】&6密碼變更成功!'
user_unknown: '&b【AuthMe】&6這個帳號還沒有註冊過'
@ -68,9 +67,6 @@ invalid_name_case: '&b【AuthMe】&4警告&c你應該使用「%valid」而並
# TODO denied_command: '&cIn order to use this command you must be authenticated!'
# TODO same_ip_online: 'A player with the same IP is already in game!'
# TODO denied_chat: '&cIn order to chat you must be authenticated!'
# TODO reg_no_repeat_msg: '&3Please, register to the server with the command "/register <password>"'
# TODO reg_email_no_repeat_msg: '&3Please, register to the server with the command "/register <email>"'
# TODO reg_psw_email_msg: '&3Please, register to the server with the command "/register <password> <email>"'
# TODO password_error_chars: '&4Your password contains illegal characters. Allowed chars: REG_EX'
# TODO email_show: '&2Your current email address is: &f%email'
# TODO show_no_email: '&2You currently don''t have email address associated with this account.'

View File

@ -118,7 +118,7 @@ public class RecoverEmailCommandTest {
verify(sendMailSsl).hasAllInformation();
verify(dataSource).getAuth(name);
verifyNoMoreInteractions(dataSource);
verify(commandService).send(sender, MessageKey.REGISTER_EMAIL_MESSAGE);
verify(commandService).send(sender, MessageKey.USAGE_REGISTER);
}
@Test

View File

@ -5,11 +5,8 @@ import fr.xephi.authme.data.auth.PlayerAuth;
import fr.xephi.authme.data.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.register.RegisterSecondaryArgument;
import fr.xephi.authme.process.register.RegistrationType;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.settings.properties.RegistrationSettings;
import org.bukkit.entity.Player;
import org.junit.BeforeClass;
import org.junit.Test;
@ -169,30 +166,11 @@ public class AsyncAddEmailTest {
}
@Test
public void shouldShowEmailRegisterMessage() {
public void shouldShowRegisterMessage() {
// given
given(player.getName()).willReturn("user");
given(playerCache.isAuthenticated("user")).willReturn(false);
given(dataSource.isAuthAvailable("user")).willReturn(false);
given(service.getProperty(RegistrationSettings.REGISTRATION_TYPE)).willReturn(RegistrationType.EMAIL);
given(service.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT)).willReturn(RegisterSecondaryArgument.NONE);
// when
asyncAddEmail.addEmail(player, "test@mail.com");
// then
verify(service).send(player, MessageKey.REGISTER_EMAIL_NO_REPEAT_MESSAGE);
verify(playerCache, never()).updatePlayer(any(PlayerAuth.class));
}
@Test
public void shouldShowRegularRegisterMessage() {
// given
given(player.getName()).willReturn("user");
given(playerCache.isAuthenticated("user")).willReturn(false);
given(dataSource.isAuthAvailable("user")).willReturn(false);
given(service.getProperty(RegistrationSettings.REGISTRATION_TYPE)).willReturn(RegistrationType.PASSWORD);
given(service.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT)).willReturn(RegisterSecondaryArgument.CONFIRMATION);
// when
asyncAddEmail.addEmail(player, "test@mail.com");

View File

@ -4,11 +4,8 @@ import fr.xephi.authme.data.auth.PlayerAuth;
import fr.xephi.authme.data.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.process.register.RegisterSecondaryArgument;
import fr.xephi.authme.process.register.RegistrationType;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.settings.properties.RegistrationSettings;
import org.bukkit.entity.Player;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -180,32 +177,12 @@ public class AsyncChangeEmailTest {
verify(service).send(player, MessageKey.LOGIN_MESSAGE);
}
@Test
public void shouldShowEmailRegistrationMessage() {
// given
given(player.getName()).willReturn("Bobby");
given(playerCache.isAuthenticated("bobby")).willReturn(false);
given(dataSource.isAuthAvailable("Bobby")).willReturn(false);
given(service.getProperty(RegistrationSettings.REGISTRATION_TYPE)).willReturn(RegistrationType.EMAIL);
given(service.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT)).willReturn(RegisterSecondaryArgument.CONFIRMATION);
// when
process.changeEmail(player, "old@mail.tld", "new@mail.tld");
// then
verify(dataSource, never()).updateEmail(any(PlayerAuth.class));
verify(playerCache, never()).updatePlayer(any(PlayerAuth.class));
verify(service).send(player, MessageKey.REGISTER_EMAIL_MESSAGE);
}
@Test
public void shouldShowRegistrationMessage() {
// given
given(player.getName()).willReturn("Bobby");
given(playerCache.isAuthenticated("bobby")).willReturn(false);
given(dataSource.isAuthAvailable("Bobby")).willReturn(false);
given(service.getProperty(RegistrationSettings.REGISTRATION_TYPE)).willReturn(RegistrationType.PASSWORD);
given(service.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT)).willReturn(RegisterSecondaryArgument.NONE);
// when
process.changeEmail(player, "old@mail.tld", "new@mail.tld");
@ -213,7 +190,7 @@ public class AsyncChangeEmailTest {
// then
verify(dataSource, never()).updateEmail(any(PlayerAuth.class));
verify(playerCache, never()).updatePlayer(any(PlayerAuth.class));
verify(service).send(player, MessageKey.REGISTER_NO_REPEAT_MESSAGE);
verify(service).send(player, MessageKey.REGISTER_MESSAGE);
}
private static PlayerAuth authWithMail(String email) {

View File

@ -6,8 +6,6 @@ import fr.xephi.authme.data.limbo.LimboCache;
import fr.xephi.authme.data.limbo.LimboPlayer;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.message.Messages;
import fr.xephi.authme.process.register.RegisterSecondaryArgument;
import fr.xephi.authme.process.register.RegistrationType;
import fr.xephi.authme.service.BukkitService;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.properties.RegistrationSettings;
@ -65,12 +63,10 @@ public class LimboPlayerTaskManagerTest {
String name = "bobby";
LimboPlayer limboPlayer = mock(LimboPlayer.class);
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
MessageKey key = MessageKey.REGISTER_EMAIL_MESSAGE;
MessageKey key = MessageKey.REGISTER_MESSAGE;
given(messages.retrieve(key)).willReturn(new String[]{"Please register!"});
int interval = 12;
given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(interval);
given(settings.getProperty(RegistrationSettings.REGISTRATION_TYPE)).willReturn(RegistrationType.EMAIL);
given(settings.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT)).willReturn(RegisterSecondaryArgument.CONFIRMATION);
// when
limboPlayerTaskManager.registerMessageTask(name, false);
@ -122,19 +118,14 @@ public class LimboPlayerTaskManagerTest {
String name = "bobby";
given(limboCache.getPlayerData(name)).willReturn(limboPlayer);
given(messages.retrieve(MessageKey.REGISTER_EMAIL_NO_REPEAT_MESSAGE))
.willReturn(new String[]{"Please register", "Use /register"});
given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(8);
given(settings.getProperty(RegistrationSettings.REGISTRATION_TYPE)).willReturn(RegistrationType.EMAIL);
given(settings.getProperty(RegistrationSettings.REGISTER_SECOND_ARGUMENT)).willReturn(RegisterSecondaryArgument.NONE);
// when
limboPlayerTaskManager.registerMessageTask(name, false);
// then
verify(limboPlayer).setMessageTask(any(MessageTask.class));
verify(messages).retrieve(MessageKey.REGISTER_EMAIL_NO_REPEAT_MESSAGE);
verify(messages).retrieve(MessageKey.REGISTER_MESSAGE);
verify(existingMessageTask).cancel();
}