--- sbbs/src/sbbs3/bat_xfer.cpp 2018/04/24 16:41:23 1.1 +++ sbbs/src/sbbs3/bat_xfer.cpp 2018/04/24 16:43:08 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet batch file transfer functions */ -/* $Id: bat_xfer.cpp,v 1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: bat_xfer.cpp,v 1.1.1.2 2018/04/24 16:43:08 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -101,7 +101,7 @@ void sbbs_t::batchmenu() break; } for(i=0,totalcdt=0;iuseron.cdt+useron.freecdt) { bprintf(text[YouOnlyHaveNCredits] @@ -122,16 +122,17 @@ void sbbs_t::batchmenu() mnemonics(text[ProtocolOrQuit]); strcpy(tmp2,"Q"); for(i=0;ibicmd[0] && chk_ar(cfg.prot[i]->ar,&useron)) { + if(cfg.prot[i]->bicmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) { sprintf(tmp,"%c",cfg.prot[i]->mnemonic); - strcat(tmp2,tmp); } + strcat(tmp2,tmp); + } ungetkey(useron.prot); ch=(char)getkeys(tmp2,0); if(ch=='Q') break; for(i=0;ibicmd[0] && cfg.prot[i]->mnemonic==ch - && chk_ar(cfg.prot[i]->ar,&useron)) + && chk_ar(cfg.prot[i]->ar,&useron,&client)) break; if(imisc&PROT_NATIVE) ? true:false)) @@ -174,7 +175,8 @@ void sbbs_t::batchmenu() if(cfg.dir[batdn_dir[i]]->seqdev) { unpadfname(batdn_name[i],tmp); sprintf(tmp2,"%s%s",cfg.temp_dir,tmp); - remove(tmp2); } + remove(tmp2); + } batch_upload(); batch_download(xfrprot); if(batdn_total) /* files still in queue, not xfered */ @@ -184,19 +186,20 @@ void sbbs_t::batchmenu() break; case 'C': if(batup_total) { - if(!noyes(text[ClearUploadQueueQ])) { + if(text[ClearUploadQueueQ][0]==0 || !noyes(text[ClearUploadQueueQ])) { batup_total=0; bputs(text[UploadQueueCleared]); } } if(batdn_total) { - if(!noyes(text[ClearDownloadQueueQ])) { + if(text[ClearDownloadQueueQ][0]==0 || !noyes(text[ClearDownloadQueueQ])) { for(i=0;ibatulcmd[0] && chk_ar(cfg.prot[i]->ar,&useron)) { + if(cfg.prot[i]->batulcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) { sprintf(tmp,"%c",cfg.prot[i]->mnemonic); strcat(str,tmp); } @@ -297,7 +304,7 @@ void sbbs_t::batchmenu() break; for(i=0;ibatulcmd[0] && cfg.prot[i]->mnemonic==ch - && chk_ar(cfg.prot[i]->ar,&useron)) + && chk_ar(cfg.prot[i]->ar,&useron,&client)) break; if(iuseron.cdt+useron.freecdt) { bprintf(text[YouOnlyHaveNCredits] @@ -376,7 +383,7 @@ BOOL sbbs_t::start_batch_download() mnemonics(text[ProtocolOrQuit]); strcpy(str,"Q"); for(i=0;ibatdlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron)) { + if(cfg.prot[i]->batdlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) { sprintf(tmp,"%c",cfg.prot[i]->mnemonic); strcat(str,tmp); } @@ -386,7 +393,7 @@ BOOL sbbs_t::start_batch_download() return(FALSE); for(i=0;ibatdlcmd[0] && cfg.prot[i]->mnemonic==ch - && chk_ar(cfg.prot[i]->ar,&useron)) + && chk_ar(cfg.prot[i]->ar,&useron,&client)) break; if(i>=cfg.total_prots) return(FALSE); /* no protocol selected */ @@ -443,7 +450,7 @@ BOOL sbbs_t::start_batch_download() for(j=0;jext,batdn_name[i]+9)) continue; - if(!chk_ar(cfg.dlevent[j]->ar,&useron)) + if(!chk_ar(cfg.dlevent[j]->ar,&useron,&client)) continue; bputs(cfg.dlevent[j]->workstr); external(cmdstr(cfg.dlevent[j]->cmd,path,nulstr,NULL),EX_OUTL); @@ -783,7 +790,7 @@ bool sbbs_t::addtobatdl(file_t* f) } if(f->size<=0 /* !fexist(str) */) { bprintf(text[CantAddToQueue],f->name); - bputs(text[FileIsNotOnline]); + bprintf(text[FileIsNotOnline],f->name); return(false); } if(batdn_total>=cfg.max_batdn) { @@ -792,17 +799,17 @@ bool sbbs_t::addtobatdl(file_t* f) return(false); } for(i=0,totalcdt=0;idir]->misc&DIR_FREE) f->cdt=0L; - if(!is_download_free(&cfg,f->dir,&useron)) + if(!is_download_free(&cfg,f->dir,&useron,&client)) totalcdt+=f->cdt; if(totalcdt>useron.cdt+useron.freecdt) { bprintf(text[CantAddToQueue],f->name); bprintf(text[YouOnlyHaveNCredits],ultoac(useron.cdt+useron.freecdt,tmp)); return(false); } - if(!chk_ar(cfg.dir[f->dir]->dl_ar,&useron)) { + if(!chk_ar(cfg.dir[f->dir]->dl_ar,&useron,&client)) { bprintf(text[CantAddToQueue],f->name); bputs(text[CantDownloadFromDir]); return(false);