10.11.2011, 07:56
(
Last edited by Whitetiger; 02/04/2016 at 03:36 PM.
)
GeoIP (ISP, Country, City)
I have been working on a geo IP that doesn't require a plugin and that can detect more than country, at a fast speed that doesn't freeze the server. The result is this.
The INC uses SQLite this product includes GeoLite data created by MaxMind, available from
http://maxmind.com/
http://geolite.maxmind.com/download/...se/LICENSE.txt
The Country and ISP database is 15 MB, the City database alone is 100 MB, City is in a seperate SQLite database incase you decide not to upload city. (compressed, both databases together are 40 mb)
Speed test
Code:
[07:54:06] took 1 ms - GetPlayerCountry [07:54:06] took 0 ms - GetPlayerCity [07:54:06] took 17 ms - GetPlayerISP
Functions
Code:
GetPlayerCountry(playerid, string[], const len = sizeof(string)); GetPlayerISP(playerid, string[], const len = sizeof(string)); GetPlayerCity(playerid, string[], const len = sizeof(string)); GetPlayerGMT(playerid); GetIPCountry(ip[], dest[], len = sizeof(dest)); GetIPISP(ip[], dest[], len = sizeof(dest)); GetIPCity(ip[], dest[], len = sizeof(dest)); GetIPGMT(ip[]);
Accuracy
http://www.maxmind.com/en/city_accuracy - City accuracy
Country accuracy - 99.5%
Updates
I will try to update the database files monthly when Maxmind updates their databases on their website
Download
GitHub
Download (Database files) (place in /scriptfiles/)
Example
New include will not work with old database files! you must update the database files AND the include for it to work!
Credits
- Whitetiger- RaekwonDaChef
- ******
- Andreas Gohr