Idk why, but it doesn't work!

This commit is contained in:
Gabriele C 2016-05-20 21:27:47 +02:00
parent 5adf819910
commit 0c2ee34db3

View File

@ -17,6 +17,7 @@ import fr.xephi.authme.permission.PermissionsManager;
import fr.xephi.authme.permission.PlayerStatePermission; import fr.xephi.authme.permission.PlayerStatePermission;
import fr.xephi.authme.process.Management; import fr.xephi.authme.process.Management;
import fr.xephi.authme.settings.NewSetting; import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.SpawnLoader; import fr.xephi.authme.settings.SpawnLoader;
import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.HooksSettings;
import fr.xephi.authme.settings.properties.ProtectionSettings; import fr.xephi.authme.settings.properties.ProtectionSettings;
@ -360,10 +361,11 @@ public class AuthMePlayerListener implements Listener {
return; return;
} }
String nickRegEx = settings.getProperty(RestrictionSettings.ALLOWED_NICKNAME_CHARACTERS); // TODO: fixme! (the regex doesn't work if compiled from the new settings provider)
Pattern nickPattern = Pattern.compile(nickRegEx); //String nickRegEx = settings.getProperty(RestrictionSettings.ALLOWED_NICKNAME_CHARACTERS);
if (nickPattern.matcher(player.getName()).matches() || name.equalsIgnoreCase("Player")) { //Pattern nickPattern = Pattern.compile(nickRegEx);
event.setKickMessage(m.retrieveSingle(MessageKey.INVALID_NAME_CHARACTERS).replace("REG_EX", 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); event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
return; return;
} }