home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / PRE412.ZIP / HSTTIME.MOD < prev    next >
Text File  |  1990-04-27  |  4KB  |  141 lines

  1. Lord Elric #1 @8251
  2. Sat Apr 21 08:56:23 1990
  3. Elric 34, correct time estimation for DSZ transfers with locked baud rate
  4. modems.
  5.  
  6. You see, I got an HST, but the one thing I hated was once I locked the
  7. baud rate, the transfer estimation times for DSZ were horrid, since
  8. they were based on the locked baud rate. So, someone at 300 baud could
  9. download a 100K file, and DSZ would be saying "estimated time 1.0 minutes"
  10. and it just kind of annoyed me. If you add "estimate 0 br" to the line, where
  11. br is the baud rate, then it will estimate the time correctly. So, here is how
  12. to do that. I added a %4 to the calling params, with the modem speed. I
  13. had previously done this with the %1, but that precluded the use
  14. of some protocols which HAD to have the correct com speed passed out. So,
  15. with a little more playing around, I got it working.
  16.  
  17.  
  18.  
  19. /** this step is indeed a form step, much like a form letter **/
  20. 1. From DOS, in your dir where you keep your source....
  21.  
  22. PKZIP SOURCE *.c *.h
  23.  
  24. If you already have a source zip file, then
  25.  
  26. PKZIP -f source *.c *.h
  27.  
  28. This way you have a copy of everything before you screw it up with a bad mod.
  29. If you decide to take the mod out, it's as easy as
  30. PKUNZIP -x source
  31.  
  32. and hit Y to overwrite any files you changed.
  33.  
  34. /** we now resume our regularly scheduled mod with step 2.... **/
  35.  
  36.  
  37. 2. Load up SR.C. Look down for int extern_prot. First, add sx4[21] to the
  38. char variables. This is where we will store the modem speed. Next, search
  39. down for a line that looks like
  40.  
  41.   ultoa(com_speed,....).
  42.  
  43. Add the line
  44.  
  45.   ultoa(modem_speed,sx4,10);
  46.  
  47.  
  48.  
  49. Next, look down for a line that starts
  50.  
  51.   stuff_in(s,....)
  52.  
  53. Change that to look like this.
  54.  
  55.   stuff_in(s,s1,sx1,sx2,fn,sx4,"");   /** change me **/
  56.  
  57.  
  58. Now just re-compile. The code should look something like this when you
  59. are done.
  60.  
  61.  
  62.  
  63. int extern_prot(int pn, char *fn1, int sending)
  64. {
  65.   char s[81],s1[81],s2[81],fn[81],sx1[21],sx2[21],sx4[21]; /** mod **/
  66.   int i,i1;
  67.  
  68.   i=0;
  69.   for (i1=0; i1<81; i1++) {
  70.     i+=externs[pn].description[i1];
  71.     i+=externs[pn].sendfn[i1];
  72.     i+=externs[pn].receivefn[i1];
  73.   }
  74.   if (i!=checkext[pn]) {
  75.     nl();
  76.     pl("Protocol Corrupted; can't use anymore.");
  77.     nl();
  78.     return(-5);
  79.   }
  80.   if (sending) {
  81.     nl();
  82.     pl("> Beginning file transmission, ^X to abort");
  83.     strcpy(s1,(externs[pn].sendfn));
  84.   } else {
  85.     nl();
  86.     pl("> Ready to receive, ^X to abort.");
  87.     strcpy(s1,(externs[pn].receivefn));
  88.   }
  89.   strcpy(fn,fn1);
  90.   stripfn1(fn);
  91.   ultoa(com_speed,sx1,10);    /** mod **/
  92.   ultoa(modem_speed,sx4,10);  /** add me **/
  93.   sx2[0]='0'+syscfg.primaryport;
  94.   sx2[1]=0;
  95.   stuff_in(s,s1,sx1,sx2,fn,sx4,"");   /** change me **/
  96.   if (s[0]) {
  97.     set_protect(0);
  98.     outs("\r\n*> Current user: ");
  99.     outs(nam(&thisuser,usernum));
  100.  
  101.  
  102.  
  103.  
  104. Now you can use %4 to pass the actual modem speed to your protocols for
  105. estimation purposes. I had previously just changed %1, but that prevented
  106. me from using some other protocols, since they DID need the com speed.
  107. DSZ makes so much sense in the way it reads the com speed and assumes it
  108. isnt going to change.
  109.  
  110.  
  111. OK, some samples of how to use this...
  112.  
  113. Zmodem
  114. send:    DSZ port %2 ha on estimate 0 %4 sz -Zmk %3
  115. receive: DSZ port %2 ha on estimate 0 %4 rz -Zmk %3
  116.  
  117.  
  118.  
  119.  
  120. /** hey, it's the form info file **/
  121. As usual, I take no responsibility for hard drive crashes, death in the
  122. family, or end of the world as we know it resulting from this mod.
  123.  
  124. It's your fault if you didn't back up the files before you made the mod.
  125.  
  126. It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
  127. a month.
  128.  
  129. It works on my system with Turbo C 2.0, WWIV 4.1, V20/8088, 640K/640EMS.
  130.  
  131. If you use this, the only payment I ask is that you send me a note through
  132. WWIVLink to 1@18251 saying you are using it...not too much to ask is it?
  133.  
  134. The Kingdom of Melnibone(LINK/NET)
  135. 812-877-3488  24 Hrs a day
  136. 3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
  137. Auto-validation of WWIV sysops on first call
  138. Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
  139. WWIV Link  1@18251
  140.  
  141. WWIV Net   1@825