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

  1. Koren #1 @7314
  2. Sat Apr 07 14:25:42 1990
  3. RE: Page Request Mod
  4.  
  5. This mod is based on the CHATCALL mod by Gord the Rogue.  I've made some
  6. changes to give it a little bit of extra function:
  7.  
  8.  
  9. The following is the basic idea of the original mod:
  10.  
  11.   - The "screeching" sounds that were made by the chat call are replaced
  12.     by a series of tones (these can be customized by changing the sound(x)
  13.     statements in the code).
  14.   - The user must wait while the sysop is being paged, which lasts for 30
  15.     seconds max.  This is to keep a user from turning on the Chat Call then
  16.     forgetting that it is turned on.
  17.   - If a user attempts to chat more than five times, he is automatically
  18.     logged off after receiving a message explaining why.
  19.  
  20.  
  21. The following changes were made to the original:
  22.  
  23.   - The user can abort the chat request by pressing SPACE
  24.   - The sysop can silence the chat bell (without the user knowing it) by
  25.     pressing F4.
  26.   - The bell will automatically be turned off if the sysop enters chat mode
  27.     by pressing F10 or Ctrl F10.
  28.   - The chat request reason will be properly displayed in the topscreen
  29.     information until the sysop turns off the chat call, the sysop accepts
  30.     the chat or the user logs off.  It will not be turned off if the user
  31.     aborts the chat request or if the chat request ends normally; this is to
  32.     give the sysop a chance to see the chat reason even if the chat call has
  33.     ended (I can't always make it to my PC in 30 seconds).
  34.   - The chat count for logging off the user is reset whenever the sysop
  35.     accepts the chat (since the user probably has a valid reason for chatting
  36.     if the sysop accepts it).
  37.  
  38. Now for the mod itself.  First load up BBSUTL.C and look at the variable
  39. declarations.  Add the following line:
  40. (Note that = designates existing code, + designates new or modded code).
  41.  
  42. = extern unsigned int modem_speed,com_speed;
  43. + extern int page_reqs;                                      /* mod - add */
  44.  
  45. Next, find void reqchat.  Replace it in it's entirety with the one shown here.
  46.  
  47. + void reqchat()                                /* mod - change entire void */
  48. + {
  49. +   int ok,count,k,abtchat;
  50. +   char s[81],ch;
  51. +
  52. +   nl();
  53. +   nl();
  54. +   ok=sysop2();
  55. +   if (restrict_chat & thisuser.restrict)
  56. +     ok=0;
  57. +   if (ok) {
  58. +     prt(2,"Reason: ");
  59. +     inputl(s,70);
  60. +     if (s[0]) {
  61. +       strcpy(chatreason,"Chat: ");
  62. +       strcat(chatreason,s);
  63. +       chatcall=1;
  64. +       nl();
  65. +       sysoplog(chatreason);
  66. +       for (ok=strlen(chatreason); ok<80; ok++)
  67. +         chatreason[ok]=32;
  68. +       chatreason[80]=0;
  69. +       topscreen();
  70. +       nl();
  71. +       page_reqs++;
  72. +       prt(2,"Sysop page will end in 30 seconds.  Press [SPACE] to abort.");
  73. +       nl(); nl();
  74. +       prt(1,"Paging Sysop.");
  75. +       count=0;
  76. +       abtchat=0;
  77. +       while ((count<60) && (!(abtchat)) && (page_reqs))
  78. +       {
  79. +         count ++;
  80. +         prt(1,".");
  81. +         if (chatcall) sound(2500); delay(125);
  82. +         if (chatcall) sound(2600); delay(125);
  83. +         if (chatcall) sound(2500); delay(125);
  84. +         if (chatcall) sound(2600); delay(125);
  85. +         ch=inkey();
  86. +         switch (ch) {
  87. +           case 3:
  88. +           case 24:
  89. +           case 32:
  90. +             abtchat=1;
  91. +             break;
  92. +         }
  93. +       }
  94. +       nosound();
  95. +       nl();
  96. +       if (abtchat)
  97. +         prt(1,"Sysop Page cancelled.");
  98. +       else
  99. +         prt(1,"Sysop Page deactivated.");
  100. +     }
  101. +   } else {
  102. +     nl();
  103. +     page_reqs++;
  104. +     prt(2,"The sysop is not available - please use feedback instead.");
  105. +     nl();
  106. +     strcpy(irt,"Tried Paging.");
  107. +     byline[0]=0;
  108. +     imail(1,0);
  109. +   }
  110. +   if (page_reqs > 5) {
  111. +     nl();
  112. +     prt(3,"Page attempts limit exceeded...logging you off.");
  113. +     hangup=1;
  114. +     thisuser.ass_pts++;
  115. +     strcpy(s,"### PAGING VIOLATION for ");
  116. +     strcat(s,nam(&thisuser,usernum));
  117. +     sl1(0,s);
  118. +   }
  119. + }
  120.  
  121. Now, save BBSUTL.C and load CONIO.C.  Make the following addition to the
  122. variable declarations at the top of the file:
  123.  
  124. = extern int screenbottom,defscreenbottom;
  125. + extern int page_reqs;                                    /* mod - add */
  126.  
  127. Next, again in CONIO.C, locate void skey(char ch).  Make the following
  128. changes:
  129.  
  130. =         case 62: /* F4 */
  131. =           chatcall=0;
  132. +           nosound();                                 /* mod - add */
  133. =           topscreen(0);
  134.  
  135. =         case 68: /* F10 */
  136. =           if (chatting==0) {
  137. +             page_reqs=0;                                /* mod - add */
  138. +             nosound();                                  /* mod - add */
  139. =             if (syscfg.sysconfig & sysconfig_2_way)
  140.  
  141. =         case 103: /* Ctrl-F10 */
  142. +           if (chatting==0) {                       /* mod - change */
  143. +             page_reqs=0;                           /* mod - add */
  144. +             nosound();                             /* mod - add */
  145. =             chat1("",0);
  146. +           } else                                   /* mod - change */
  147. =             chatting=0;
  148.  
  149. Save CONIO.C and load VARS.H.  Add the declaration for the new variable as the
  150. last line of the file:
  151.  
  152. + int page_reqs;                                        /* mod - add */
  153.  
  154. Finally, in the INIT program, turn the BEEP FOR CHAT option to NO (or you'll
  155. still get those horrible beeps).  It's a lot easier to turn it off here than
  156. turn search through the code and make the mods.  Recompile the BBS (since you
  157. changed VARS.H, everything will be recompiled, or at least it should be).
  158.  
  159.  
  160. That's about it.  If you have any questions, you can reach me at The Twilight
  161. Zone, 703-369-5225 (USR HST 9600), or E-Mail 1 @ 7312.
  162.  
  163.         Goose
  164.         7/30/89