Added kick method for joinverifier
This commit is contained in:
parent
e02fa4381c
commit
7ee82882fc
@ -94,6 +94,18 @@ public class OnJoinVerifier implements Reloadable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether email verification is required, and if so, whether the email is verified.
|
||||||
|
*
|
||||||
|
* @param isAuthAvailable whether or not the player's email is verified
|
||||||
|
* @throws FailedVerificationException if the email verification is not completed
|
||||||
|
*/
|
||||||
|
public void checkKickNotVerified(boolean isAuthAvailable) throws FailedVerificationException {
|
||||||
|
if (!isAuthAvailable && settings.getProperty(RestrictionSettings.KICK_NOT_VERIFIED)) {
|
||||||
|
throw new FailedVerificationException(MessageKey.MUST_VERIFIED_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks that the name adheres to the configured username restrictions.
|
* Checks that the name adheres to the configured username restrictions.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -150,8 +150,9 @@ public class PlayerListener implements Listener {
|
|||||||
// Slow, blocking checks
|
// Slow, blocking checks
|
||||||
try {
|
try {
|
||||||
final PlayerAuth auth = dataSource.getAuth(name);
|
final PlayerAuth auth = dataSource.getAuth(name);
|
||||||
final boolean isAuthAvailable = auth != null;
|
final boolean isAuthAvailable = auth != null && auth.isEmailVerified();
|
||||||
onJoinVerifier.checkKickNonRegistered(isAuthAvailable);
|
onJoinVerifier.checkKickNonRegistered(isAuthAvailable);
|
||||||
|
onJoinVerifier.checkKickNotVerified(isAuthAvailable);
|
||||||
onJoinVerifier.checkAntibot(name, isAuthAvailable);
|
onJoinVerifier.checkAntibot(name, isAuthAvailable);
|
||||||
onJoinVerifier.checkNameCasing(name, auth);
|
onJoinVerifier.checkNameCasing(name, auth);
|
||||||
final String ip = event.getAddress().getHostAddress();
|
final String ip = event.getAddress().getHostAddress();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user