Disable GeoIP with config: remove field, fix tests
This commit is contained in:
@@ -64,8 +64,6 @@ public class GeoIpService {
|
||||
private GeoIp2Provider databaseReader;
|
||||
private volatile boolean downloading;
|
||||
|
||||
private boolean enabled = true;
|
||||
|
||||
@Inject
|
||||
GeoIpService(@DataFolder File dataFolder, BukkitService bukkitService, Settings settings) {
|
||||
this.bukkitService = bukkitService;
|
||||
@@ -94,7 +92,6 @@ public class GeoIpService {
|
||||
|
||||
// If this feature is disabled, just stop
|
||||
if (!settings.getProperty(ProtectionSettings.ENABLE_GEOIP)) {
|
||||
enabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -289,9 +286,6 @@ public class GeoIpService {
|
||||
* or "--" if it cannot be fetched.
|
||||
*/
|
||||
public String getCountryCode(String ip) {
|
||||
if (!enabled) {
|
||||
return "--";
|
||||
}
|
||||
if (InternetProtocolUtils.isLocalAddress(ip)) {
|
||||
return "LOCALHOST";
|
||||
}
|
||||
@@ -305,9 +299,6 @@ public class GeoIpService {
|
||||
* @return The name of the country, "LocalHost" for local addresses, or "N/A" if it cannot be fetched.
|
||||
*/
|
||||
public String getCountryName(String ip) {
|
||||
if (!enabled) {
|
||||
return "N/A";
|
||||
}
|
||||
if (InternetProtocolUtils.isLocalAddress(ip)) {
|
||||
return "LocalHost";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user