Finally fix #570
This commit is contained in:
parent
1e0d31ebb7
commit
e4d2747fae
@ -41,7 +41,7 @@ public enum MessageKey {
|
|||||||
|
|
||||||
REGISTER_EMAIL_MESSAGE("reg_email_msg"),
|
REGISTER_EMAIL_MESSAGE("reg_email_msg"),
|
||||||
|
|
||||||
MAX_REGISTER_EXCEEDED("max_reg", "%max_acc", "%reg_acc"),
|
MAX_REGISTER_EXCEEDED("max_reg", "%max_acc", "%reg_count", "%reg_names"),
|
||||||
|
|
||||||
USAGE_REGISTER("usage_reg"),
|
USAGE_REGISTER("usage_reg"),
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package fr.xephi.authme.process.register;
|
package fr.xephi.authme.process.register;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -99,13 +101,13 @@ public class AsyncRegister {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void emailRegister() {
|
private void emailRegister() {
|
||||||
Integer maxReg = Settings.getmaxRegPerIp;
|
if(Settings.getmaxRegPerEmail > 0 && !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)) {
|
||||||
Integer size = 0;
|
Integer maxReg = Settings.getmaxRegPerIp;
|
||||||
if (Settings.getmaxRegPerEmail > 0
|
List<String> otherAccounts = database.getAllAuthsByIp(ip);
|
||||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
if (otherAccounts.size() >= maxReg) {
|
||||||
&& (size = database.getAllAuthsByIp(ip).size()) >= maxReg) {
|
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, maxReg.toString(), Integer.toString(otherAccounts.size()), otherAccounts.toString());
|
||||||
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, maxReg.toString(), size.toString());
|
return;
|
||||||
return;
|
}
|
||||||
}
|
}
|
||||||
final HashedPassword hashedPassword = plugin.getPasswordSecurity().computeHash(password, name);
|
final HashedPassword hashedPassword = plugin.getPasswordSecurity().computeHash(password, name);
|
||||||
PlayerAuth auth = PlayerAuth.builder()
|
PlayerAuth auth = PlayerAuth.builder()
|
||||||
|
|||||||
@ -12,7 +12,7 @@ login: '&2Successful login!'
|
|||||||
vb_nonActiv: '&cYour account isn''t activated yet, please check your emails!'
|
vb_nonActiv: '&cYour account isn''t activated yet, please check your emails!'
|
||||||
user_regged: '&cYou already have registered this username!'
|
user_regged: '&cYou already have registered this username!'
|
||||||
usage_reg: '&cUsage: /register <password> <ConfirmPassword>'
|
usage_reg: '&cUsage: /register <password> <ConfirmPassword>'
|
||||||
max_reg: '&cYou have exceeded the maximum number of registrations (%reg_acc/%max_acc) for your connection!'
|
max_reg: '&cYou have exceeded the maximum number of registrations (%reg_count/%max_acc %reg_names) for your connection!'
|
||||||
no_perm: '&4You don''t have the permission to perform this action!'
|
no_perm: '&4You don''t have the permission to perform this action!'
|
||||||
error: '&4An unexpected error occurred, please contact an administrator!'
|
error: '&4An unexpected error occurred, please contact an administrator!'
|
||||||
login_msg: '&cPlease, login with the command "/login <password>"'
|
login_msg: '&cPlease, login with the command "/login <password>"'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user