AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   HLstatsX:CE (https://forums.alliedmods.net/forumdisplay.php?f=156)
-   -   GeoIP2 in HLXCE (https://forums.alliedmods.net/showthread.php?t=314494)

abdulsami34 02-21-2019 20:25

GeoIP2 in HLXCE
 
The GeoLite Legacy has discontinued, Could anyone help me out with the new GeoLite2 and how to make it work with HLX

NomisCZ 02-22-2019 16:15

Re: GeoIP2 in HLXCE
 
Hello,
install GeoIP2 :: Database :: Reader (https://metacpan.org/pod/GeoIP2::Database::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

r3v 03-02-2019 03:55

Re: GeoIP2 in HLXCE
 
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. 


NomisCZ 03-02-2019 16:52

Re: GeoIP2 in HLXCE
 
Quote:

Originally Posted by r3v (Post 2641529)
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. 


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

r3v 03-10-2019 03:16

Re: GeoIP2 in HLXCE
 
Quote:

Originally Posted by NomisCZ (Post 2641641)
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?

nikooo777 03-10-2019 13:52

Re: GeoIP2 in HLXCE
 
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 '='


NomisCZ 03-26-2019 16:01

Re: GeoIP2 in HLXCE
 
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

nikooo777 04-19-2019 11:48

Re: GeoIP2 in HLXCE
 
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

NomisCZ 04-19-2019 14:24

Re: GeoIP2 in HLXCE
 
Quote:

Originally Posted by nikooo777 (Post 2648196)
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!

mariozankl 05-23-2019 07:55

Re: GeoIP2 in HLXCE
 
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::Database::Reader module NOT FOUND

I tryed to install GeoIP2::Database::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]>



All times are GMT -4. The time now is 12:57.

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