JAFO10E.MOD - Free Download Directories JAFO #1 @18868 Sat Feb 13 1993 23:24:25 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Mod Name : JAFO10E.MOD Mod Author: JAFO 1@1 TerraNET ³ ³ Difficulty : ÛÛÛ±±±±±±± 1@8857 IceNET ³ ³ WWIV Version : 4.22 1@8861 WWIVnet ³ ³ Mod Date : 02/13/93 1@18868 WWIVLink ³ ³ Files Affected: DIREDIT.C, SR.C, UTILITY.C, XFER.C ³ ³ Description : Free Download Directories ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÍÍ[ Description ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ This mod will enable you to have Free Download Directories that work just like normal directories, except the users ratio is not checked, and their ratio is not affected by downloading files in these directories. Due to certain constraints, batch downloads will not be allowed in the Free Download Directories. Revision B Note: If you are using the original version of this mod, JAFO10, just take out the old mod and start completely over. You should also move the free files from the FREE directory to your new DLOADS\FREE directory if upgrading. Revision C Note: Previous versions would not allow you to batch download a file from another directory if you were currently located in a free directory. This has been fixed. Revision D Note: There was a bug that involved not being able to batch upload under certain conditions. This has been fixed. Revision E Note: Users couldn't batch download from the last directory. This has been fixed. ÍÍ[ Legend ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ = Existing line - Do not change + Add this line - Remove this line % Change this line ÍÍ[ Step 1 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Please back up your source code. Even the best programmers make mistakes. ÍÍ[ Step 2 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ In DIREDIT.C, add and change the following lines in "void modify_dir". = outstr(get_string(144)); = pl((r.mask & mask_archive) ? str_yes : str_no); + outstr("L. Free Dir : "); + pl((r.mask & mask_no_ratio) ? str_yes : str_no); = nl(); - prt(2,get_string(119)); + prt(2,"Which (A-L,Q) ? "); % ch=onek("QABCDEFGHIJKL"); = switch(ch) { ÍÍ[ Step 3 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Farther down in "void modify_dir", add the following lines. = case 'K': = r.mask &= ~mask_archive; = nl(); = prt(5,get_string(158)); = if (yn()) = r.mask |= mask_archive; = break; + case 'L': + r.mask &= ~mask_no_ratio; + nl(); + prt(5,"Free directory? "); + if (yn()) + r.mask |= mask_no_ratio; + break; = } = } while ((!done) && (!hangup)); = directories[n]=r; = } ÍÍ[ Step 4 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ In SR.C, add the following lines in "void send_file". = case 5: = ok=1; + if (directories[udir[curldir].subnum].mask & mask_no_ratio) { + nl(); + pl("You cannot batch download from this directory."); + nl(); + *sent=0; + *abort=0; + break; + } = if (numbatch>=MAX_BATCH) { = nl(); = pl(get_string(900)); ÍÍ[ Step 5 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ In UTILITY.C, add the following line to "void frequent_init". = void frequent_init(void) = /* This should be called after a user is logged off, and will initialize = * screen-access variables. = */ = { = in_fsed=0; = curlsub=-1; + curldir=-1; = ansiptr=0; = curatr=0x07; = outcom=0; ÍÍ[ Step 6 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ In XFER.C, add the following line to "void dliscan1". = numf=u.numbytes; = this_date = u.daten; = dir_dates[dn]=this_date; + curldir=udir[dn].subnum; = = sprintf(s,"%s%s.EXT",syscfg.datadir,directories[dn].filename); = edlf=open(s,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE); ÍÍ[ Step 7 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ In "int try_to_download", add the following lines. = ok=1; = foundany=1; = while ((i>0) && (ok) && (!hangup)) { + if (!(directories[dn].mask & mask_no_ratio)) { = if (!ratio_ok()) { = closedl(); = return(-1); = } + } = tleft(1); ÍÍ[ Step 8 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Still in "int try_to_download", add the following lines. = send_file(s1,&sent,&abort,u.filetype,u.filename,dn, u.numbytes); = if (sent) { + if (!(directories[dn].mask & mask_no_ratio)) { = ++thisuser.downloaded; = thisuser.dk += (int) ((u.numbytes+1023)/1024); + } = ++u.numdloads; = SETREC(i); ÍÍ[ Step 9 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Compile your source. ÍÍ[ Step 10 ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Load the board and do //DIREDIT. Insert a new sub and call it whatever you want. I suggest you use "Free Downloads". Make sure you turn the "Free Dir" selection to "On". Now put all the free files you want in there, and //UPLOAD them. That's it! ÍÍ[ Disclaimer ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Don't complain to me if your board gets fried, your hard disk goes nuts, or something terrible happens. The code in this mod should be harmless, but I can't guarantee it will work for you. It works on my board. JAFO 1@1 TerraNET 1@8857 IceNET 1@8861 WWIVnet 1@18868 WWIVLink