Skip to content

Latest commit

 

History

History
107 lines (88 loc) · 3.77 KB

README.md

File metadata and controls

107 lines (88 loc) · 3.77 KB

Language License GitHub license GitHub issues GitHub tag Repo-size Stars Forks Travis

GeoIP-API

✋ API for working with IP and Geo Location from webresources. using some maxmind api

About

This API helps the user use the Internet Protocol differently. Please check new updates on github Check Releases

Maven

<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>

Gradle (Groovy)

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()));

Features

1.0

  • Fatest request DB
  • Implemented Cache handler

1.1

  • Not require zip link information
  • Automatic IP handler
  • Such GeoIP.java now redefined

1.2

1.3

  • Bugs fixed 🧀

Dependencies

Examples

Java

   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");
   		
   	}
       
   }

Installing

  • 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

Licence

Project leached Apache License Version 2.0. For more information