mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-30 22:23:54 +01:00
Add Hostname to restricted ip method
This commit is contained in:
parent
c94b6223a1
commit
806201e1cc
@ -58,7 +58,7 @@ public class AsynchronousJoin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String ip = plugin.getIP(player);
|
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() {
|
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -385,7 +385,7 @@ public final class Settings {
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static boolean getRestrictedIp(String name, String ip) {
|
public static boolean getRestrictedIp(String name, String ip, String domain) {
|
||||||
|
|
||||||
Iterator<String> iterator = getRestrictedIp.iterator();
|
Iterator<String> iterator = getRestrictedIp.iterator();
|
||||||
boolean trueOnce = false;
|
boolean trueOnce = false;
|
||||||
@ -396,10 +396,19 @@ public final class Settings {
|
|||||||
String testIp = args[1];
|
String testIp = args[1];
|
||||||
if (testName.equalsIgnoreCase(name)) {
|
if (testName.equalsIgnoreCase(name)) {
|
||||||
nameFound = true;
|
nameFound = true;
|
||||||
|
if (ip != null)
|
||||||
|
{
|
||||||
if (testIp.equalsIgnoreCase(ip)) {
|
if (testIp.equalsIgnoreCase(ip)) {
|
||||||
trueOnce = true;
|
trueOnce = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (domain != null)
|
||||||
|
{
|
||||||
|
if (testIp.equalsIgnoreCase(domain)) {
|
||||||
|
trueOnce = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return !nameFound || trueOnce;
|
return !nameFound || trueOnce;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user