[Plugin] GeoIP Plugin v0.1.4 (Country detector) - 04/05/2008
#1

This is my first practical plugin.
Ah... I don't know what to say.
If you can't read this post (as English), I'm too foolish.

* Last Edit: 04/05/2008:
GeoIP*.dat were move to scriptfiles directory.
Added MAX_COUNTRY_NAME.
Changes arguments(Pawn function).
Pawn functions will return string or value.
Fixed bug in sample filterscript.
Updated GeoIP*.dat.

Native Functions:
Code:
// Two chars into country[]. JP, US, etc...
native GetCountryCode(const ipaddress[], country[], size = sizeof country);
// Three chars into country[]. JPN, USA, etc...
native GetCountryCode3(const ipaddress[], country[], size = sizeof country);
// Full name into country[]. Japan, United States, etc...
native GetCountryName(const ipaddress[], country[], size = sizeof country);
// etc.
Pawn Functions:
Code:
GetPlayerCountryName(playerid); // return country name.
GetPlayerGMT(playerid); // return GMT hour. maybe inaccurate.
// etc.
Please see GeoIP_Plugin.inc . I cant write well. Sorry.

Example:
Code:
#include <a_samp>
#include GeoIP_Plugin
...
public OnPlayerConnect(playerid)
{
	new name[MAX_PLAYER_NAME], country[MAX_COUNTRY_NAME], gmt;
	new string[256];

	GetPlayerName(playerid, name, sizeof(name));

	country = GetPlayerCountryName(playerid);
	gmt = GetPlayerGMT(playerid);

	format(string, sizeof(string), "[JOIN] %s (%s, GMT %d:00)", name, country, gmt);

	SendClientMessageToAll(0xFFCFCFAA, string);
	return 1;
}
Welcome review and complaints.
Maybe, I can read English. Maybe.

geoip_plugin-0.1.4.zip (Package)
geoip_plugin-src-0.1.4.zip (Source)
GeoIP_country_name_253.txt (Country name list from GeoIP.c)
Reply
#2

very nice!!

makes my GeoIP function pointless tho

but who cares as this is much better ^^
Reply
#3

This is awesome if it works

I can't test actually but will do and post comments

But i already have a suggestion (easily scriptable in Pawn but may be better directly coded in the plugin) :
pawn Code:
GetPlayerGMT(playerid);
Return the GMT time of the player (based on his location of course)

Also you should post a list of all detected countries

Last thing: what are functions *Code3 ?
Reply
#4

Nice work, But it's like the same as: http://gtasync.com/?p=13
Reply
#5

Quote:
Originally Posted by Killerkid.
Nice work, But it's like the same as: http://gtasync.com/?p=13
yeah but the gtasync one only gives the raw whois data. from the functions shown this one actually breaks it down into the output thats needed (country code etc.)

I made a pawn function based on the gtasync one, but i got bored trying to find out how to parse the data properly through pawn (its easily possible but just the time needed for all the different outputs of all the different whois providers.
Reply
#6

I will write reply later.
today, busy.
Sorry, my bad english.
Thanks for comments.
Reply
#7

The original author?
I checked MyMessages. but, no messages.
Is he MaxMind.com?
If this post have any problem, I want to delete this.
I'm sorry.
Reply
#8

The creator of the plugin and owner of GTASync is a fella by the name of TheSmoo (alias).

I tried to get him to allow permission to release this on the forums but he didn't budge. Even though you have put great work into this the original author of the plugin doesn't want it released here.
Reply
#9

(I'm unsure spelling)
I think my GeoIP Plugin is not related to GTASync's Plugin(is SNet, isn't it?).

his plugin:
Data source - WHOIS
Speed - depend network
Output - detailed host data(parse needed but good)

my plugin:
Data source - GeoIP
Speed - depend CPU
Output - country and a few things

By the way, his plugin source contain libGeoIP.
but libGeoIP is unused currently(#include only, not called).

and I don't use any his code.

So, Ah...well..., I think my plugin is not related to his plugin.
Maybe.

Still, Cannot I release here?
Should I Contact him?

Thanks in advance.
Reply
#10

Quote:
Originally Posted by Totto8492
<Links removed>

Note from Towlies: The original author of this plugin does not want it publically released on SA-MP forums (I asked him months ago). If you are able to recreate this without his original code your free to remake it. Sorry, its the original author of the plugin who doesn't want it released at least not here.
Quote:
Originally Posted by Alex
No, they were just saying it was similar. It's clearly not the same so there's no problem.
:/
Reply
#11

Quote:
Originally Posted by yom
This is awesome if it works

I can't test actually but will do and post comments

But i already have a suggestion (easily scriptable in Pawn but may be better directly coded in the plugin) :
pawn Code:
GetPlayerGMT(playerid);
Return the GMT time of the player (based on his location of course)

Also you should post a list of all detected countries

Last thing: what are functions *Code3 ?
Of course this works, i made something similar half a year ago.
Reply
#12

If I translate correctly, No problem...?
Well...I create link again.
Continuously, Welcome review and complaints.
If this has any problem, please remove again.
Reply
#13

OK, I read messages from Towlies.
Thanks for permission.
and, I'm looking forward to SA:MP 0.2.5.
Reply
#14

Very nice. Thanks!
Reply
#15

Belgium is GMT+1
I found something else wrong but I forgot

and thank you
Reply
#16

Hello,
How can i fix this:
Code:
Failed (/lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by plugins/GeoIP_Plugin.so))
?
Reply
#17

sounds good nice work!
Reply
#18

Quote:
Originally Posted by Killerkid.
Hello,
How can i fix this:
Code:
Failed (/lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by plugins/GeoIP_Plugin.so))
?
Sorry, I don't understand well about program on linux.
I think, You must compile from source (please run "make" command) .
Reply
#19

I think it is useless and able to made by scripts
Reply
#20

c++ is more fast and no need to use tones of CODES
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)