alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
975 stars 422 forks source link

native GeoipCity gives an empty string #2030

Closed Electr0 closed 1 year ago

Electr0 commented 1 year ago

Environment

Description

Problematic Code (or Steps to Reproduce)

include

include

public void OnPluginStart() { char sIP[16], sCity[46], sCcode[3];

strcopy(sIP, sizeof(sIP), "24.168.85.81");

GeoipCode2(sIP, sCcode);
GeoipCity(sIP, sCity, sizeof(sCity));

LogError("sIP: %s, sCcode %s, sCity %s", sIP, sCcode, sCity);

}

Logs

L 07/28/2023 - 21:55:18: [geo2_test.smx] sIP: 24.168.85.81, sCcode US, sCity

this was should return New York

Electr0 commented 1 year ago

with same GeoLite2-City.mmdb from GeoIP Resolver https://forums.alliedmods.net/showthread.php?t=267805 correct details for this ip (should be New York)

i was tested with multiple ip's and get same results sCity is empty.

Electr0 commented 1 year ago

found reason, in sourcemod logs found: [GEOIP] GeoIP2 database loaded: GeoLite2-Country (2023-07-26 20:00:06 UTC)

in folder addons/sourcemod/configs/geoip: GeoLite2-Country.mmdb GeoLite2-City.mmdb

after remove GeoLite2-Country.mmdb it work fine.