* @return a Result indicating if account creation was done successfully or not.
*/
public AccountResult createAccount(String username, String password, String email, String address) {
try {
if (!Boolean.parseBoolean(Configuration.getConfiguration().get("allow_account_creation", "true"))) {
return new AccountResult(Result.FAILED_CREATE_ON_MAIN_INSTEAD, username);
}
} catch (IOException e) {
logger.error(e, e);
}
// check account creation limits
try {
if (DAORegister.get().get(AccountDAO.class).isAccountCreationLimitReached(address)) {
return new AccountResult(Result.FAILED_TOO_MANY, username);
}
} catch (SQLException e) {
logger.error(e, e);
return new AccountResult(Result.FAILED_EXCEPTION, username);
} catch (IOException e) {
logger.error(e, e);
return new AccountResult(Result.FAILED_EXCEPTION, username);
}
// forward the creation request to the game
return ruleProcessor.createAccount(username, password, email);
}