From 0c2ee34db392a705e1a2335acfc8a74398054ce9 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Fri, 20 May 2016 21:27:47 +0200 Subject: [PATCH] Idk why, but it doesn't work! --- .../fr/xephi/authme/listener/AuthMePlayerListener.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java index 5d700e4e0..2dd76c70b 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java @@ -17,6 +17,7 @@ import fr.xephi.authme.permission.PermissionsManager; import fr.xephi.authme.permission.PlayerStatePermission; import fr.xephi.authme.process.Management; import fr.xephi.authme.settings.NewSetting; +import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.SpawnLoader; import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.ProtectionSettings; @@ -360,10 +361,11 @@ public class AuthMePlayerListener implements Listener { return; } - String nickRegEx = settings.getProperty(RestrictionSettings.ALLOWED_NICKNAME_CHARACTERS); - Pattern nickPattern = Pattern.compile(nickRegEx); - if (nickPattern.matcher(player.getName()).matches() || name.equalsIgnoreCase("Player")) { - event.setKickMessage(m.retrieveSingle(MessageKey.INVALID_NAME_CHARACTERS).replace("REG_EX", nickRegEx)); + // TODO: fixme! (the regex doesn't work if compiled from the new settings provider) + //String nickRegEx = settings.getProperty(RestrictionSettings.ALLOWED_NICKNAME_CHARACTERS); + //Pattern nickPattern = Pattern.compile(nickRegEx); + if (Settings.nickPattern.matcher(player.getName()).matches() || name.equalsIgnoreCase("Player")) { + event.setKickMessage(m.retrieveSingle(MessageKey.INVALID_NAME_CHARACTERS).replace("REG_EX", Settings.getNickRegex)); event.setResult(PlayerLoginEvent.Result.KICK_OTHER); return; }