View Single Post
Old 04-15-2005, 09:48 AM  
mr_F_2
Senior Member
 
Join Date: Jan 2004
Posts: 203
Default

the best way to do this is check to see if a file exists in a given directory that is created after the race is complete. because the only way to tell if a race is over is to do the crc check, making that file should be a function of a zipscript. after that you just need a few lines of code to block users from downloading or allow it within that file,
something like (to be put on the retr event)

Code:
#define FILE_IDENTIFIER ".ioFTPD.race.over"

int
main(int argc, char **argv)
{
	char *physical_path;
	char *fpath;
	FILE *handle;

	physical_path = getenv("REALPATH");

	fpath = malloc(sizeof(char) * (strlen(physical_path) + strlen(FILE_IDENTIFIER) + 1));
	sprint(fpath,"%s\\%s",physical_path,FILE_IDENTIFIER);

	if (!(handle=fopen(fpath,"r")))  //check if file exists
			return 1;   //prevents download
	else
		fclose (handle); 
	return 0; //allows download
}
if your zipscript creates a unique file when the release is complete or if you know how to add that code (if it's TCL or you have the C code) i can compile the above ^^^ for you i just need that filename so that it actually works :P
mr_F_2 is offline   Reply With Quote