diff options
Diffstat (limited to 'EssentialsGeoIP/src/com/earth2me')
-rw-r--r-- | EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java | 8 | ||||
-rw-r--r-- | EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java | 15 |
2 files changed, 14 insertions, 9 deletions
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java index 1a01c7132..612fa7030 100644 --- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.geoip; import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.Util; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.event.Event.Priority; @@ -38,8 +39,11 @@ public class EssentialsGeoIP extends JavaPlugin EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder()); pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this); - logger.info("Loaded " + this.getDescription().getName() + " build " + this.getDescription().getVersion() + " by " + Essentials.AUTHORS); - + if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) { + logger.log(Level.WARNING, Util.i18n("versionMismatchAll")); + } + logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Essentials.AUTHORS)); + logger.log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/."); } } diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java index 071e9f6f7..91d0186e6 100644 --- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java @@ -4,6 +4,7 @@ import com.earth2me.essentials.Essentials; import com.earth2me.essentials.EssentialsConf; import com.earth2me.essentials.IConf; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import com.maxmind.geoip.Location; import com.maxmind.geoip.LookupService; import com.maxmind.geoip.regionName; @@ -83,7 +84,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo { User user = ess.getUser(player); if (user.isAuthorized("essentials.geoip.show")) { - user.sendMessage("Player " + u.getDisplayName() + " comes from " + sb.toString()); + user.sendMessage(Util.format("geoipJoinFormat", u.getDisplayName(), sb.toString())); } } } @@ -110,7 +111,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo } else { - logger.log(Level.SEVERE, "Can't find GeoIP database!"); + logger.log(Level.SEVERE, Util.i18n("cantFindGeoIpDB")); return; } } @@ -120,7 +121,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to read GeoIP database!", ex); + logger.log(Level.SEVERE, Util.i18n("cantReadGeoIpDB"), ex); } } @@ -139,10 +140,10 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo } if (url == null || url.isEmpty()) { - logger.log(Level.SEVERE, "GeoIP download url is empty."); + logger.log(Level.SEVERE, Util.i18n("geoIpUrlEmpty")); return; } - logger.log(Level.INFO, "Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)"); + logger.log(Level.INFO, Util.i18n("downloadingGeoIp")); URL downloadUrl = new URL(url); URLConnection conn = downloadUrl.openConnection(); conn.setConnectTimeout(10000); @@ -165,12 +166,12 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo } catch (MalformedURLException ex) { - logger.log(Level.SEVERE, "GeoIP download url is invalid.", ex); + logger.log(Level.SEVERE, Util.i18n("geoIpUrlInvalid"), ex); return; } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to open connection.", ex); + logger.log(Level.SEVERE, Util.i18n("connectionFailed"), ex); } } } |