From f33446ee253f3da42c1ba1f9ea4ae0228e5cc110 Mon Sep 17 00:00:00 2001 From: games647 Date: Sat, 17 Mar 2018 03:00:24 +0100 Subject: [PATCH] Migrate to GEO IP 2 (Related #1471) (#1529) * Migrate to GEO IP 2, because support will drop in April * Change all links of maxmind to https * Update maxmind database dependency and add javatar to extract the database from the tar archive (now only a small difference in jar file size -> ~80KB smaller) * Verify downloaded archive using MD5 (There are no other checksums available) * Migrate to Java NIO instead of old java file I/O (Feedback?) * Internal Optional usage for nullable values (Feedback?) Minor: * Schedule a Bukkit async task instead of creating a thread manually * Validate ip input string * Extract validation into single method * Close all resources safely using try-resources * More https links * Add documentation * Set the same last modification as in the tar archive * Fix tests * Comment how the legacy API responded to unknown entries * Document missing function param * Document our maxmind dependency modifications * Include time unit into constant * More logging for downloading the database * Add missing return if the database cannot be found * Delete temporarily file after working with it --- README.md | 4 +- pom.xml | 28 +- src/main/java/fr/xephi/authme/AuthMe.java | 7 +- .../fr/xephi/authme/service/GeoIpService.java | 267 +++++++++++++----- .../properties/ProtectionSettings.java | 2 +- .../authme/service/GeoIpServiceTest.java | 61 ++-- 6 files changed, 262 insertions(+), 107 deletions(-) diff --git a/README.md b/README.md index 255f36cf9..24514408c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ You can also create your own translation file and, if you want, you can share it