PDA

View Full Version : [REQ] Race vs leecherkicking script... ;)


rAWfOX
01-05-2004, 01:07 PM
What ive heard is that it aint possible to make souch script... script that will kick all leechers out from a site when a race is started and let them in when the race is done..


But is there any scripter who is willing to do some sort of Race script that atleas kicks the racer out and .. well some kind of smart way :).... brainstorm here please :D

JoeDirt
01-05-2004, 01:42 PM
Originally posted by rAWfOX
....some sort of Race script that atleas kicks the racer out and ...
Kick the racer out?
You sure this is what you want? :banana:

rAWfOX
01-05-2004, 01:43 PM
lol... ment the leecher :D kick the leecher out :D

Mouton
01-05-2004, 02:52 PM
How do u suggest the script could detect the start and the end of a race ?

Kicking leechers is easy.
Keeping ppl from leeching is easy.

Only thing that isn't is detecting start and end events to apply those restrictions.
A site command would be easy for script, but a pain for siteops.

SomeoneWhoCares_2
01-05-2004, 03:02 PM
it could check for the incomplete symlink = race start
and when its gone = race end
:eek:

tuff
01-05-2004, 05:06 PM
and if the release is incomplete for 3 days?

SomeoneWhoCares_2
01-05-2004, 07:11 PM
Originally posted by tuff
and if the release is incomplete for 3 days?

of course the script will have a max incomplete time option ;)

or if there was an autonuke script :confused:

FTPServerTools
01-06-2004, 03:44 AM
I dont think that that is so hard. Using the following defenitions:
RACE=x or more users in the same dir and uploading
RACE COMPLETE=completion tag available
RACE PASSED=last file uploaded from race>y minutes ago or race dir created y minutes ago
KICK=immediate removal frmo the site

now loop in a who loop, so say once every 10 seconds in a timer loop. So since there is no timer available in the tcl script you would need an external program to start the thing OR you need to put it on the file download trigger (preferred solution if you use tcl).
Assuming you take the STOR pre command:
Find race occuring:

for all connections to io do
store user,connection,path,action in the who_list
for all connection(i) in the who_list
for all connection(j) in the who_list
if i!=j and action(i)==uploading and action(j)==uploading and path(i)==path(j) then {
race=TRUE;
racepath(i)=path(i);
}
next j
next i

if (race) then
store(race,now)
for all action(i) do
if action(i)!=uploading then kill connection(i) //simple kill all leechers or alternatively use sitekill transfer=down
next i
end if

Put on the post STOR command:
for all connections to io do
store user,connection,path,action in the who_list
race=false
for all connections to io do
if action(i)=uploading and completiontag(path(i)) then race=true
store(race,now)


Put on the RETR pre command to disallow RETR during a race.
fetch(race)
fetch(racestart)
if race and now-racestart>x minutes then return not allowed
race=false
store(race,now)


Alternatively as extra:
Put on the LOGIN pre command to disallow LOGIN during a race.
fetch(race)
fetch(racestart)
if race and now-racestart>x minutes then return not allowed
race=false
store(race,now)




Now simply convert this stuff to itcl or an external C program and you got your script.