Improve GeoIP errors/warnings (#3568)

Aims to provide a better and less confusing error for users of GeoIP who have not configured properly (which is more common now after the license key requirement). Seems like a lot of people miss the initial error on startup, and so this may help a bit.

Closes #3561.
This commit is contained in:
pop4959 2020-08-04 08:22:14 -07:00 committed by GitHub
parent 1ef4e15a4d
commit 68d0aa9688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -238,7 +238,8 @@ getposCommandUsage=/<command> [player]
giveCommandDescription=Give a player an item.
giveCommandUsage=/<command> <player> <item|numeric> [amount [itemmeta...]]
geoipCantFind=\u00a76Player \u00a7c{0} \u00a76comes from \u00a7aan unknown country\u00a76.
geoIpLicenseMissing=No license key found! Please visit https://essentialsx.cf/geoip for first time setup instructions.
geoIpErrorOnJoin=Unable to fetch GeoIP data for {0}. Please ensure that your license key and configuration are correct.
geoIpLicenseMissing=No license key found\! Please visit https\://essentialsx.net/geoip for first time setup instructions.
geoIpUrlEmpty=GeoIP download url is empty.
geoIpUrlInvalid=GeoIP download url is invalid.
givenSkull=\u00a76You have been given the skull of \u00a7c{0}\u00a76.

View File

@ -56,6 +56,10 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
InetAddress address = player.getAddress().getAddress();
StringBuilder sb = new StringBuilder();
if (mmreader == null) {
logger.log(Level.WARNING, tl("geoIpErrorOnJoin", u.getName()));
return;
}
try {
if (config.getBoolean("database.show-cities", false)) {