PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: CHILLCODE? on 17 December, 2006, 00:51:44

Title: GeoIP Lite City 0.3
Post by: CHILLCODE? on 17 December, 2006, 00:51:44

--[[
CHILLCODE? production

GEOIP LITE "CITY"
A Lite Version of GeoIP since, less functions, but with the Cities Database.
Not storing the values in a table makes the bot a bit slower, but less memoryusing.

"DO NOT COMPILE"

INSTALL:
   Download GeoLiteCity Zip from
http://www.maxmind.com/download/geoip/database/GeoLiteCity_CSV/
   Extract to:
scripts/GeoIPLite/
   Run script
be patient at first start, script needs to build its database, plus there will be an error at first startup, just restart

CHANGELOG:
-----------------------
V 0.2  -  17/12/2006:
Made Latitude, Longitude Google Earth Conform
Fixed: Error with users not in Profilelist (thx Lightgirl_XP)

V 0.1  -  16/12/2006:
Started

-----------------------

Benchmark: (maxmind: http://www.maxmind.com/app/benchmark )

GeoIP Database Cache # of Queries Time to Process (s) Queries/Second

MAXMIND:
  C API GeoIP City None 60,000 2.701370 22,211
  Java API GeoIP City None 1,500 0.263 5,703
  Pure PHP API GeoIP City None 10,000 16.13904 619

GeoIPLite:
  LUA API GeoIP City None 60,000 43.657 1,374

IP-Bot (by Chill)
  LUA API GeoIP Country Yes 100,000 4.62500 21,621

We would be much faster if using a memory based method, but that would need around 70MB, if not more.
At least we beat the PHP API.

]]--
Title: Re: GeoIP Lite City 0.2
Post by: nEgativE on 17 December, 2006, 22:35:08
Great Work there :)
Thx for this excelent script
Title: Re: GeoIP Lite City 0.3
Post by: CHILLCODE? on 18 December, 2006, 12:03:56
ths [PT]negative much appreciated

new verison is out, also with brasilian portuguese language ;) and german


CHILLCODE? production

GEOIP LITE "CITY"
A Lite Version of GeoIP since, less functions, but with the Cities Database.
Not storing the values in a table makes the bot a bit slower, but less memoryusing.

"DO NOT COMPILE"

INSTALL (Do a clean install, remove all old files first):
   Download GeoLiteCity Zip from
http://www.maxmind.com/download/geoip/database/GeoLiteCity_CSV/
   Extract to:
scripts/GeoIPLite/
   Run script
be patient at first start, script needs to build its database,
plus there will/can be an error at first startup, don't bother
please restart the script once after building the database

CHANGELOG:
-----------------------
V 0.3 -   18/12/2006:
Added Brazilian Portuguese Language File (thx to 7P-Darkman)
Added Language File (English)
Added Language File (Deutsch)
Added Table with own IP's to check before checking GeoIPCityDatabase ( GLite.MyRanges )
Title: Re: GeoIP Lite City 0.3
Post by: bastya_elvtars on 18 December, 2006, 12:24:33
Hmm, don't you want to upload to the repository instead of attaching?
Title: Re: GeoIP Lite City 0.3
Post by: CHILLCODE? on 18 December, 2006, 16:07:58
where is that?
Title: Re: GeoIP Lite City 0.3
Post by: bastya_elvtars on 18 December, 2006, 21:24:58
Quote from: CHILLCODE? on 18 December, 2006, 16:07:58
where is that?

OK, now you will see it after a relogin, in the left menu (Tools).
Title: Re: GeoIP Lite City 0.3
Post by: CHILLCODE? on 19 December, 2006, 00:23:28
thx  :D working good
http://forum.ptokax.org/index.php?action=tpmod;dl=item19 (http://forum.ptokax.org/index.php?action=tpmod;dl=item19)
Title: Re: GeoIP Lite City 0.3
Post by: TrIp-iN-SuN on 02 January, 2007, 21:59:05
tell me same thing all users can to in the hub it's not blocken for same ip?
Title: Re: GeoIP Lite City 0.3
Post by: elgee on 03 January, 2007, 02:13:11
hum, I have actully no idea what you just said or asked rather.

But I do guess it has with access to IP on the users.
First of all, an p2p as DC will never "hide" your IP for others. It's needed for the transfer between you and the other client. So no mather what you set the settings to IP can still be revealed.


If you cared to download and read the script you would have seen there is settings for who has access where.

and
Thanks CHILLCODE? for a light script that runs without problem, and gives me a hint more or less where the person is without to much effort from me, I am lazy ;)
Title: Re: GeoIP Lite City 0.3
Post by: CHILLCODE? on 03 January, 2007, 11:11:52
Quote from: TrIp-iN-SuN on 02 January, 2007, 21:59:05
tell me same thing all users can to in the hub it's not blocken for same ip?
I interpreted it this way, you want to know if users with the same IP can access the Hub, yes they can and it's not that this script should do anything about it nor would it be usefull, although more people connecting from one LAN are not so common, this script should only find out to which country the ip belongs, light and simple :)

