View Single Post
Author Message
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 03-16-2019 , 05:28   Assistance with ip/geocity
Reply With Quote #1

Hi Guys,

I'm using the Connect Announce (cannounce) plugin here https://forums.alliedmods.net/showthread.php?t=77306

From what I can see (I'm new to sourcemod coding) it uses geoipcity and geoip. It also utililses the function below, which I believe is the main part.

I've also attached the full code here https://pastebin.com/6DePkiuL

For at least one person in my server, it shows they're from UK but is actually in Australia. They're not using a VPN. Any help would be appreciated!

PHP Code:
bool:IsLanIPString:src[16] )
{
    
decl String:ip4[4][4];
    new 
ipnum;

    if(
ExplodeString(src"."ip444) == 4)
    {
        
ipnum StringToInt(ip4[0])*65536 StringToInt(ip4[1])*256 StringToInt(ip4[2]);
        
        if((
ipnum >= 655360 && ipnum 655360+65535) || (ipnum >= 11276288 && ipnum 11276288+4095) || (ipnum >= 12625920 && ipnum 12625920+255))
        {
            return 
true;
        }
    }

    return 
false;

__________________
ozrich is offline