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

  1. Parker Prospect #1 @9964
  2. Thu Apr 26 16:42:58 1990
  3.       +---------------------------------------------------------+
  4.       +   Turn Off [PAUSE] Prompting For Selected Chains Mod    +
  5.       +---------------------------------------------------------+
  6.  
  7. This idea came to me after a lot of complaining on Filo's part (grin)
  8. about how his Waffle program would not work with a user's [PAUSE]
  9. prompting set on. I turned it over and over in my mind, but I was just
  10. too lazy to actually write the thing. Finally, Filo directly sent me
  11. some mail asking me to spare some time off to write this mod. Since I
  12. knew it wouldn't take but maybe 30 minutes at most, I said sure, and
  13. went to work.
  14.  
  15. What this mod does is allow the sysop to have the option (set in
  16. //CHAINEDIT) of turning off a user's [PAUSE] prompting option, if the
  17. user has it set on, when the user runs a chain.  This mod involves a lot
  18. of files, but it isn't really that much work. Enjoy!
  19.                                                      - PP April 26, 1990
  20.  
  21. NOTE: I have deleted the end of some of the lines that were not modified
  22. due to margin requirements.  If you see a line that is different in this
  23. mod listing, but does not have a '++' or a '-+' on the front of it, DO
  24. NOT MODIFY IT!
  25.  
  26.                  ************************************
  27.                  ************** Legend **************
  28.                  ************************************
  29.                  * %% Delete Line                   *
  30.                  * -- Search for Line, DON'T CHANGE *
  31.                  * ++ Add Line                      *
  32.                  * -+ Modify Line                   *
  33.                  * ## Line is part of another mod   *
  34.                  ************************************
  35.  
  36.  
  37. ------------------------------------------------------------------------
  38. Step #1 <VARS.H>: Add the following line to the end of the file.
  39.  
  40. long save_user_defaults;
  41.  
  42.  
  43. ------------------------------------------------------------------------
  44. Step #2 <VARDEC.H>: Insert the following lines.
  45.  
  46. ++ /* chainfilerec.ansir */
  47. -- #define ansir_ansi 0x0001
  48. -- #define ansir_no_DOS 0x0002
  49. -- #define ansir_no_300 0x0004
  50. -- #define ansir_shrink 0x0008
  51. ++ #define ansir_pause_on 0x0010
  52.  
  53.  
  54. ------------------------------------------------------------------------
  55. Step # <BBSUTL.C>: Edit according to legend at top of file.
  56.  
  57. -- extern int incom,outcom,msgreadlogon;
  58. -- extern int fsenttoday,userfile,chatcall,mailcheck,smwcheck;
  59. -- extern char chatreason[81],irt[81];
  60. -- extern subboardrec subboards[32];
  61. -+ extern long nscandate, save_user_defaults;
  62. -- extern float batchtime;
  63. -- extern int numbatch,numed,lines_listed;
  64. -- extern editorrec *editors;
  65. -- extern gfiledirrec *gfilesec;
  66.  
  67.  
  68. ------------------------------------------------------------------------
  69. Step # <BBSUTL.C>: Edit according to legend in void logoff.
  70.  
  71. --   double ton;
  72.  
  73. --   dtr(0);
  74. --   hangup=1;
  75. ++   save_user_defaults = 0;
  76. --   thisuser.lastrate=modem_speed;
  77. --   strcpy(thisuser.laston,xdate);
  78. --   thisuser.sl=realsl;
  79.  
  80.  
  81. ------------------------------------------------------------------------
  82. Step # <BBSUTL1.C>: Edit according to legend at top of file.
  83.  
  84. -- #include <fcntl.h>
  85. -- #include <alloc.h>
  86. -- #include "vardec.h"
  87. -- #include "fcns.h"
  88.  
  89. ++ extern long save_user_defaults;
  90. -- extern int hangup;
  91. -- extern char dc[81],dcd[81],odc[81];
  92. -- extern char charbuffer[161];
  93.  
  94.  
  95. ------------------------------------------------------------------------
  96. Step # <BBSUTL1.C>: REPLACE void run_chain with the one listed below.
  97.  
  98. void run_chain(int cn)
  99. {
  100.      char s[81],s1[81],s2[81];
  101.      int oc;
  102.  
  103.      strcpy(s1,chains[cn].filename);
  104.      strcpy(s2,create_chain_file("CHAIN.TXT"));
  105.      stuff_in(s,s1,s2,"","","","");
  106.      sprintf(s2,"!Ran '%s'",chains[cn].description);
  107.      sysoplog(s2);
  108.      oc=chatcall;
  109.      chatcall=0;
  110.      save_user_defaults = thisuser.sysstatus;
  111.      if (chains[cn].ansir & ansir_pause_on) {
  112.           if (sysstatus_pause_on_page & thisuser.sysstatus) {
  113.                thisuser.sysstatus ^= sysstatus_pause_on_page;
  114.           }
  115.      }
  116.      if (chains[cn].ansir & ansir_no_DOS) {
  117.           set_protect(0);
  118.           if (chains[cn].ansir & ansir_shrink)
  119.                shrink_out(s,1,0,1,1);
  120.           else
  121.                run_external(s);
  122.           topscreen();
  123.      } else
  124.           if (chains[cn].ansir & ansir_shrink)
  125.                shrink_out(s,1,1,1,1);
  126.           else
  127.                full_external(s,0,1);
  128.      chatcall=oc;
  129.      thisuser.sysstatus = save_user_defaults;
  130. }
  131.  
  132.  
  133. ------------------------------------------------------------------------
  134. Step # <SHRINK.C>: Edit according to legend at top of file.
  135.  
  136. -- #define READ(x) read(f,&(x),sizeof(x))
  137.  
  138. -- #define WRITE(x) write(f,&(x),sizeof(x))
  139. -- extern int noklevel,oklevel,ooneuser,no_hangup,ok_modem_stuff,
  140. -- extern int sysop_alert,do_event,incom,outcom,defscreenbottom,
  141. -+ extern long last_time_c, save_user_defaults;
  142. -- extern char *xenviron[50];
  143.  
  144. -- extern unsigned char andwith;
  145.  
  146. -- extern int usernum,chatcall,cursub,curdir,curdloads,msgreadlogon,
  147.  
  148.  
  149. ------------------------------------------------------------------------
  150. Step # <SHRINK.C>: Edit according to legend in int restore_data.
  151.  
  152. --        READ(xtime);
  153. --        READ(xdate);
  154. --        READ(incom);
  155. --        READ(outcom);
  156. --        READ(global_handle);
  157. ++        READ(save_user_defaults);
  158.  
  159. --        if (global_handle) {
  160. --             global_handle=0;
  161. --             set_global_handle(1);
  162. --        }
  163.  
  164. --        read_user(usernum,&thisuser);
  165. --        useron=1;
  166. --        realsl=actsl=thisuser.sl;
  167. --        changedsl();
  168. --        topscreen();
  169. --        set_baud(com_speed);
  170. ++        thisuser.sysstatus = save_user_defaults;
  171. --   }
  172.  
  173. --   close(f);
  174. --   unlink(s);
  175. --   unlink("stat.wwv");
  176.  
  177.  
  178. ------------------------------------------------------------------------
  179. Step # <SHRINK.C>: Edit according to legend in void save_state.
  180.  
  181. --        WRITE(xdate);
  182. --        WRITE(incom);
  183. --        WRITE(outcom);
  184. --        WRITE(global_handle);
  185. ++        WRITE(save_user_defaults);
  186.  
  187. --        set_global_handle(0);
  188. --   }
  189.  
  190. --   close(f);
  191.  
  192.  
  193. ------------------------------------------------------------------------
  194. Step # <SYSOPF.C>: Edit according to legend in void modify_chain.
  195.  
  196. -- #include <fcntl.h>
  197. -- #include <sys\stat.h>
  198. -- #include <time.h>
  199. -- #include <dir.h>
  200.  
  201. ++ extern long save_user_defaults;
  202. -- extern subboardrec subboards[32];
  203. -- extern directoryrec directories[64];
  204. -- extern int num_subs, num_dirs,hangup,userfile,echo,useron,wfc,
  205. -- extern int incom,fwaiting;
  206.  
  207.  
  208. ------------------------------------------------------------------------
  209. Step # <SYSOPF.C>: Edit according to legend in void modify_chain.
  210.  
  211. --              case 'H':
  212. --                   nl();
  213. --                   prt(5,"Shrink the BBS to run? ");
  214. --                   if (yn())
  215. --                        c.ansir |= ansir_shrink;
  216. --                   else
  217. --                        c.ansir &= ~ansir_shrink;
  218. --                   break;
  219. ++              case 'I':
  220. ++                   nl();
  221. ++                   prt(5,"Turn user's [PAUSE] prompt off? ");
  222. ++                   if (yn())
  223. ++                        c.ansir |= ansir_pause_on;
  224. ++                   else
  225. ++                        c.ansir &= ~ansir_pause_on;
  226. ++                   break;
  227. --         }
  228. --    } while ((!done) && (!hangup));
  229. --    chains[n]=c;
  230. -- }
  231.  
  232.  
  233. ------------------------------------------------------------------------
  234. Step # <SYSOPF.C>: Edit according to legend in void modify_chain.
  235.  
  236. --             pl("G. 300 Baud     : Allowed");
  237. --        if (c.ansir & ansir_shrink)
  238. --             pl("H. Shrink       : Yes");
  239. --        else
  240. --             pl("H. Shrink       : No");
  241. ++        if (c.ansir & ansir_pause_on)
  242. ++             pl("I. Pause Off    : Yes");
  243. ++        else
  244. ++             pl("I. Pause Off    : No");
  245. --        nl();
  246. -+        prt(2,"Which (A-I,Q) ? ");
  247. -+        ch=onek("QABCDEFGHI");
  248. --        switch(ch) {
  249. --             case 'Q':done=1; break;
  250. --             case 'A':
  251.  
  252.  
  253. ------------------------------------------------------------------------
  254. Step # <UTILITY.C>: Edit according to legend in void frequent_init.
  255.  
  256. -- void frequent_init()
  257. -- /* This should be called after a user is logged off, and will
  258. --   * initialize screen-access variables.
  259. --   */
  260. -- {
  261. ##    byline[0]=0;
  262. ++    save_user_defaults = 0;
  263. --    ansiptr=0;
  264. --    curatr=0x07;
  265. --    outcom=0;
  266.  
  267.  
  268. ------------------------------------------------------------------------
  269. Step # <UTILITY.C>: Edit according to legend at top of file.
  270.  
  271. -- #include "vardec.h"
  272. -- #include "fcns.h"
  273. -- #include "net.h"
  274.  
  275. ++ extern long save_user_defaults;
  276. -- extern int outcom,incom,dlf,okskey,input_extern,chat_file,two_color;
  277. -- extern int charbufferpointer,screenlinest,restoring_shrink;
  278. -- extern int hangup,hungup,using_modem;
  279.  
  280.  
  281. ------------------------------------------------------------------------
  282. Final Step
  283.  
  284. Compile the BBS and update your menus to reflect the changes you made...
  285.  
  286.  
  287. ------------------------------------------------------------------------
  288. Disclaimer
  289.  
  290. I, Jeff Garzik, claim no liability for this mod, or for any damage that
  291. may have resulted from the use of this mod.  I also attach no warranty,
  292. expressed OR implied, to this product.  This type of warranty and
  293. liability disclaimer is prohibited by law in certain states, and is
  294. therefore void in those states.
  295.  
  296. If you like this mod, you can call my board at:
  297.  
  298.      The East Carolina Connection
  299.      919-756-2939 :::: 2400 baud MNP level 4
  300.      24hrs a day -- 7 days a week
  301.      Autovalidation of WWIV sysops (first call)
  302.  
  303. Thanks to Wayne Bell for writing such great software!