PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Alexandros on 07 March, 2004, 01:23:02

Title: 10 secs Deny Search
Post by: Alexandros on 07 March, 2004, 01:23:02
is there any way to deny the search of files to the users that enter my hub...the idea is to use less bandwith used by bots that enters, do a couple of searchs and go away.

sorry about my english
Thanks

Alex
Title:
Post by: Skrollster on 07 March, 2004, 01:36:46
think this should be enought..

haven't tested it as usual..

function Main()
tUsersEntered = {}
sec = 1000
end

function OpConnected(tUser)
tUsersEntered[tUser.sName] = clock()
end

function OpDisconnected(tUser)
tUsersEntered[tUser.sName] = nil
end

function NewUserConnected(tUser)
tUsersEntered[tUser.sName] = clock()
end

function UserDisconnected(tUser)
tUsersEntered[tUser.sName] = nil
end

function DataArrival(tUser, sData)
if (strsub(sData, 1, 7) == "$Search" ) then
if ( (clock() - tUsersEntered[tUser.sName]) < (10 * sec) ) then
return 1
else
return 0
end
end
end
Title:
Post by: Alexandros on 07 March, 2004, 01:49:38
That was fast...i will test it later....and why ptokax send this?
Puerto Digital (200.43.126.131)> User removed: zSearch[moglo]
Puerto Digital (200.43.126.131)> User removed: kook

(DC++ debug) if it never send a User Added..

Thanks again

Alex
Title:
Post by: Skrollster on 07 March, 2004, 01:51:45
don't know.. guess you are using td4.. if so, I can tell you that it has been fixed in the new betas...
Title:
Post by: Alexandros on 07 March, 2004, 01:56:46
QuoteOriginally posted by Skrollster
guess you are using td4
Yes, thanks..i will wait for a new version then