class EmailRegisterExecutor implements RegistrationExecutor<EmailRegisterParams> {

    @Override
    public boolean isRegistrationAdmitted(EmailRegisterParams params) {
        final int maxRegPerEmail = commonService.getProperty(EmailSettings.MAX_REG_PER_EMAIL);
        if (maxRegPerEmail > 0 && !commonService.hasPermission(params.getPlayer(), ALLOW_MULTIPLE_ACCOUNTS)) {
            int otherAccounts = dataSource.countAuthsByEmail(params.getEmail());
            if (otherAccounts >= maxRegPerEmail) {
                commonService.send(params.getPlayer(), MessageKey.MAX_REGISTER_EXCEEDED,
                    Integer.toString(maxRegPerEmail), Integer.toString(otherAccounts), "@");
                return false;
            }
        }
        return true;
    }

}