Raised This Month: $23 Target: $400
 5% 

[ANY] Hattrick's GeoIP Resolver (2.0) [Dec 18, 2015] +Plug-ins (3)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
claudiuhks
Yam InsideŽ™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-01-2015 , 15:32   [ANY] Hattrick's GeoIP Resolver (2.0) [Dec 18, 2015] +Plug-ins (3)
Reply With Quote #1

The Summary

This extension is intended to resolve geographical information by the IP address (IPV4 only) and does only work on Windows and Linux.

It uses two free C libraries and databases at the same time (MaxMindŽ's GeoLiteCity and GeoLite2-City) in order to improve the look-up process ensuring that there are less chances to fail retrieving a record.

Furthermore, you can also run in the same time another two paid MaxMindŽ databases (GeoIPCity and GeoIPISP), if you own them.

How it Works

It starts scanning by using the free databases, to see if a result is retrieved, then it continues by scanning with the other databases, completing the missing fields that appear as N/A.

The Features

It supports updating the databases while the game server changes map, without manually restarting it. Read the instructions inside the .ZIP file.

The Pictures

The Server's Console

Spoiler


This is How a Complete Record Looks Like

Spoiler


This is How The .INC File Looks Like

Spoiler


This is a Test Suite Plug-in

Spoiler


This is How to Manually Install The Databases in /addons/sourcemod/data/GeoResolver Directory

Code:
Download and un-zip the next two files:

1.	GeoLite2 City	@	http://dev.maxmind.com/geoip/geoip2/geolite2/
2.	GeoLite City	@	http://dev.maxmind.com/geoip/legacy/geolite/

Their un-zipped names are:

1.	GeoLite2-City.mmdb
2.	GeoLiteCity.dat



*********************************************
// FOR THOSE WHO OWN PAID VERSIONS AS WELL //

1.	GeoIPCity.dat
2.	GeoIPISP.dat


* Put these files too if you want a better accuracy and you own them.
The Changes

Code:
1.0 @ Aug 1, 2015

★ The initial release.

1.0 @ Aug 2, 2015

★ Updated the .INC file and added the "Hattrick's Connect Announcer" Plug-in.

1.0 @ Aug 6, 2015

★ Updated the .INC file adding new functions [GeoR_Reload, GeoR_Databases].
★ Updated the Plug-ins.
★ Added a new Plug-in that allows you to update the database files at map change,
   without manually restarting the game server.
★ Added the Regular Expressions (RegEx/ PCRE) library in order to validate the IPV4 address, for safety purposes.

1.0 @ Aug 11, 2015

★ Updated the Windows and Linux binaries.
★ Updated the Regular Expressions (RegEx/ PCRE) library.
★ Updated the IP Address' PCRE pattern.
★ Updated the Makefile's flags.
★ Removed a few GLIBC dependencies on the Linux build.

1.0 @ Dec 18, 2015

★ Updated the Windows and Linux binaries.
★ Updated the .INC file and the Plug-ins' sources to the newer SourceMod style.
★ Fixed a very insignificant issue that the StripPort() function was declared and never used.
★ Updated the GeoIP-C and LibMaxMindDB libraries to the latest GitHub versions.

2.0 @ May 20, 2020

★ Updated the Plug-ins' sources & the .INC file.
GeoIP.dat, GeoIPISP.dat and GeoIPCity.dat are discontinued by MaxMindŽ for months or years and can't be downloaded anymore. So here are two Feb. 2017 databases that are still pretty accurate and work pretty nice.

https://gofile.io/d/8Uf9cJ
Attached Files
File Type: zip [Source Code] GeoResolver.zip (538.2 KB, 183 views)
File Type: zip GeoResolver.zip (407.6 KB, 322 views)
File Type: zip GeoResolver [scripting] 2020.zip (7.3 KB, 18 views)
__________________

Last edited by claudiuhks; 05-20-2020 at 16:33. Reason: Improved The Three Plug-ins & The .INC File, Version 2.0
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 08-08-2015 , 16:11   Re: [ANY] Hattrick's Geo Resolver (1.0) [Aug 6, 2015] +Plug-ins
Reply With Quote #2

Very nice my friend! Good job!
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
claudiuhks
Yam InsideŽ™℠
Join Date: Jan 2010
Location: Living Randomly
Old 12-18-2015 , 17:02   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #3

Updated today (Dec 18, 2015).
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 02-21-2016 , 19:06   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #4

Thanks for this!

How does the updater work ?

Im using this cron job.


https://github.com/certtools/intelmq...n-jobs/maxmind

Would this work if I dump the file into "Update"?
ImACow is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 02-22-2016 , 00:17   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #5

Quote:
Originally Posted by ImACow View Post
Thanks for this!

How does the updater work ?

Im using this cron job.


https://github.com/certtools/intelmq...n-jobs/maxmind

Would this work if I dump the file into "Update"?
1. Download a new copy of each database you have access to.
2. Extract those updates, so the extracted file ends up in the "addons/sourcemod/data/GeoResolver/Update/"-folder.
3. GeoResolver will now handle the rest on it's own.

Whether you use the linked script, or other scripts to do it via cron doesn't matter; as long as those scripts are doing things exactly as explained above.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 02-22-2016 , 11:49   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #6

When using: GeoR_DistancePlrSrv


PHP Code:

GeoResolver
.inc(306) : error 017undefined symbol "pCVar"
GeoResolver.inc(313) : error 017undefined symbol "GetClientIp"
GeoResolver.inc(313) : error 092number of arguments does not match definition 

Last edited by ImACow; 02-22-2016 at 11:50.
ImACow is offline
claudiuhks
Yam InsideŽ™℠
Join Date: Jan 2010
Location: Living Randomly
Old 02-26-2016 , 10:34   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #7

Quote:
Originally Posted by ImACow View Post
When using: GeoR_DistancePlrSrv


PHP Code:

GeoResolver
.inc(306) : error 017undefined symbol "pCVar"
GeoResolver.inc(313) : error 017undefined symbol "GetClientIp"
GeoResolver.inc(313) : error 092number of arguments does not match definition 
Must be fixed now, in the first post. Thanks for reporting it out.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-26-2016 , 12:03   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #8

One thing I did notice, your extension's source veers away from how normally SM extension source's get SM's API headers.
WildCard65 is offline
Kamil445
Member
Join Date: Dec 2013
Old 12-02-2016 , 08:02   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #9

I'm so stupid, i forgot copy .ext file.

Last edited by Kamil445; 12-02-2016 at 08:42.
Kamil445 is offline
Nerus
Senior Member
Join Date: Aug 2010
Location: Poland
Old 07-11-2018 , 03:36   Re: [ANY] Hattrick's Geo Resolver (1.0) [Dec 18, 2015] +Plug-ins
Reply With Quote #10

Not working anymore ?

Output on player spawned
Quote:
Player Nerus country code: 'N/A', country code3: 'N/A', country: 'N/A', city 'N/A', region_code 'N/A', region 'N/A'
Output from author example plugin:
Quote:
Player Nerus joined
exts
Quote:
sm exts list
[SM] Displaying 9 extensions:
[01] Automatic Updater (1.9.0.6226): Updates SourceMod gamedata files
[02] Webternet (1.9.0.6226): Extension for interacting with URLs
[03] CS Tools (1.9.0.6226): CS extended functionality
[04] BinTools (1.9.0.6226): Low-level C/C++ Calling API
[05] SDK Tools (1.9.0.6226): Source SDK Tools
[06] Top Menus (1.9.0.6226): Creates sorted nested menus
[07] Regex (1.9.0.6226): Provides regex natives for plugins
[08] SDK Hooks (1.9.0.6226): Source SDK Hooks
[09] Hattrick's Geo Resolver (1.0.0.0): Resolves Geo data by IP
DB Files:
Quote:
GeoLite2-City.mmdb
GeoLiteCity.dat

Last edited by Nerus; 07-11-2018 at 03:49.
Nerus is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:53.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode