Ver código fonte

* Add chanset 'protect-backup' which will optionally set +backup in the event of a takeover with +protect.

Bryan Drewery 16 anos atrás
pai
commit
b5371db002

+ 1 - 0
doc/UPDATES

@@ -1,4 +1,5 @@
 * Add chanset '+/-protect' which will set +botbitch and mass deop if any takeover is detected.
+* Add chanset 'protect-backup' which will optionally set +backup in the event of a takeover with +protect.
 
 1.3 - http://wraith.botpack.net/milestone/1.3
 * Binary / shell / startup changes

+ 5 - 2
doc/help.txt

@@ -355,7 +355,7 @@ See also: version, netversion, about%{+m|m}, status%{-}
 %{-}
  
 See also: link
-::chaninfo:
+::chaninfo
 ###  $bchaninfo$b <channel>
    This lists all the settings for the bot on the given channel.
    It shows any of the following:
@@ -427,6 +427,8 @@ See also: link
                           channel is set to +i. Once the channel is -i then the
                           invite will be removed the next time the bot checks.
                           Please note that this is an IRCnet feature.
+        $bprotect-backup$b    Set +backup in the even of a takeover if the
+                          channel is +protect.
         $bvoice-non-ident$b   If channel is +voice, clients without an ident will 
                           be voiced. Set to 0 to not voice clients without ident.
  
@@ -487,7 +489,8 @@ See also: link
                        will see no reference to it over the botnet in any place.
                        The +o restriction goes for +v as well.
         $bprotect$b        Set chan +botbitch and mass deop the channel if someone
-                       attempts to takeover.
+                       attempts to takeover. The channel is also set +backup
+                       if protect-backup is set.
         $brbl$b            Do RBL lookups on clients and ban on matches.
                        Uses 'rbl-servers'. See also '%dhelp set'
         $btake$b           Once a bot is opped, it will mass op all other bots

+ 1 - 0
src/chan.h

@@ -179,6 +179,7 @@ struct chanset_t {
   int ban_type;
   interval_t auto_delay;
   int knock_flags;
+  int protect_backup;
 /* Chanint template 
  *int temp;
  */

+ 1 - 1
src/chanprog.c

@@ -54,7 +54,7 @@
 #endif
 #include <sys/utsname.h>
 
-char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop +meankicks ban-type 3";
+char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop +meankicks ban-type 3 protect-backup 1";
 struct chanset_t 	*chanset = NULL;	/* Channel list			*/
 struct chanset_t	*chanset_default = NULL;	/* Default channel list */
 char 			admin[121] = "";	/* Admin info			*/

+ 1 - 0
src/mod/channels.mod/cmdschan.c

@@ -1297,6 +1297,7 @@ static void cmd_chaninfo(int idx, char *par)
     deflag = chan->mop;
     SHOW_INT("Mop: ", chan->mop, P_STR, "Ignore");
 //    SHOW_INT("Revenge-mode: ", chan->revenge_mode, NULL, NULL);
+    SHOW_INT("Protect-backup: ", chan->protect_backup, "Do!", "Don't!");
     SHOW_INT("Voice-non-ident: ", chan->voice_non_ident, "Do!", "Don't!");
 
     dprintf(idx, "Flood settings:   chan ctcp join kick deop nick mjoin\n");

+ 9 - 0
src/mod/channels.mod/tclchan.c

@@ -544,6 +544,14 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
         return ERROR;
       }
       chan->ban_type = atoi(item[i]);
+    } else if (!strcmp(item[i], "protect-backup")) {
+      i++;
+      if (i >= items) {
+        if (result)
+          strlcpy(result, "channel protect-backup needs argument", RESULT_LEN);
+        return ERROR;
+      }
+      chan->protect_backup = atoi(item[i]);
      
 
 /* Chanint template
@@ -975,6 +983,7 @@ int channel_add(char *result, char *newname, char *options, bool isdefault)
 /* Chanint template
  *  chan->temp = 0;
  */
+    chan->protect_backup = 1;
     chan->knock_flags = 0;
     chan->flood_lock_time = 120;
     chan->flood_exempt_mode = 0;

+ 2 - 1
src/mod/channels.mod/userchan.c

@@ -734,7 +734,7 @@ flood-exempt %d flood-lock-time %d knock %d \
 %cmeankicks %cenforcebans %cdynamicbans %cuserbans %cbitch \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
-%cfastop %cautoop %cbotbitch %cbackup %cnomassjoin %crbl %cprotect %c%s",
+%cfastop %cautoop %cbotbitch %cbackup %cnomassjoin %crbl %cprotect protect-backup %d %c%s",
 	w,
 /* Chanchar template
  *      temp,
@@ -790,6 +790,7 @@ flood-exempt %d flood-lock-time %d knock %d \
         PLSMNS(channel_nomassjoin(chan)),
         PLSMNS(channel_rbl(chan)),
         PLSMNS(channel_protect(chan)),
+        chan->protect_backup,
 	HAVE_TAKE ? PLSMNS(channel_take(chan)) : ' ',
         HAVE_TAKE ? "take " : " "
 /* Chanflag template