Skip IP check for API registration
This commit is contained in:
@@ -49,7 +49,7 @@ public class AsyncRegister implements AsynchronousProcess {
|
||||
* @param <P> parameters type
|
||||
*/
|
||||
public <P extends RegistrationParameters> void register(RegistrationMethod<P> variant, P parameters) {
|
||||
if (preRegisterCheck(parameters.getPlayer())) {
|
||||
if (preRegisterCheck(variant, parameters.getPlayer())) {
|
||||
RegistrationExecutor<P> executor = registrationExecutorFactory.getSingleton(variant.getExecutorClass());
|
||||
if (executor.isRegistrationAdmitted(parameters)) {
|
||||
executeRegistration(parameters, executor);
|
||||
@@ -57,7 +57,7 @@ public class AsyncRegister implements AsynchronousProcess {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean preRegisterCheck(Player player) {
|
||||
private boolean preRegisterCheck(RegistrationMethod<?> variant, Player player) {
|
||||
final String name = player.getName().toLowerCase();
|
||||
if (playerCache.isAuthenticated(name)) {
|
||||
service.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
@@ -70,7 +70,7 @@ public class AsyncRegister implements AsynchronousProcess {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isPlayerIpAllowedToRegister(player);
|
||||
return variant == RegistrationMethod.API_REGISTRATION || isPlayerIpAllowedToRegister(player);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user