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

  1. Welcome to Lord Elric's Mod #10.
  2.  
  3.                               THE 64 base mod.
  4.  
  5.  
  6. Before I get started, let me get the thanks out of the way...
  7.  
  8.  
  9.  
  10. Scott Lockwood, from the Spokane Hints, 1@5906, for sending me an incomplete
  11. 64 base mod.
  12.  
  13. The Angel of Death, The Game Palace, for writing the incomplete mod which got
  14. me started.
  15.  
  16. The Black Dragon, for writing a user list conversion program so I and others
  17. out there don't have to nuke our entire user list just to put this in.
  18.  
  19. Defender, aka Elihu Feustal, for harrassing me into running WWIV instead of
  20. RBBS (thank God for that one!)
  21.  
  22. Wayne Bell, for writing WWIV and giving source away for a mere $50.
  23.  
  24. Harb, a user of mine who helped to find the bugs...can't just test these
  25. things from the sysop account and expect it to work for everybody.
  26.  
  27.  
  28.  
  29. Ok, now that that's over with, let's get right into it. This mod was
  30. written and tested using Turbo C 2.0 and WWIV 4.1.  While it should work
  31. on earlier versions, I don't have them, I didn't test them, no guarantees.
  32.  
  33.  
  34.  
  35. Please, before you just plunge in, however, read over this and make sure you
  36. have everything you need. To get to the end and realize you haven't got
  37. convert.c or display.c would be a disaster.
  38.  
  39.  
  40.  
  41. Please, Please, Please, Please, Back up everything before you start
  42. changing it. If you are in doubt, back it up. A good place to start is
  43. just to back up the whole drive.
  44.  
  45. If not, at least back up all the .C files, all the .H files, the file USER.LST
  46. in your data dir, the file SUBS.DAT in your data dir, and CONFIG.DAT in your
  47. main BBS dir.
  48.  
  49. These files will be changed, so if you have to start over, you can at least
  50. start from where you started, and at least be able to go on like nothing ever
  51. happened.
  52.  
  53.  
  54.  
  55. =============================================================================
  56. 1. First, from DOS.
  57.  
  58.  COPY VARDEC.H OLD.H
  59.  
  60.  You need to make a backup copy of the user record structure.
  61.  
  62. Now, do this
  63.  
  64. PKZIP -a source *.c *.h
  65.  
  66. This will create a backup copy of all source files, so just in case you
  67. really get screwed, you can just unzip them and start over from scratch. Feel
  68. free to use Arc or LHarc or Looz or whatever, just BACK them up somehow. I
  69. always do this, and it's saved my butt more than once.
  70.  
  71. 2. Load Turbo C, and load OLD.H
  72.  
  73. Delete everything before and after the user record structure. Rename it
  74. olduserrec (at the end of the structure). When you are done, it should look
  75. like this....
  76.  
  77.  
  78. /* DATA FOR EVERY USER */
  79. typedef struct {
  80.     char        name[31],        /* user's name */
  81.             realname[21],        /* user's real name */
  82.             callsign[7],        /* user's amateur callsign */
  83.             phone[13],        /* user's phone number */
  84.             pw[9],            /* user's password */
  85.             laston[9],        /* last date on */
  86.             firston[9],        /* first date on */
  87.             note[41],        /* sysop's note about user */
  88.             macros[3][81],        /* macro keys */
  89. /**************************************************************************/
  90. /*** these three lines will only be there if you have added my FROM mod ***/
  91. /**************************************************************************/
  92.             street[31],        /* street address */
  93.             citystate[31],        /* city and state */
  94.             zip[6],            /* zip code*/
  95. /**************************************************************************/
  96. /*** normal user record structure continues here                        ***/
  97. /**************************************************************************/
  98.             sex;            /* user's sex */
  99.     unsigned char    age,            /* user's age */
  100.             inact,            /* if deleted or inactive */
  101.             comp_type,        /* computer type */
  102.             defprot,        /* deflt transfer protocol */
  103.             defed,            /* default editor */
  104.             screenchars,screenlines,/* screen size */
  105.             sl,            /* security level */
  106.             dsl,            /* transfer security level */
  107.             exempt,            /* exempt from ratios, etc */
  108.             colors[8],        /* user's colors */
  109.             votes[20],        /* user's votes */
  110.             illegal,        /* illegal logons */
  111.             waiting,        /* number mail waiting */
  112.             sysopsub,        /* sysop sub board number */
  113.             ontoday;        /* num times on today */
  114.     unsigned short    homeuser,homesys,    /* where user can be found */
  115.             forwardusr,forwardsys,    /* where to forward mail */
  116.             msgpost,        /* number messages posted */
  117.             emailsent,        /* number of email sent */
  118.             feedbacksent,        /* number of f-back sent */
  119.             posttoday,        /* number posts today */
  120.             etoday,            /* number emails today */
  121.             ar,            /* board access */
  122.             dar,            /* directory access */
  123.             restrict,        /* restrictions on account */
  124.             ass_pts,        /* bad things the user did */
  125.             uploaded,        /* number files uploaded */
  126.             downloaded,        /* number files downloaded */
  127.             lastrate,        /* last baud rate on */
  128.             logons;            /* total number of logons */
  129.     unsigned long    msgread,        /* total num msgs read */
  130.             uk,            /* number of k uploaded */
  131.             dk,            /* number of k downloaded */
  132.             qscn,            /* which subs to n-scan */
  133.             qscnptr[33],        /* q-scan pointers */
  134.             nscn1,nscn2,        /* which dirs to n-scan */
  135.             daten,            /* numerical time last on */
  136.             sysstatus;        /* status/defaults */
  137.     float        timeontoday,        /* time on today */
  138.             extratime,        /* time left today */
  139.             timeon,            /* total time on system */
  140.             pos_account,        /* $ credit */
  141.             neg_account,        /* $ debit */
  142.             gold;            /* game money */
  143.     unsigned char    bwcolors[8];        /* b&w colors */
  144.     unsigned char    month,day,year;        /* user's birthday */
  145.     unsigned int    emailnet,        /* email sent into net */
  146.             postnet;        /* posts sent into net */
  147.     unsigned short    fsenttoday1;        /* feedbacks today */
  148.         unsigned char   num_extended;           /* num lines of ext desc */
  149.         char            res[34];                /* reserved bytes */
  150. } olduserrec;     /*** note the change to olduserrec ***/
  151.  
  152. /** if you are adding this to 4.11, the number or reserved bytes
  153. will be different. It's OK, just leave it however you find it.*/
  154.  
  155.  
  156. 3. Save OLD.H.
  157.  
  158. 4. Load up Vardec.H. You need to add one variable, and change one other...
  159. In the interest of space, I won't post the whole thing...
  160.  
  161.     unsigned long    msgread,        /* total num msgs read */
  162.             uk,            /* number of k uploaded */
  163.             dk,            /* number of k downloaded */
  164. /* add qscn2 */        qscn,qscn2,        /* which subs to n-scan */
  165. /* change this to 64 */    qscnptr[64],        /* q-scan pointers */
  166.             nscn1,nscn2,        /* which dirs to n-scan */
  167.             daten,            /* numerical time last on */
  168.             sysstatus;        /* status/defaults */
  169.     float        timeontoday,        /* time on today */
  170.  
  171.  
  172. 5. Save VARDEC.H
  173.  
  174. 6. Load up VAR.H
  175.  
  176. 7. Scan down, and make these changes
  177.  
  178.  
  179. subboardrec subboards[64];          /* change this line, 32 to 64*/
  180. directoryrec directories[64];
  181. usersubrec usub[64],udir[64];       /* change this line, 32 to 64*/
  182. int num_subs,num_dirs;
  183. char dc[81],dcd[81],odc[81];
  184. int chatting,okskey;
  185. int endday;
  186.  
  187.  
  188. 8. Save VAR.H
  189.  
  190. 9. Load up BBS.C.
  191.  
  192. 10. Look for void sublist();
  193. Change one line here.
  194.  
  195.  
  196. void sublist()
  197. {
  198.   int i,abort;
  199.   char s[80];
  200.  
  201.   abort=0;
  202.   nl();
  203.   pla("Subs available: ",&abort);
  204.   nl();
  205.   i=0;
  206.   while ((i<64) && (usub[i].subnum!=-1)) {   /* change this line */
  207.     strcpy(s,usub[i].keys);
  208.     s[2]=0;
  209.  
  210.  
  211.  
  212. 11. Now scan down till you find void mainmenu(); Scan down a few lines, and
  213. make this change
  214.  
  215.   s=mmkey(0);
  216.   helpl=0;
  217.   if (s[0])
  218.     for (i=0; i<64; i++)                    /* change this line, 32 to 64 */
  219.       if (strcmp(usub[i].keys,s)==0)
  220.         cursub=i;
  221.   sysopchar(s);
  222.  
  223.  
  224. 12. Still in mainmenu, scan down some more and change the //QSCAN command.
  225.  
  226.  
  227.   if (strcmp(s,"QSCAN")==0) {
  228.     nl();
  229.     prt(5,"Clear Q-Scan pointers? ");
  230.     if (yn()) {
  231.       for (i=0; i<64; i++)                   /* change this line, 32 to 64 */
  232.         thisuser.qscnptr[i]=status.qscanptr-1L;
  233.       nl();
  234.       pl("Q-Scan pointers cleared.");
  235.       nl();
  236.     }
  237.  
  238.  
  239. 13. Save BBS.C
  240.  
  241. 14. Load up BBSUTL.C
  242.  
  243. 15. Scan down a few lines from the top, in the variable declarations
  244.  
  245. Change these two lines
  246.  
  247.  
  248. extern char curspeed[80];
  249. extern int cursub,curdir,curdloads,use_workspace,global_xx;
  250. extern usersubrec usub[64],udir[64];   /*  change this line, from 32 to 64 */
  251. extern statusrec status;               /* in both places */
  252. extern int incom,outcom,msgreadlogon;
  253. extern int fsenttoday,userfile,chatcall,mailcheck,smwcheck;
  254. extern char chatreason[81],irt[81];
  255. extern subboardrec subboards[64];      /* change 32 to 64 here too ! */
  256. extern long nscandate;
  257. extern float batchtime;
  258.  
  259.  
  260. 16. Save BBSUTL.C. Load up BBSUTL1.C.
  261.  
  262. 17. Again, scan down a few lines to the variable declarations. Change these
  263. two lines in the places indicated.
  264.  
  265.  
  266. extern int cursub,curdir,curdloads,helpl;
  267. extern usersubrec usub[64],udir[64];     /* change both 32's to 64's */
  268. extern statusrec status;
  269. extern int incom,msgreadlogon,numchain;
  270. extern int fsenttoday,userfile,chatcall;
  271. extern char chatreason[81],irt[81];
  272. extern subboardrec subboards[64];        /* change 32 to 64 */
  273. extern smalrec *smallist;
  274. extern chainfilerec *chains;
  275.  
  276.  
  277. 18. Scan down a few lines till you find void l_config_scan();
  278.  You have two choices here...
  279.   A. Delete it and the following function, void config_scan, and block read in
  280.      my versions which follow.
  281.   B. Make the changes by hand.
  282. I would suggest option A, but it is up to you....Just make sure you get all
  283. the { and } right!!!!!
  284.  
  285.  
  286. void l_config_qscan()
  287. {
  288.   int i,abort;
  289.   char s[81];
  290.  
  291.   abort=0;
  292.   nl();
  293.   pl("Boards to q-scan marked with '*'");
  294.   nl();
  295.   for (i=0; (i<64) && (usub[i].subnum!=-1) && (!abort); i++) {  /* change */
  296.     if (usub[i].subnum<32) {                                    /* add    */
  297.       if ((1L << (usub[i].subnum)) & thisuser.qscn)
  298.     strcpy(s,"* ");
  299.       else
  300.     strcpy(s,"  ");
  301.     }                                                           /* add    */
  302.     else {                                                      /* add    */
  303.       if ((1L << (usub[i].subnum-32)) & thisuser.qscn2)         /* add    */
  304.     strcpy(s,"* ");                                         /* add    */
  305.       else                                                      /* add    */
  306.     strcpy(s,"  ");                                         /* add    */
  307.     }                                                           /* add    */
  308.     strcat(s,(usub[i].keys));
  309.     strcat(s,". ");
  310.     strcat(s,subboards[usub[i].subnum].name);
  311.     pla(s,&abort);
  312.   }
  313.   nl();
  314.   nl();
  315. }
  316.  
  317. void config_qscan()
  318. {
  319.   char *s;
  320.   int i,done;
  321.  
  322.   l_config_qscan();
  323.   done=0;
  324.   do {
  325.     nl();
  326.     pl("Enter sub-board identifier, or Q to Quit");
  327.     helpl=7;
  328.     outstr("Config: ");
  329.     s=mmkey(0);
  330.     if (s[0]){
  331.       for (i=0; i<64; i++)                                     /* change  */
  332.     if (strcmp(usub[i].keys,s)==0)
  333.       if (usub[i].subnum<32)                               /* add     */
  334.           thisuser.qscn ^=((1L) << (usub[i].subnum));
  335.         else                                               /* add     */
  336.           thisuser.qscn2 ^=((1L) << (usub[i].subnum-32));  /* add     */
  337.  
  338.  
  339.     }
  340.  
  341.   if (strcmp(s,"Q")==0)
  342.       done=1;
  343.     if (strcmp(s,"?")==0)
  344.       l_config_qscan();
  345.   } while ((!done) && (!hangup));
  346. }
  347.  
  348.  
  349. 19. Save BBSUTL1.C  Load up MSGBASE.C.
  350. 20. Make the following two changes in the variable declarations at the top...
  351.  
  352.  
  353. extern subboardrec subboards[64];     /* change 32 to 64 */
  354. extern usersubrec usub[64];           /* change 32 to 64 */
  355. extern int cursub,express,expressabort,topline,topdata;
  356. extern int curlsub,nummsgs,helpl;
  357. extern postrec *msgs;
  358.  
  359.  
  360. 21. Save MSGBASE.C.  Load up MSGBASE1.C.
  361. 22. Make the following changes in the variable declarations
  362.  
  363.  
  364. extern subboardrec subboards[64];     /* change 32 to 64 */
  365. extern usersubrec usub[64];           /* change 32 to 64 */
  366. extern int cursub,express,expressabort,num_sys_list,screenlinest;
  367. extern int curlsub,nummsgs,helpl;
  368.  
  369.  
  370. 23. Scan down for the function void scan. Make this one change way down near the middle of this very long function.....
  371.  
  372.  
  373.           } while ((!hangup) && (ss1[0]=='?'));
  374.           i=-1;
  375.           if (ss1[0]==0)
  376.             break;
  377.           for (i1=0; i1<64; i1++)
  378.                     if (strcmp(usub[i1].keys,ss1)==0)
  379.                       i=i1;
  380.                   if (i!=-1) {
  381.             p=msgs[msgnum];
  382.  
  383.  
  384. 24. Scan down to the function void nscan. Once again, either delete it and
  385. block read in the replacement, or change it to look just like this...
  386.  
  387.  
  388. void nscan(int ss)
  389. {
  390.   int i,nextsub,abort,next;
  391.  
  392.   nl();
  393.   nextsub=1;
  394.   prt(3,"<< Q-Scan All >>");
  395.   nl();
  396.  
  397. /* mod starts here */
  398.  
  399.   for (i=ss; (usub[i].subnum!=-1) && (i<64) && (nextsub) && (!hangup); i++) {
  400.     if (usub[i].subnum<32)
  401.     {if (thisuser.qscn & (1L<<(usub[i].subnum)))
  402.       qscan(i,&nextsub);}
  403. else
  404.     {if (thisuser.qscn2 & (1L<<(usub[i].subnum-32)))
  405.       qscan(i,&nextsub);}
  406.  
  407. /* original code resumes here.... */
  408.     abort=next=0;
  409.     checka(&abort,&next);
  410.     if (abort)
  411.       nextsub=0;
  412.   }
  413.   nl();
  414.   prt(3,"<< Global Q-Scan Done >>");
  415.   nl();
  416.   nl();
  417. /* here's a bonus thrown in just for kicks...if you change/add these lines,
  418. when it scans the transfer section for new files it will tell them it is doing
  419. that, rather than just hang for a few seconds....    /*
  420.   if ((nextsub) && (thisuser.sysstatus & sysstatus_nscan_file_system) &&
  421.     ((syscfg.sysconfig & sysconfig_no_xfer)==0)){    /* add the { */
  422.     pl("Now scanning transfer directory for new files ");   /* add line */
  423.     nl();                                                   /* add line */
  424.     nscanall();
  425.     nl();                                                   /* add line */
  426.     pl("Transfer directory scan completed");                /* add line */
  427.     nl(); }                           /* add line, make sure } is there */
  428.  
  429. }
  430.  
  431.  
  432.  
  433. 25. Now save MSGBASE1.C. Load up NEWUSER.C.
  434. 26. Scan down to void newuser. Make these changes.....
  435.  
  436.  
  437.   thisuser.msgread=0;
  438.   thisuser.uk=0;
  439.   thisuser.dk=0;
  440.   thisuser.qscn=0xFFFFFFFF;
  441.   thisuser.qscn2=0xFFFFFFFF;   /* add this line. make sure there are 8 F's */
  442.   for (i=0; i<64; i++)         /* change this line, 33 to 64.... */
  443.     thisuser.qscnptr[i]=0;
  444.   thisuser.nscn1=0xFFFFFFFF;
  445.   thisuser.nscn2=0xFFFFFFFF;
  446.  
  447.  
  448. 27. Save NEWUSER.C. Load up SYSOPF.C.
  449. 28. Scan down a while, till you find void insert_sub. Once again, either
  450. block read in the replacement, or change it.
  451.  
  452.  
  453. void insert_sub(int n)
  454. {
  455.   subboardrec r;
  456.   int i,i1,nu;
  457.   userrec u;
  458.   long l1,l2,l3;
  459.   int n1,fl;                            /* add this line here */
  460.  
  461.   for (i=num_subs-1; i>=n; i--)
  462.     subboards[i+1]=subboards[i];
  463.   strcpy(r.name,"** NEW SUB **");
  464.   strcpy(r.filename,"NONAME");
  465.   r.key=0;
  466.   r.readsl=10;
  467.   r.postsl=20;
  468.   r.anony=0;
  469.   r.age=0;
  470.   r.maxmsgs=50;
  471.   r.ar=0;
  472.   r.type=0;
  473.   r.storage_type=2;
  474.   subboards[n]=r;
  475.   ++num_subs;
  476.   read_user(1,&u);
  477.   nu=(int) (filelength(userfile) / sizeof(userrec));
  478. /********************************************************/
  479. /* mod starts getting real nasty here.. add these lines */
  480.   n1=n;
  481.   fl=0;
  482.   if (n>31)
  483.     {
  484.     n1-=32;
  485.     fl=1;
  486.     }
  487. /* end of addition                                      */
  488. /********************************************************/
  489.   l1=0xffffffff >>(32-n1);   /* change n to n1 */
  490.   l2=0xffffffff <<(n1+1);    /* change n to n1 */
  491.   l3=1L << n1;               /* change n to n1 */
  492.   for (i=1; i<nu; i++) {
  493.     read_user(i,&u);
  494.     if (u.sysopsub!=255)
  495.       if (u.sysopsub>=n)
  496.         ++u.sysopsub;
  497.     for (i1=num_subs-1; i1>n; i1--)
  498.       u.qscnptr[i1]=u.qscnptr[i1-1];
  499.     u.qscnptr[n]=0L;
  500. /*****************************************************************/
  501. /* mod starts getting nasty in here too. add/change this section */
  502.     if (fl)
  503.       u.qscn2=(u.qscn2 & l1) | ((u.qscn2 << 1) & l2) | l3;
  504.     else
  505.       {u.qscn2=((u.qscn2 << 1) | (u.qscn >> 31));
  506.       u.qscn=(u.qscn & l1) | ((u.qscn << 1) & l2) | l3;
  507.       }
  508. /* end of addition                                               */
  509. /*****************************************************************/
  510.     write_user(i,&u);
  511.   }
  512.   modify_sub(n);
  513. }
  514.  
  515.  
  516.  
  517. 29. The next function is void delete_sub. It too has some nasty modding,
  518. so I once again encourage you to block read it in...
  519.  
  520.  
  521.  
  522. void delete_sub(int n)
  523. {
  524.   int i,i1,nu;
  525.   userrec u;
  526.   long l1,l2;
  527.   int n1,fl;    /* add line */
  528.  
  529.   for (i=n; i<num_subs; i++)
  530.     subboards[i]=subboards[i+1];
  531.   --num_subs;
  532.   read_user(1,&u);
  533.   nu=(int) (filelength(userfile) / sizeof(userrec));
  534. /**********************************************************/
  535. /*                 more additons                          */
  536.   n1=n;
  537.   fl=0;
  538.   if (n>31)
  539.     {
  540.     n1-=32;
  541.     fl=1;
  542.     }
  543. /**********************************************************/
  544.   l1=0xffffffff >>(32-n1); /* change n to n1 */
  545.   l2=0xffffffff <<(n1);    /* change n to n1 */
  546.   for (i=1; i<nu; i++) {
  547.     read_user(i,&u);
  548.     if (u.sysopsub==n)
  549.       u.sysopsub=255;
  550.     else
  551.       if ((u.sysopsub>n) && (u.sysopsub!=255))
  552.         --u.sysopsub;
  553.     for (i1=n; i1<num_subs; i1++)
  554.       u.qscnptr[i1]=u.qscnptr[i1+1];
  555.     u.qscnptr[63]=0L;         /* change from 31 to 63 */
  556. /***********************************************************/
  557. /*                more nasty modding to do here            */
  558.     if (fl)
  559.       u.qscn2=(u.qscn2 & l1) | ((u.qscn2 >> 1) & l2);
  560.     else
  561.       {
  562.       u.qscn=(u.qscn & l1) | ((u.qscn >> 1) & l2) | (u.qscn2<<31);
  563.       u.qscn2=(u.qscn2 >> 1);
  564.       }
  565. /***********************************************************/
  566.     write_user(i,&u);
  567.   }
  568.   if (!wfc)
  569.     changedsl();
  570. }
  571.  
  572. 30. Now, down in void boardedit, make the following change...
  573.  
  574.       case 'I':
  575.     if (num_subs<64) {                            /* change 32 to 64 */
  576.           nl();
  577.           prt(2,"Insert before which sub? ");
  578.           input(s,2);
  579.           i=atoi(s);
  580.  
  581.  
  582. 31. Now save SYSOPF.C, and load up UTILITY.C. This is the last file to
  583. change...at least, in the BBS...Just think about upgrading next time.He He..
  584. 32. Big surprise here. Change the variable declarations.
  585. Just make the appropriate 32's into 64's, so it looks like this....
  586.  
  587. extern int useron,wfc,echo,lecho;
  588. extern subboardrec subboards[64];
  589. extern directoryrec directories[64];
  590. extern usersubrec usub[64],udir[64];
  591. extern int num_subs,num_dirs,chatting,okskey,lines_listed;
  592.  
  593.  
  594.  
  595. 33. Now look for void init. Scan down till you find this part...
  596. Change the one line.
  597.  
  598.     strcpy(s,syscfg.datadir);
  599.     strcat(s,"SUBS.DAT");
  600.     i=open(s,O_RDWR | O_BINARY);
  601.     if (i<0) {
  602.       printf("%s NOT FOUND.\n",s);
  603.       end_bbs(noklevel);
  604.     }
  605.     num_subs=(read(i,(void *) (&subboards), (64*sizeof(subboardrec))))/
  606.              sizeof(subboardrec);      /* change the 32 in the line above */
  607.     close(i);                          /* to a 64.  */
  608.  
  609.  
  610.  
  611.  
  612. 34. Now scan down till you find void changedsl.
  613.  
  614.  
  615. void changedsl()
  616. {
  617.   int i,i1,i2,i3,i4,ok,dp,ddp;
  618.   subboardrec s;
  619.   directoryrec d;
  620.   usersubrec s1;
  621.  
  622.   realsl=thisuser.sl;
  623.   topscreen();
  624.   dp=0;
  625.   dc[dp++]='/';
  626.   ddp=0;
  627.   dcd[ddp++]='/';
  628.   for (i=0; i<3; i++) {
  629.     s1.keys[i]=0;
  630.   }
  631.   s1.subnum=-1;
  632.   for (i=0; i<64; i++)       /* change 32 to a 64 */
  633.     usub[i]=s1;
  634.   for (i=0; i<64; i++)
  635.     udir[i]=s1;
  636.   i1=1;
  637.   i2=0;
  638.   i3=0;
  639.  
  640.  
  641.  
  642. 35. Ok, now your BBS is ready to be compiled. So go ahead and get started on
  643. that, but DO NOT TRY to run it until you complete the following steps. Right
  644. now it assumes the user record size is different than it is in the file, so
  645. there are three options.
  646.  
  647.   A. Tell your users tough luck, delete USERS.LST from the Data dir, and
  648.      re-validate everyone....Ha Ha Ha Ha Ha.....
  649.   B. Write down every bit of info on everyone. Delete USERS.LST, start the
  650.      BBS up, and put everyone back in by hand, one at a time, revalidating
  651.      along the way. Just try to get all quickscan pointers set right.....
  652.   C. Copile the included Convert program, and change the user list over to
  653.      the new format.
  654.  
  655. 36. Choice A or B, skip ahead to step 38.
  656.     Choice C, proceed to step 37.
  657.  
  658. 37. Load up CONVERT.C. Depending on whether or not you have ever modified the
  659. user record before, you may need to make some changes to it.
  660. (By the way, to compile this, you need to select the project option, then
  661. project name. Hit Enter, when it asks for a new one hit space and return.
  662. Otherwise, when you try to compile CONVERT.C, it will try to compile the BBS again, which you just did, and it will tell you everything is up to date. )
  663.  
  664.  
  665. ----------------------------------CONVERT.C----------------------------------
  666. /*  CONVERT USERLIST PROGRAM */
  667.  
  668. /*  Written by The Black Dragon, 1989 */
  669. /*  (C) 1989 Black Dragon Enterprises */
  670. /*  Compiled and tested using Borland Turbo C - Version 1.5 */
  671. /*  License granted to freely distribute without compensation and to */
  672. /*  modify as needed "to get the job done."  Use at your own risk.  */
  673. /*  Distributed "as is".  No warranty or guarentee */
  674.  
  675. /*  Command Parameters:  */
  676. /*  CONVERT  <old user filename>  <new user filename>  */
  677.  
  678. /* This file was modified by Lord Elric, 1@8251, 9/24/89, 5:17am
  679. after yet another all-night BBS modding session. Many thanks to Black Dragon,
  680. 1@280, for writing this conversion program. With little modifications here
  681. and there, this can be used to add or delete almost anything from the user
  682. record.
  683.  
  684. Lord Elric 1@8251 WWIVNet*/
  685.  
  686.  
  687. #include <stdio.h>
  688. #include <string.h>
  689. #include <mem.h>
  690. #include <io.h>
  691. #include <fcntl.h>
  692. #include <sys\stat.h>
  693. #include "old.h"        /* put your old userlist here and */
  694. #include "vardec.h"        /* rename it from userrec to olduserrec */
  695.  
  696. void main(int argc, char *argv[])
  697. {
  698.   int f,g,i;
  699.   unsigned int loop,num=0;
  700.   unsigned long len;
  701.   userrec new;
  702.   olduserrec old;
  703.  
  704.   if (argc<3) {
  705.     printf("\nRequires 2 parameters.\n");
  706.     printf("Usage: CONVERT oldfile newfile \n");
  707.     abort();
  708.   }
  709.   if ((f=open(argv[1],O_RDWR|O_BINARY,S_IREAD|S_IWRITE))<=0) {
  710.     printf("\nCould not open user list %s\n",argv[1]);
  711.     abort();
  712.   }
  713.   if ((g=open(argv[2],O_RDWR|O_BINARY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE))<=0) {
  714.     printf("\nCould not open output file %s\n",argv[2]);
  715.     abort();
  716.   }
  717.   printf("\n\nSize of old user record %d",sizeof(olduserrec));
  718.   printf("\nSize of new user record %d\n\n",sizeof(userrec));
  719.  
  720.   len=filelength(f);
  721.   num=(len/sizeof(olduserrec))+!(len%sizeof(olduserrec));
  722.   for (loop=0;loop<num;loop++) {
  723.     if (sizeof(olduserrec)==read(f,&old,sizeof(olduserrec))) {
  724.     printf("\015Processing user #%u of %u",loop,num-1);
  725.  
  726.     memset(&new,0,sizeof(userrec));    /* Nice to clear out garbage */
  727.     strcpy(new.name,old.name);        /* Now copy all data over    */
  728.     strcpy(new.realname,old.realname);
  729.     strcpy(new.pw,old.pw);
  730.     strcpy(new.laston,old.laston);
  731.     strcpy(new.firston,old.firston);
  732.     strcpy(new.note,old.note);
  733.     for (i=0;i<3;i++)
  734.       strcpy(new.macros[i],old.macros[i]);
  735. /*********************************************************************/
  736. /* These lines need to be added if you are using my FROM mod         */
  737. /*********************************************************************/
  738. /*    strcpy(new.street,old.street);                                 */
  739. /*    strcpy(new.citystate,old.citystate);                           */
  740. /*    strcpy(new.zip,old.zip);                                       */
  741. /*********************************************************************/
  742. /* obviously, you want to remove the comment blocks around them      */
  743. /*********************************************************************/
  744.  
  745.  
  746.    new.sex=old.sex;
  747.     new.month=old.month;
  748.     new.day=old.day;
  749.     new.year=old.year;
  750.     new.age=old.age;
  751.     new.sl=old.sl;
  752.     new.dsl=old.dsl;
  753.     new.inact=old.inact;
  754.     new.exempt=old.exempt;
  755.     new.sysopsub=old.sysopsub;
  756.     new.comp_type=old.comp_type;
  757.     new.screenchars=old.screenchars;
  758.     new.screenlines=old.screenlines;
  759.     for (i=0;i<8;i++) {
  760.       new.colors[i]=old.colors[i];
  761.       new.bwcolors[i]=old.bwcolors[i];
  762.     }
  763.     for (i=0;i<20;i++)
  764.       new.votes[i]=old.votes[i];
  765.     new.illegal=old.illegal;
  766.     new.ontoday=old.ontoday;
  767.     new.defed=old.defed;
  768.     new.defprot=old.defprot;
  769.     new.num_extended=old.num_extended;
  770.     new.waiting=old.waiting;
  771.     new.fsenttoday1=old.fsenttoday1;
  772.     new.homeuser=old.homeuser;
  773.     new.homesys=old.homesys;
  774.     new.forwardusr=old.forwardusr;
  775.     new.forwardsys=old.forwardsys;
  776.     new.msgpost=old.msgpost;
  777.     new.emailsent=old.emailsent;
  778.     new.feedbacksent=old.feedbacksent;
  779.     new.posttoday=old.posttoday;
  780.     new.etoday=old.etoday;
  781.     new.emailnet=old.emailnet;
  782.     new.postnet=old.postnet;
  783.     new.ar=old.ar;
  784.     new.dar=old.dar;
  785.     new.restrict=old.restrict;
  786.     new.ass_pts=old.ass_pts;
  787.     new.uploaded=old.uploaded;
  788.     new.downloaded=old.downloaded;
  789.     new.lastrate=old.lastrate;
  790.     new.logons=old.logons;
  791.     strcpy(new.phone,old.phone);
  792.     new.msgread=old.msgread;
  793.     new.uk=old.uk;
  794.     new.dk=old.dk;
  795.     new.daten=old.daten;
  796.     new.sysstatus=old.sysstatus;
  797.     new.qscn=old.qscn;            /* copies existing n-scan ptrs */
  798.     new.qscn2=0L;
  799.     new.nscn1=old.nscn1;
  800.     new.nscn2=old.nscn2;
  801.     for(i=0;i<64;i++)            /*clear it all out, just to be safe */
  802.       new.qscnptr[i]=0L;
  803.     for(i=0;i<33;i++)
  804.       new.qscnptr[i]=old.qscnptr[i];
  805.     new.timeontoday=old.timeontoday;
  806.     new.extratime=old.extratime;
  807.     new.timeon=old.timeon;
  808.     new.gold=old.gold;
  809.     new.pos_account=old.pos_account;
  810.     new.neg_account=old.neg_account;
  811.     write(g,&new,sizeof(userrec));    /* User record converted here */
  812.     }
  813.   }
  814.   close(f);
  815.   close(g);
  816. }
  817. ---------------------------------end of CONVERT.C ---------------------------
  818.  
  819. 38. Now that CONVERT.C is compiled, Load up DISPLAY.C.
  820. Compile it and run it (Ctrl-F9). It will display three numbers, the user
  821. record size, the mail waiting offset, and the inactive offset. Write those
  822. down right here on the printout...
  823.  
  824. User Record Size ____________
  825.  
  826. Mail Waiting     ____________
  827.  
  828. Inactive         ____________
  829.  
  830.  
  831. 39. (Skip this step if you are just nuking the user record, although you
  832. will not make any friends this way.......)
  833. Now drop back to DOS.
  834. Change to your data dir. Make a backup copy of your user list somewhere, just
  835. in case you decide to screw it all and go back.
  836. Then, do this.
  837.  
  838. RENAME USER.LST USER2.LST     /* change name of user list */
  839. CONVERT USER2.LST USER.LST
  840.  
  841. Now it will scan through the user list and change it to the new format.
  842.  
  843.  
  844. 40. Almost there. If you are not in the network, you may skip this step,
  845. provided that if you ever do join, you promise to come back and do it.
  846. Otherwise, WWIVNet WILL SCREW your files beyond your wildest dreams...
  847.  
  848. You should have received a program with the network files called NETINIT.
  849. Run this program. You will be prompted for the numbers you wrote down back in step 38. Please enter them here.
  850. =============================================================================
  851.  
  852.  
  853. That's it, you are indeed done. Test it out, make sure it works...
  854.  
  855. Possible problem sources.
  856. -------------------------------
  857.  
  858. 1. It seems obvious, but go back step by step, making sure you did
  859. everything exactly as it is written.
  860.  
  861. 2. Make sure you ran DISPLAY.C and NETINIT. Run NETINIT again, to make sure
  862. the numbers have changed.
  863.  
  864. 3. If you have any other mods which modified the user record, make sure you
  865. copy those values over in CONVERT.C.
  866.  
  867. For example, if you had added an integer, longint, or real, then do this...
  868.  new.addition=old.addition;
  869.  
  870. If you added a string, say newstring[40], then you have to use strcpy....
  871.   strcpy(new.newstring,old.newstring);
  872.  
  873. If you added an array, you have to do a loop...
  874.   for (i=0;i<sizeofarray;i++)
  875.     new.stuff[i]=old.stuff[i];
  876.  
  877. 4. Please, Please, Please, Please, Back up everything before you start
  878. changing it. If you are in doubt, back it up. A good place to start is
  879. just to back up the whole drive. 
  880.   If not, at least back up all the .C files, all the .H files, the file
  881. USER.LST in your data dir, the file SUBS.DAT in your data dir, and
  882. CONFIG.DAT in your main BBS dir.
  883.   These files will be changed, so if you have to start over, you can at least
  884. start from where you started, and at least be able to go on like nothing ever
  885. happened.
  886.  
  887. 5. Make sure return.c gets re-compiled to return.exe, and that shrink.c
  888. gets recompiled as well. The easiest way to do that is to use a makefile,
  889. but some people dont seem to want to do that. Trust me on this though,
  890. that is the best way to go.
  891.  
  892.  
  893.  
  894. /** hey, it's the form info file **/
  895. As usual, I take no responsibility for hard drive crashes, death in the
  896. family, or end of the world as we know it resulting from this mod.
  897.  
  898. It's your fault if you didn't back up the files before you made the mod.
  899.  
  900. It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
  901. a month.
  902.  
  903. It works on my system with Turbo C 2.0, WWIV 4.1, V20/8088, 640K/640EMS.
  904.  
  905. If you use this, the only payment I ask is that you send me a note through
  906. WWIVLink to 1@18251 saying you are using it...not too much to ask is it?
  907.  
  908. The Kingdom of Melnibone(LINK/NET)
  909. 812-877-3488  24 Hrs a day
  910. 3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
  911. Auto-validation of WWIV sysops on first call
  912. Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
  913.  
  914. WWIV Link  1@18251
  915.  
  916. WWIV Net   1@8251
  917.