I've never worked with any C language, so I don't know how to build modules for LU, so I decided to take another route to getting a country name from an IP address. Currently, I am using a custom PHP socket server that listens on a certain port for incoming connections and data from already established connections.
As of now, the socket listens for something like "GEOIP 127.0.0.1". This server will send the name of the country back to the socket, which could be used to display a user's country on player join or something.
Anybody who is interested in using this, feel free. I am making this service public for all, so you can translate an IP to a country name in your script.
Here is a Squirrel snippet to help (if you need it):
function GeoIPProcess(socket,data)
{
LAST_COUNTRY <- data;
}
function onScriptLoad()
{
GeoIPSocket <- NewSocket("GeoIPProcess");
GeoIPSocket.Connect( "206.217.206.245", 2302 );
LAST_COUNTRY <- "";
}
function onPlayerConnect(player)
{
GeoIPSocket.Send("GEOIP " + player.IP);
}
function onPlayerJoin(player)
{
Message(player.Name + " has joined the server from " + LAST_COUNTRY,Colour(255,255,255));
}