rww

  • VC:MP Beta Tester
  • LU-DM Team
  • Posts: 390
Re: GeoIP
« Reply #45,  »
Quote from =RK=MarineForce on July 20th, 2018, 10:56 AM
hey bro i can't install this properly. can u help me?


i have downloaded plugin geoip.dat in my server but didn't work don''t sending data into joining server when player join it will show message but not showing .

updated untested
Code: [Select]
    if (country == null) reutrn "unknow");
you have geoip.dat in main server folder?

and put it to onPlayerJoin/onPlayerPart, and check console after join to the server

Code: [Select]
print("Test geoip: "+geoip_country_name_by_addr(player.IP));

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 447
Re: GeoIP
« Reply #46,  »Last edited
https://ibb.co/fcZ68d

function onPlayerJoin( player )
{
print("Test geoip: "+geoip_country_name_by_addr(player.IP));
Stats[ player.ID ] = PlayerClass();
NewTimer( "CheckBan", 1000, 1, player.ID );
Message("[#00CC00]** [#ffffff]"+player.Name+" [#00cc00]Has Joined The Server");
stats[ player.ID ] = PlayerClass();
GetInfo(player);
}
Try to UnderStand ME!

rww

  • VC:MP Beta Tester
  • LU-DM Team
  • Posts: 390
Re: GeoIP
« Reply #47,  »
Quote from =RK=MarineForce on July 20th, 2018, 11:06 AM
https://ibb.co/fcZ68d

function onPlayerJoin( player )
{
print("Test geoip: "+geoip_country_name_by_addr(player.IP));
Stats[ player.ID ] = PlayerClass();
NewTimer( "CheckBan", 1000, 1, player.ID );
Message("[#00CC00]** [#ffffff]"+player.Name+" [#00cc00]Has Joined The Server");
stats[ player.ID ] = PlayerClass();
GetInfo(player);
}
Localhost IP (127.0.0.1) isn't exist on geoip.dat

Crys

  • Newbie
  • Posts: 13
Re: GeoIP
« Reply #48,  »
Quote from rww on July 20th, 2018, 11:48 AM
Quote from =RK=MarineForce on July 20th, 2018, 11:06 AM
https://ibb.co/fcZ68d

function onPlayerJoin( player )
{
print("Test geoip: "+geoip_country_name_by_addr(player.IP));
Stats[ player.ID ] = PlayerClass();
NewTimer( "CheckBan", 1000, 1, player.ID );
Message("[#00CC00]** [#ffffff]"+player.Name+" [#00cc00]Has Joined The Server");
stats[ player.ID ] = PlayerClass();
GetInfo(player);
}
Localhost IP (127.0.0.1) isn't exist on geoip.dat
Localhost won't work indeed - local IP addresses are not delegated to any entity, so they don't have a country by design. Try it with a remote client's IP address. It works for me:
Code: [Select]
[MODULE] Loaded GeoIP for 0.4 by Crys.
            >> Loaded GeoIP.dat (GeoIP Country Edition)
[SCRIPT] === GeoIP DEBUG ===
[SCRIPT] - Database info: GEO-106FREE 20180719 Build 1 Copyright (c) 2018 MaxMind Inc All Rights Reserved
[SCRIPT] - Number of countries: 256
[SCRIPT] - Library version: 1.6.12
[SCRIPT] - Character set: UTF-8
[SCRIPT] geoip_country_code_by_addr("78.24.185.47") = "HU"
[SCRIPT] geoip_country_code3_by_addr("78.24.185.47") = "HUN"
[SCRIPT] geoip_country_name_by_addr("78.24.185.47") = "Hungary"

This is the script that I'm using for debugging:
Code: [Select]
function onScriptLoad() {
    local testIP = "78.24.185.47";
    print("=== GeoIP DEBUG ===");
    print("- Database info: " + geoip_database_info());
    print("- Number of countries: " + geoip_num_countries());
    print("- Library version: " + geoip_lib_version());
    print("- Character set: " + (geoip_charset() == GEOIP_CHARSET_UTF8 ? "UTF-8" : "ISO-8859-1"));
    print("geoip_country_code_by_addr(\"" + testIP + "\") = \"" + geoip_country_code_by_addr(testIP) + "\"");
    print("geoip_country_code3_by_addr(\"" + testIP + "\") = \"" + geoip_country_code3_by_addr(testIP) + "\"");
    print("geoip_country_name_by_addr(\"" + testIP + "\") = \"" + geoip_country_name_by_addr(testIP) + "\"");
}

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 447
Re: GeoIP
« Reply #49,  »
thats why cool :D
Try to UnderStand ME!