From af84ba6fce3a6e3506b3da4f444a326391b1e852 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Wed, 9 Mar 2016 15:00:17 +0100 Subject: [PATCH] Fix max email count #591 --- .../xephi/authme/process/register/AsyncRegister.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/fr/xephi/authme/process/register/AsyncRegister.java b/src/main/java/fr/xephi/authme/process/register/AsyncRegister.java index 717ab58be..47b715a38 100644 --- a/src/main/java/fr/xephi/authme/process/register/AsyncRegister.java +++ b/src/main/java/fr/xephi/authme/process/register/AsyncRegister.java @@ -103,17 +103,16 @@ public class AsyncRegister implements Process { private void emailRegister() { if (Settings.getmaxRegPerEmail > 0 - && !ip.equalsIgnoreCase("127.0.0.1") - && !ip.equalsIgnoreCase("localhost") && !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)) { - int maxReg = Settings.getmaxRegPerIp; - List otherAccounts = database.getAllAuthsByIp(ip); - if (otherAccounts.size() >= maxReg) { + int maxReg = Settings.getmaxRegPerEmail; + int otherAccounts = database.countAuthsByEmail(email); + if (otherAccounts >= maxReg) { service.send(player, MessageKey.MAX_REGISTER_EXCEEDED, Integer.toString(maxReg), - Integer.toString(otherAccounts.size()), StringUtils.join(", ", otherAccounts.toString())); + Integer.toString(otherAccounts), "@"); return; } } + final HashedPassword hashedPassword = service.computeHash(password, name); PlayerAuth auth = PlayerAuth.builder() .name(name)