home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / MODSUNKN.ZIP / ELRIC17.MOD < prev    next >
Text File  |  1990-04-28  |  5KB  |  175 lines

  1. Hello Kiddies, and welcome once again to another Elric Mod.
  2.  
  3.         Elric's Mod #17
  4.         Sysop mode
  5.  
  6. Well, I just got tired of typing the system password over and over again. So,
  7. I installed a little mod that lets me type it in once, then set a flag and not
  8. have to do it again. It started out as a seperate sysop menu, but then I
  9. realized how much easier (and smaller) it would be to just have a
  10. "sysop mode", and leave the menus alone...So, here we go.
  11.  
  12. A. Easy way to do it, without source code.
  13.    Does not require Turbo C. Does not require effort.
  14.    Does not require much at all.
  15.    
  16.    1. Run the BBS.
  17.    2. Hit space bar, then F for fast sysop logon.
  18.    3. Go down, ignore your mail, get to main menu.
  19.    4. Hit D, for defaults.
  20.    5. Choose Macros.
  21.    6. Make the Ctrl-A macro MYSYSOPPASSWORD^M^Z
  22.    7. Now, just hit Ctrl-A for the sysop password.
  23.  
  24.  
  25. =============================================================================
  26. B. The fun wasy to do it. Requires Turbo C 1.5 or better.
  27.    Requires source code to WWIV 4.xx
  28.    Takes a little more time.
  29.  
  30. 1. OK, first load up Turbo C. Load BBS.C.
  31.    Scan down to the include lines, where it says this....
  32.  
  33. #include <math.h>
  34. #include <dos.h>
  35. #include <alloc.h>
  36. #include <time.h>
  37.  
  38. int in_sysop;                 /*** add this line ***/
  39. unsigned _stklen=32000;
  40.  
  41.  
  42. 2. Now, scan down for void mainmenu. Right there, at the top, make these
  43. additions....
  44.  
  45.  
  46.   tleft(1);
  47.   print("T - ",ctim(nsl()),"");
  48.   if (in_sysop)                             /*** add line ***/
  49.     pl("SYSOP MODE");                       /*** add line
  50.   s1[0]=0;
  51.   if (usub[cursub].subnum==-1) {
  52.     cursub=0;
  53.  
  54.  
  55. 3. Now, still in mainmenu, scan down and add these lines...
  56.  
  57.     switch(s[0]) {
  58. /*****add these lines here...******/
  59.       case '%': if (checkpw())
  60.           in_sysop=!in_sysop;
  61.         else
  62.           sysoplog("tried to enter the sysop menu");
  63.         break;
  64. /*****end of addition*************/
  65.       case '>':
  66.       case '+':
  67.         if (usub[cursub+1].subnum>=0)
  68.           ++cursub;
  69.         else
  70.           cursub=0;
  71.         break;
  72.       case '<':
  73.       case '-':
  74.         if (cursub>0)
  75.  
  76.  
  77.  
  78. 4. Ok, now let's go down to void dlmainmenumenu.
  79.  
  80.  
  81.  
  82.   nl();
  83.   tleft(1);
  84.   print("T - ",ctim(nsl()),"");
  85.   s1[0]=0;
  86.   if (in_sysop)                           /*** add this line ***/
  87.     pl("SYSOP MODE");                     /*** add this line ***/
  88.   if (udir[curdir].subnum==-1) {
  89.     curdir=0;
  90.     if (udir[curdir].subnum==-1) {
  91.  
  92.  
  93. 5. Ok, almost done with BBS.C Search down for void main, and look for this 
  94. piece of code....Add the two lines "in_sysop=0;"
  95.  
  96.  
  97.       logon();
  98.       in_sysop=0;     /*make sure not in sysop mode when logging on */
  99. main_menu_label:
  100.       while (!hangup) {
  101.         if (curdloads)
  102.           dlmainmenu();
  103.     else
  104.       mainmenu();
  105.       }
  106.       logoff();
  107.     }
  108.     in_sysop=0;     /*make sure not in sysop mode when logging off */
  109.     frequent_init();
  110.     if ((!no_hangup) && (using_modem) && ok_modem_stuff) {
  111.  
  112.  
  113. 6. Now, save BBS.C, and load up SYSOPF.C
  114. Once again, look for the declarations, and add the line "extern int in_sysop"
  115.  
  116.  
  117. extern externalrec *externs;
  118. extern unsigned char agemin,agemax,slmin,slmax,dslmin,dslmax,ressex;
  119. extern int daysmin,daysmax,lecho;
  120. extern unsigned short arres,darres,resres;
  121. extern int questused[20];
  122. extern unsigned char realsl;
  123. extern int in_sysop;                /*****add this line*****/
  124.  
  125. void deluser(int un)
  126. {
  127.   userrec u;
  128.  
  129.  
  130. 7. Almost done now! Scan down to int checkpw, and change it to look like this.
  131.  
  132.  
  133. int checkpw()
  134. {
  135.   char s[81];
  136.  
  137.   if (in_sysop)           /***add me***/
  138.     return(1);            /***add me***/
  139.   else                    /***add me***/
  140.   {                       /***add me***/
  141.  
  142.   nl();
  143.   prt(2,"SY: ");
  144.   echo=0;
  145.   input(s,20);
  146.   echo=1;
  147.   if (strcmp(s,(syscfg.systempw))==0)
  148.     return(1);
  149.   else
  150.     return(0);
  151.   }                        /****ADD ME TOO, OR WATCH IT CRASH AND BURN***/
  152. }
  153.  
  154. Well, that's it! Now all you have to do is hit % from the main menu, and
  155. you are thrown in sysop mode. I could have added something to leave it toggled
  156. when you shrunk out for something, but quite frankly, I just didn't care.
  157. Someone else can do that, with the exception of the nap I had in Computer
  158. Architecture today I have been up since yesterday morning, and I just don't
  159. care.
  160.  
  161.  
  162. If you use this, the only payment I ask is that you send me a
  163. note through WWIVNet to 1@8251 saying you are using it...not too much to
  164. ask is it?
  165.  
  166. If you have any problems, you can reach me through WWIV-Net, 1@8251, or call
  167. my BBS.
  168. The Kingdom of Melnibone
  169. 812-877-3488  24 Hrs a day
  170. 3/12/2400/4800/9600/12000/14,400 HST MNP5 baud
  171. Auto-validation of WWIV sysops on first call
  172. Xmodem, Ymodem, DSZ Zmodem with retry, DSZ Ymodem-G supported.
  173.  
  174. Lord Elric
  175.