Don't let unrestricted usernames bypass the locked ip-username check

This commit is contained in:
Gabriele C 2022-07-17 18:40:11 +02:00
parent 64c45c43df
commit a67a4bb72b

View File

@ -93,6 +93,11 @@ public class AsynchronousJoin implements AsynchronousProcess {
final String name = player.getName().toLowerCase(); final String name = player.getName().toLowerCase();
final String ip = PlayerUtils.getPlayerIp(player); final String ip = PlayerUtils.getPlayerIp(player);
if (!validationService.fulfillsNameRestrictions(player)) {
handlePlayerWithUnmetNameRestriction(player, ip);
return;
}
if (service.getProperty(RestrictionSettings.UNRESTRICTED_NAMES).contains(name)) { if (service.getProperty(RestrictionSettings.UNRESTRICTED_NAMES).contains(name)) {
return; return;
} }
@ -107,11 +112,6 @@ public class AsynchronousJoin implements AsynchronousProcess {
pluginHookService.setEssentialsSocialSpyStatus(player, false); pluginHookService.setEssentialsSocialSpyStatus(player, false);
} }
if (!validationService.fulfillsNameRestrictions(player)) {
handlePlayerWithUnmetNameRestriction(player, ip);
return;
}
if (!validatePlayerCountForIp(player, ip)) { if (!validatePlayerCountForIp(player, ip)) {
return; return;
} }