From 806201e1cc7250f2ebf71a4f3f219eef7b5a64e1 Mon Sep 17 00:00:00 2001 From: Xephi Date: Mon, 28 Dec 2015 11:59:30 +0100 Subject: [PATCH] Add Hostname to restricted ip method --- .../authme/process/join/AsynchronousJoin.java | 2 +- .../java/fr/xephi/authme/settings/Settings.java | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java index 406f63335..56656e97f 100644 --- a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java +++ b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java @@ -58,7 +58,7 @@ public class AsynchronousJoin { } final String ip = plugin.getIP(player); - if (Settings.isAllowRestrictedIp && !Settings.getRestrictedIp(name, ip)) { + if (Settings.isAllowRestrictedIp && !Settings.getRestrictedIp(name, ip, player.getAddress().getHostName())) { sched.scheduleSyncDelayedTask(plugin, new Runnable() { @Override diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index f4943a53d..6080d45eb 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -385,7 +385,7 @@ public final class Settings { * * @return boolean */ - public static boolean getRestrictedIp(String name, String ip) { + public static boolean getRestrictedIp(String name, String ip, String domain) { Iterator iterator = getRestrictedIp.iterator(); boolean trueOnce = false; @@ -396,8 +396,17 @@ public final class Settings { String testIp = args[1]; if (testName.equalsIgnoreCase(name)) { nameFound = true; - if (testIp.equalsIgnoreCase(ip)) { - trueOnce = true; + if (ip != null) + { + if (testIp.equalsIgnoreCase(ip)) { + trueOnce = true; + } + } + if (domain != null) + { + if (testIp.equalsIgnoreCase(domain)) { + trueOnce = true; + } } } } @@ -746,7 +755,7 @@ public final class Settings { if (!contains("Email.emailOauth2Token")) set("Email.emailOauth2Token", ""); - + if (!contains("Hook.sendPlayerTo")) { set("Hooks.sendPlayerTo", "");