And elgee your welcome  ;D
Title: Re: GeoIP Lite City 0.3
Post by: TrIp-iN-SuN on 03 January, 2007, 17:12:11
ok tnx :P
Title: Re: GeoIP Lite City 0.3
Post by: TrIp-iN-SuN on 03 January, 2007, 21:42:19
tell me y when i try to check same ip to see from where him i can't i see this alwyas
   IP: 87.68.148.27
   From: N/A ( N/A ), N/A ( N/A N/A )

   IP: 86.80.204.137
   From: N/A ( N/A ), N/A ( N/A N/A )

   IP: 89.210.78.106
   From: N/A ( N/A ), N/A ( N/A N/A )

   IP: 87.242.40.158
   From: N/A ( N/A ), N/A ( N/A N/A )

every thing his not find lol and take 115 mb that script is big



Title: Re: GeoIP Lite City 0.3
Post by: TrIp-iN-SuN on 07 January, 2007, 00:39:19
CHILLCODE? u can tell me y it's not work?
Title: Re: GeoIP Lite City 0.3
Post by: CHILLCODE? on 07 January, 2007, 14:58:24
Okey I tried the IP's and they do work here, I changed somethings in the script by now,
but I checked with an elder version it also worked so, I am sorry to tell you that I have no clue
why it shouldn't work if set up correct.

but to reduce your diskspace you can delete all *.cvs files after the *.dat files were created.

maybe you should just delete everything again and try to set it up newly, if that doesn't help then
well maybe the script doesn't like you ;)
Title: Re: GeoIP Lite City 0.3
Post by: TrIp-iN-SuN on 07 January, 2007, 22:28:52
i thing that script not like me nathing is not work heheh
Title: Re: GeoIP Lite City 0.3
Post by: nEgativE on 01 February, 2007, 20:18:34
Hey CHILLCODE?, to update the GeoIP files, in first place.. should i delete the database files right ? put the new GeoIP and run the script after.. i guess.

Thx in advance, great work again.
Title: Re: GeoIP Lite City 0.3
Post by: CHILLCODE? on 03 February, 2007, 18:54:14
Quote from: nEgativE on 01 February, 2007, 20:18:34
Hey CHILLCODE?, to update the GeoIP files, in first place.. should i delete the database files right ? put the new GeoIP and run the script after.. i guess.

Thx in advance, great work again.

THX :), and right you are, I'll try to make it a bit clearer in the next version.
Title: Re: GeoIP Lite City 0.3
Post by: 7P-Darkman on 21 February, 2007, 06:05:34
Hello friends...


It is possible to restrict the access to the commands, based in profile of user?  For example, it would not like that users not-registered had access to the commands of this script.

Respectfully,


7P-Darkman
Title: Re: GeoIP Lite City 0.3
Post by: CHILLCODE? on 23 February, 2007, 17:41:24
yes is possible in a way,

Code (lua) Select

GLite.Cmd = {
-- level 0
Help = { GLite.Msg.help, 0 },
MyCountry = { GLite.Msg.mycountry, 0 },
TopCountries = { GLite.Msg.topcountries, 0 },
TopCities = { GLite.Msg.topcities, 0 },
-- level 1
GetCountrybyName = { GLite.Msg.getcountrybyname, 1 },
GetCountrybyIP = { GLite.Msg.getcountrybyip, 1 },
}

if you change this to
Code (lua) Select

GLite.Cmd = {
-- level 0
Help = { GLite.Msg.help, 1 },
MyCountry = { GLite.Msg.mycountry, 1 },
TopCountries = { GLite.Msg.topcountries, 1 },
TopCities = { GLite.Msg.topcities, 1 },
-- level 1
GetCountrybyName = { GLite.Msg.getcountrybyname, 1 },
GetCountrybyIP = { GLite.Msg.getcountrybyip, 1 },
}

it should work, but I am thinking in changin it to a more versatile way.. what would you think of
Code (lua) Select

GLite.Cmd = {
Help = { GLite.Msg.help, { [0]=1, [1]=1, [-1]=1, ... } }
}

where, in [ ] is the Profile, allowed to use the command ..., does this make it more clear?
greets


Title: Re: GeoIP Lite City 0.3
Post by: elgee on 23 February, 2007, 20:05:11
Quote from: CHILLCODE? on 23 February, 2007, 17:41:24
it should work, but I am thinking in changin it to a more versatile way.. what would you think of
Code (lua) Select

GLite.Cmd = {
Help = { GLite.Msg.help, { [0]=1, [1]=1, [-1]=1, ... } }
}

where, in [ ] is the Profile, allowed to use the command ..., does this make it more clear?
greets

You did not ask me, but I prefear the last version  8)
Title: Re: GeoIP Lite City 0.3
Post by: 7P-Darkman on 24 February, 2007, 16:22:57
Hello CHILLCODE?...


Works very fine now... many thanks !

Respectfully,


7P-Darkman