Raised This Month: $12 Target: $400
 3% 

GeoIP2 in HLXCE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdulsami34
Member
Join Date: Oct 2017
Old 02-21-2019 , 20:25   GeoIP2 in HLXCE
Reply With Quote #1

The GeoLite Legacy has discontinued, Could anyone help me out with the new GeoLite2 and how to make it work with HLX
abdulsami34 is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: Czech_Republic
Old 02-22-2019 , 16:15   Re: GeoIP2 in HLXCE
Reply With Quote #2

Hello,
install GeoIP2 :: Database :: Reader (https://metacpan.org/pod/GeoIP2:atabase::Reader) via CPAN.

PHP Code:
Module Install Instructions
To install GeoIP2
::Database::Readersimply copy and paste either of the commands in to your terminal

cpanm
                    cpanm GeoIP2
                    cpanm GeoIP2
::Database::Reader
CPAN shell
                    perl 
-MCPAN -e shell
                    install GeoIP2
                    install GeoIP2
::Database::Reader 
And update your scripts https://github.com/NomisCZ/hlstatsx-...master/scripts to latest
__________________

Last edited by NomisCZ; 04-04-2019 at 14:34.
NomisCZ is offline
r3v
Senior Member
Join Date: Feb 2016
Location: Lithuania, Vilnius
Old 03-02-2019 , 03:55   Re: GeoIP2 in HLXCE
Reply With Quote #3

Then i install:cpan , install GeoIP2::Database::Reader . My hlstatsx is not working...

PHP Code:
2019-03-02 13:36:59:                       - MYSQLConnecting to MySQL database 'hlstatsx' on 'localhost' as user 'root' ... connected ok
2019
-03-02 13:36:59:                       - CONFIGReading database config...
2019-03-02 13:36:59:                       - CONFIGI have found the following server configs in database:
2019-03-02 13:36:59:                       - S_CONFIGxx.xxx.xxx.xxx:27016
2019
-03-02 13:37:00:                       - HLSTATSXHLstatsX:CE 1.6.19 starting...
2019-03-02 13:37:00:                       - UDPOpening UDP listen socket on port 27500 ... ok
2019
-03-02 13:37:00:                       - HLSTATSXTracking Trend of the stats are enabled
2019
-03-02 13:37:00:                       - HLSTATSXMaximum Skill Change on all servers are 25 points
2019
-03-02 13:37:00:                       - HLSTATSXMinimum Skill Change on all servers are 2 points
2019
-03-02 13:37:00:                       - HLSTATSXMinimum Players Kills on all servers are 50 kills
2019
-03-02 13:37:00:                       - HLSTATSXPlayers chat logging is enabled
2019
-03-02 13:37:00:                       - HLSTATSXBroadcasting public chat is disabled
2019
-03-02 13:37:00:                       - HLSTATSXEvent queue size is set to 10
2019
-03-02 13:37:00:                       - HLSTATSXHLstatsX:CE is now running (Normal modedebug level 1)
2019-03-02 13:37:32:  xx.xxx.xxx.xxx:27016 SERVERConnecting to rcon on xx.xxx.xxx.xxx:27016 ... ok
2019
-03-02 13:37:32:  xx.xxx.xxx.xxx:27016 TRCONTrying to get rcon access (auth)
2019-03-02 13:37:32:  xx.xxx.xxx.xxx:27016 TRCONTrying to get rcon access (auth)
2019-03-02 13:37:37:  xx.xxx.xxx.xxx:27016 SERVERServer running map: /1224991873/$2000$
The IP address you provided (xx.xxx.xxx.xxx:27016is not a valid IPv4 or IPv6 address at /usr/local/share/perl/5.18.2/MaxMind/DB/Reader/Role/Reader.pm line 39. 

Last edited by r3v; 03-02-2019 at 06:40.
r3v is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: Czech_Republic
Old 03-02-2019 , 16:52   Re: GeoIP2 in HLXCE
Reply With Quote #4

Quote:
Originally Posted by r3v View Post
Then i install:cpan , install GeoIP2:atabase::Reader . My hlstatsx is not working...

PHP Code:
2019-03-02 13:36:59:                       - MYSQLConnecting to MySQL database 'hlstatsx' on 'localhost' as user 'root' ... connected ok
2019
-03-02 13:36:59:                       - CONFIGReading database config...
2019-03-02 13:36:59:                       - CONFIGI have found the following server configs in database:
2019-03-02 13:36:59:                       - S_CONFIGxx.xxx.xxx.xxx:27016
2019
-03-02 13:37:00:                       - HLSTATSXHLstatsX:CE 1.6.19 starting...
2019-03-02 13:37:00:                       - UDPOpening UDP listen socket on port 27500 ... ok
2019
-03-02 13:37:00:                       - HLSTATSXTracking Trend of the stats are enabled
2019
-03-02 13:37:00:                       - HLSTATSXMaximum Skill Change on all servers are 25 points
2019
-03-02 13:37:00:                       - HLSTATSXMinimum Skill Change on all servers are 2 points
2019
-03-02 13:37:00:                       - HLSTATSXMinimum Players Kills on all servers are 50 kills
2019
-03-02 13:37:00:                       - HLSTATSXPlayers chat logging is enabled
2019
-03-02 13:37:00:                       - HLSTATSXBroadcasting public chat is disabled
2019
-03-02 13:37:00:                       - HLSTATSXEvent queue size is set to 10
2019
-03-02 13:37:00:                       - HLSTATSXHLstatsX:CE is now running (Normal modedebug level 1)
2019-03-02 13:37:32:  xx.xxx.xxx.xxx:27016 SERVERConnecting to rcon on xx.xxx.xxx.xxx:27016 ... ok
2019
-03-02 13:37:32:  xx.xxx.xxx.xxx:27016 TRCONTrying to get rcon access (auth)
2019-03-02 13:37:32:  xx.xxx.xxx.xxx:27016 TRCONTrying to get rcon access (auth)
2019-03-02 13:37:37:  xx.xxx.xxx.xxx:27016 SERVERServer running map: /1224991873/$2000$
The IP address you provided (xx.xxx.xxx.xxx:27016is not a valid IPv4 or IPv6 address at /usr/local/share/perl/5.18.2/MaxMind/DB/Reader/Role/Reader.pm line 39. 
There is a problem with local IPs (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) subnets. Server probably does not have a public IP address. I'll try to fix this problem ...
__________________
NomisCZ is offline
r3v
Senior Member
Join Date: Feb 2016
Location: Lithuania, Vilnius
Old 03-10-2019 , 03:16   Re: GeoIP2 in HLXCE
Reply With Quote #5

Quote:
Originally Posted by NomisCZ View Post
There is a problem with local IPs (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) subnets. Server probably does not have a public IP address. I'll try to fix this problem ...
Are you working on fix? Or maybe revert old GeoIP?
r3v is offline
nikooo777
AlliedModders Donor
Join Date: Apr 2010
Location: Lugano, Switzerland
Old 03-10-2019 , 13:52   Re: GeoIP2 in HLXCE
Reply With Quote #6

Please be careful eveyone when updating the scripts with the above changes.

the charset is changed from utf8 to utf8mb4, which is great, but if you database isn't adjusted then you'll end up with errors such as:

Code:
DBD::mysql::st execute failed: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=' at .//HLstats.plib line 185.
Unable to execute query:

                        SELECT
                                playerId
                        FROM
                                hlstats_PlayerNames
                        WHERE
                                playerId = 1180307
                                AND name ='{����} ��������'

Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '='
__________________
nikooo777 is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: Czech_Republic
Old 03-26-2019 , 16:01   Re: GeoIP2 in HLXCE
Reply With Quote #7

I'm sorry, I was busy.

Latest code is on Github and don't forget to install Perl Syntax::Keyword::Try (https://metacpan.org/pod/Syntax::Keyword::Try)
PHP Code:
perl -MCPAN -e shell
install Syntax
::Keyword::Try 
Don't forget to to download/update GeoIP database (new format): scripts/GeoLiteCity/install_binary.sh (run this).

-> https://github.com/NomisCZ/hlstatsx-community-edition
__________________

Last edited by NomisCZ; 04-03-2019 at 13:33.
NomisCZ is offline
nikooo777
AlliedModders Donor
Join Date: Apr 2010
Location: Lugano, Switzerland
Old 04-19-2019 , 11:48   Re: GeoIP2 in HLXCE
Reply With Quote #8

any chances you can help me out figuring out why this is broken?
https://stats.elite-hunterz.info/hls...player=1251193

it's the events tab in the player's page.

EDIT: the fix is actually simple:

edit https://github.com/NomisCZ/hlstatsx-...story.php#L165 and change it to the following

Code:
DEFAULT CHARSET=utf8mb4
Edit2: I submitted a PR
__________________

Last edited by nikooo777; 04-19-2019 at 12:03.
nikooo777 is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: Czech_Republic
Old 04-19-2019 , 14:24   Re: GeoIP2 in HLXCE
Reply With Quote #9

Quote:
Originally Posted by nikooo777 View Post
any chances you can help me out figuring out why this is broken?
https://stats.elite-hunterz.info/hls...player=1251193

it's the events tab in the player's page.

EDIT: the fix is actually simple:

edit https://github.com/NomisCZ/hlstatsx-...story.php#L165 and change it to the following

Code:
DEFAULT CHARSET=utf8mb4
Edit2: I submitted a PR
Maybe default database charset, because on my server I have default utf8mb4.

Thanks for PR!
__________________
NomisCZ is offline
mariozankl
Member
Join Date: May 2012
Location: Austria
Old 05-23-2019 , 07:55   Re: GeoIP2 in HLXCE
Reply With Quote #10

Hi, i have a problem with GeoIP.

I always get the folloging message in the deamon log:

ERROR: GeoIP method set to binary file lookup but GeoIP2:atabase::Reader module NOT FOUND

I tryed to install GeoIP2:atabase::Reader but it seems that it doesnt work.

I never worked with GeoIP before. Im using Debian 9. Do you have any Idea?

Code:
cpan[3]> install GeoIP2::Database::Reader
Running install for module 'GeoIP2::Database::Reader'
  MAXMIND/GeoIP2-2.006001.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/GeoIP2-2.006001-uQZ9WO
  MAXMIND/GeoIP2-2.006001.tar.gz
  Has already been prepared
  MAXMIND/GeoIP2-2.006001.tar.gz
  Has already been made
Running make test
PERL_DL_NONLAZY=1 PERL_USE_UNSAFE_INC=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/GeoIP2/*.t t/GeoIP2/Database/*.t t/GeoIP2/Error/*.t t/GeoIP2/Model/*.t t/GeoIP2/WebService/*.t
t/00-report-prereqs.t ....................... #
# Versions for all modules listed in MYMETA.json (including optional ones):
#
# === Configure Requires ===
#
#     Module              Want    Have
#     ------------------- ---- -------
#     ExtUtils::MakeMaker  any 7.10_02
#
# === Build Requires ===
#
#     Module              Want    Have
#     ------------------- ---- -------
#     ExtUtils::MakeMaker  any 7.10_02
#
# === Test Requires ===
#
#     Module                Want      Have
#     --------------------- ---- ---------
#     ExtUtils::MakeMaker    any   7.10_02
#     File::Spec             any   3.63_01
#     HTTP::Response         any      6.11
#     HTTP::Status           any      6.11
#     IO::Compress::Gzip     any 2.069_001
#     MaxMind::DB::Metadata  any  0.040001
#     Path::Class            any      0.37
#     Test::Builder          any  1.302164
#     Test::Fatal            any     0.014
#     Test::More            0.96  1.302164
#     Test::Number::Delta    any      1.06
#     base                   any      2.23
#     utf8                   any      1.19
#
# === Test Recommends ===
#
#     Module         Want     Have
#     ---------- -------- --------
#     CPAN::Meta 2.120900 2.150005
#
# === Runtime Requires ===
#
#     Module                   Want     Have
#     -------------------- -------- --------
#     B                         any     1.62
#     Data::Dumper              any    2.160
#     Data::Validate::IP       0.25     0.27
#     Exporter                  any     5.72
#     Getopt::Long              any     2.48
#     HTTP::Headers             any     6.11
#     HTTP::Request             any     6.11
#     JSON::MaybeXS             any 1.004000
#     LWP::Protocol::https      any  missing
#     LWP::UserAgent            any     6.39
#     List::SomeUtils           any     0.56
#     List::Util                any     1.50
#     MIME::Base64              any     3.15
#     MaxMind::DB::Reader  1.000000 1.000013
#     Moo                       any 2.003004
#     Moo::Role                 any 2.003004
#     Params::Validate          any     1.29
#     Scalar::Util              any     1.50
#     Sub::Quote                any 2.006003
#     Throwable::Error          any 0.200013
#     Try::Tiny                 any     0.30
#     URI                       any     1.71
#     lib                       any     0.63
#     namespace::clean          any     0.27
#     strict                    any     1.11
#     warnings                  any     1.36
#
#
# *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***
#
# The following REQUIRED prerequisites were not satisfied:
#
# LWP::Protocol::https is not installed (any version required)
#
t/00-report-prereqs.t ....................... ok
t/GeoIP2/Database/Reader-Anonymous-IP.t ..... ok
t/GeoIP2/Database/Reader-ASN.t .............. ok
t/GeoIP2/Database/Reader-Connection-Type.t .. ok
t/GeoIP2/Database/Reader-Domain.t ........... ok
t/GeoIP2/Database/Reader-Enterprise.t ....... ok
t/GeoIP2/Database/Reader-ISP.t .............. ok
t/GeoIP2/Database/Reader.t .................. ok
t/GeoIP2/Error/Type.t ....................... ok
t/GeoIP2/Model/City.t ....................... ok
t/GeoIP2/Model/Country.t .................... ok
t/GeoIP2/Model/Insights.t ................... ok
t/GeoIP2/Model/names.t ...................... ok
t/GeoIP2/Types.t ............................ ok
t/GeoIP2/WebService/Client.t ................ Can't locate LWP/Protocol/https.pm in @INC (you may need to install the LWP::Protocol::https module) (@INC contains: /root/.cpan/build/GeoIP2-2.006001-uQZ9WO/blib/lib /root/.cpan/build/GeoIP2-2.006001-uQZ9WO/blib/arch /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /root/.cpan/build/GeoIP2-2.006001-uQZ9WO/blib/lib/GeoIP2/WebService/Client.pm line 26.
BEGIN failed--compilation aborted at /root/.cpan/build/GeoIP2-2.006001-uQZ9WO/blib/lib/GeoIP2/WebService/Client.pm line 26.
Compilation failed in require at t/GeoIP2/WebService/Client.t line 7.
BEGIN failed--compilation aborted at t/GeoIP2/WebService/Client.t line 7.
t/GeoIP2/WebService/Client.t ................ Dubious, test returned 2 (wstat 512, 0x200)
No subtests run

Test Summary Report
-------------------
t/GeoIP2/WebService/Client.t              (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=15, Tests=484,  4 wallclock secs ( 0.08 usr  0.01 sys +  3.17 cusr  0.22 csys =  3.48 CPU)
Result: FAIL
Failed 1/15 test programs. 0/484 subtests failed.
Makefile:1090: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 2
  MAXMIND/GeoIP2-2.006001.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MAXMIND/GeoIP2-2.006001.tar.gz
Failed during this command:
 MAXMIND/GeoIP2-2.006001.tar.gz               : make_test NO

cpan[4]>

Last edited by mariozankl; 05-23-2019 at 09:26.
mariozankl 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 07:50.


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