GeoIP for Lua5 - Page 2
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

GeoIP for Lua5

Started by VidFamne, 08 March, 2005, 21:15:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PPK

I try to add script order change to PtokaX, this feature is already in my TODO  ;)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

UwV

#26
i tryed manual order didn't change anything .. :rolleyes:
Quote(even after commenting the return 1 in PPK's and changing it from aaa.lua to zzz.lua rebooting etc. etc.)
and hmm i guess the second option aint that bad ..
should be no too hard .. (to fit the anti no hash in the geo) ..

but like when i reload a script it also isn't really in the same dataflow order as in the list.. (only if i reload all) so manually reloading just one of the two after a full reload should then fix it and it doesn't..
also i noticed the dataflow is from z to a when the  list is a to z .. right ?
little confusing .. but has been like this since 15.xx already
.. ;0)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

nEgativE

#27
Hi there, i'm having the same problem, i think.. :(
Users disconnected by other scripts, are still being logged as being Online by GeoIP.. what could be the problem ?...

Dag

Hi there, can anyone help me pls?
I need to know if it's possible to write more than one country into Allow by Country Code?

ConejoDelMal

Is it possible that you release the source of the IpTables? cause i would need to update few ranges..
Rede-DC Comunidade Portuguesa de DC

VidFamne

#30
As I haven't been able to solve the issue with the
NewUserConnected function, I've removed some functions in the script.
Added  allowed CountryCode table, so now it's possibel to add several Countrys.
Updated the IP-range table, it now contains 73160 IP-ranges.
About the IP-ranges, they can be obtain by the MaxMind website.
The script;  

Psycho_Chihuahua

Vid i think something went wrong ^^ on your ftp i cant see anything  :(  and if i click on your link here i get a Site not available or something like that ....
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

VidFamne

#32
Yeah, I know. Have struggled here, to get the ftp server
working behind my router. I see only 3 managed to download. But I am doing my best to fix it.  :))

Psycho_Chihuahua

#33
Oh, well good Luck then  :D  Otherwise i could have put it Online on my webspace as well and post the link here

**Edit
For all those who have trouble getting it from Vid's FTP here's a HTTP Link (didn't work with IE so i used my FTP Client ^^ )

GeoIP5.01px
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

VidFamne

Thanks, Psycho_Chihuahua.  :))

Psycho_Chihuahua

No Problem Vid ^^

I translated it to German as well

German GeoIP   :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

yoonohoo

When using GeoIP and Guarding together the rigth click from Guarding disappears and GeoIP takes over.

More weird, this happens with all clients I've tried except DCDM 0.45.

If I understood Zigurds he/she has a similar problem.

How can I solve this?

Thanks

It might be simple for you but rocket science for me...

yoonohoo

Having problems with commands disappearing when using several scripts?

Before you change the scripts try the following:

Move the scripts around in the ptokax script editor and try having your security script in last (bottom)

It worked for me!

Thanks for nothing
Newbie

It might be simple for you but rocket science for me...

VidFamne

Please remove $UserCommand 255 7|
in the NewCon function  in ../Files/Func/fFunc.lua
I've placed this UserCommand there because I dont want multiple duplicates, of commands,
when I reconnects to the hub.

Mogli

#39
Hey VidFamne, I took your script and recoded it,
it is now 10 times faster uses 6 times more
memory per IPLookUp,

and you can update the GeoIP CVS file yourself.

GeoIP-0.2


P.S. When I did the testing, I noticed that
your script returns an error on certain IP's
that happens when instead of an GeoIPRangeFile
only "" is returned in function tSearch.
This might help
tSearchCountry = function(num)
    tGeoIpRange = {}
    local tGeoIpRangefile = f.tSearch(num)
    if tGeoIpRangefile ~= "" then
	dofile(tGeoIpRangefile)
    end
    local C = ""
    local CC = ""
    local low=1
    local mid = 0
    local high=table.getn(tGeoIpRange)

    while low <= high  do
        mid = math.floor((low+high)/2)
            if  tGeoIpRange[mid][1] <= num and num <= tGeoIpRange[mid][2]  then
                C = tGeoIpRange[mid][4]
                CC = tGeoIpRange[mid][3]
            break end
                if tGeoIpRange[mid][1] > num then
                high = mid-1
                else low = mid+1
                end
    end
    tGeoIpRange = nil
    collectgarbage()
    return C,CC
end,

VidFamne

Sweet  :))
Nice coding Mogli - Chill

Mogli

thx :),
I like the readout from the CVS file,
I think there is no computer language that makes IO
so simple as LUA

the_pest

I like this script, but... in hub was 275 users online and script says that i have 325 user from my country in tha hub (i had about 50 users of my kind) :)  Scripts restart help but i can't do it every day... :(
use

Mogli

#43
Yup you are right,
I think it happens when, the UserDisconnect is not
passed to the Scripts for some reason,

download here GeoIP-0.4

Mogli

okey I think I found the bugger,

I used this script

inum = 0

function NewUserConnected( user )
	inum = inum + 1
	if inum == 2 then
		inum = 0
		SendToAll( "Force Disconnect T1" )
		user:Disconnect()
	end
end

and this

function NewUserConnected()

	SendToAll( "connected T2" )
end

function UserDisconnected()

	SendToAll( "disconnected T2" )
end

now I connected with a client

these where the reults
[18:39] connected T2
[18:39] disconnected T2
[18:39] Force Disconnect T1
[18:39] connected T2

so I think Ptokax is going wrong here,
when a other script disconnects a user during NewUserConnected()
at least, the second script won't notice.
Damn and now I rescripted the script, hmm...
and thing is with that bug, the new method will go wrong too

PPK

QuoteOriginally posted by Mogli
so I think Ptokax is going wrong here,
when a other script disconnects a user during NewUserConnected()
at least, the second script won't notice.
In PtokaX is everything ok, if user is disconnected in NewUserConnected then is not added to hub and not fire UserDiscronnected -> UserDisconnected for this user only slow hub without any good reason.
Is easy to fix, geoip script must run last, and any script before with NewUserConnected must return 1 if disconnect user ;)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

the_pest

QuoteOriginally posted by PPK
Is easy to fix, geoip script must run last, and any script before with NewUserConnected must return 1 if disconnect user ;)
unfortunately not. my GeoIP is last and every disconnectig, kicking or baning script listed before has return 1 :(
use

Mogli

Same here I changed the test script to return 1 on
force disconnect but nothing, also there is no note
about that in the scripting interface, saying return one
on userconnected will stop the hub from processing.

Mogli

New Version,
added 2 requests and optimised the OnlineUser
for the New Ptokax Release,
The Script should run as last script, or
after the last script that may disconnect a user
during NewUserConnected(), but as last
you are safe
Check the ChageLog in the script, for more info :)

GeoIP-0.5

Psycho_Chihuahua

[13:42] ...\0.3.3.1d.nt.dbg\scripts\GeoIP-0.5.lua:684: bad argument #1 to `open' (string expected, got nil)

running as only script on 0.3.3.1d Debug

First at hubstart the csv readout starts, then CPU Activity goes up to 100% and the hub does not react for approx 1 minute after that this error
running on windows 2003 with Sempron 3000+ and 1gig ram
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

SMF spam blocked by CleanTalk