β API for working with IP and Geo Location from webresources. using some maxmind api
This API helps the user use the Internet Protocol differently. Please check new updates on github Check Releases
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.MrHaber</groupId>
<artifactId>GeoIP-API</artifactId>
<version>0.15</version>
<type>pom</type>
</dependency>
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.MrHaber:GeoIP-API:0.15'
}
You can use this, without large dependency.
loader = new GZIPLoader("https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=xn8gNRMTA7nzHy3g&suffix=tar.gz", loader_file_link, "GeoIP-City.tar.gz");
loader.start(loader.load(loader.getURL(), loader.getPath(), loader.getName()));
- Fatest request DB
- Implemented Cache handler
- Not require zip link information
- Automatic IP handler
- Such GeoIP.java now redefined
- Added GZIP Loader with jarchivelib
- Bugs fixed π§
private static final Logger logger = ProxyServer.getInstance().getLogger();
@EventHandler
public void ServerConnectEvent(ServerConnectedEvent e) {
final ProxiedPlayer player = e.getPlayer();
try {
GeoAPI provider = GeoProvider.createConnectionDB().initStatementIP(player.getAddress().getHostName()).getGeoAPI();
logger.log(Level.INFO, "[GeoIP] Player country is : " + provider.getCityProvider().getName());
}catch (Exception ex) {
logger.log(Level.WARNING, "[GeoIP] Something went wrong");
}
}
- Install bungeecord
- Move GeoIP-API.jar into plugins folder
- Start the server so that the database boots.
- You can use plugins with api if database are loaded
https://github.com/MrHaber/GeoIP-API-Bungee/releases
Project leached Apache License Version 2.0. For more information