فهرست منبع

* Add chanset '+/-protect' which will set +botbitch and mass deop if any takeover is detected.

Bryan Drewery 16 سال پیش
والد
کامیت
472fafbb29
7فایلهای تغییر یافته به همراه16 افزوده شده و 3 حذف شده
  1. 2 0
      doc/UPDATES
  2. 3 1
      doc/help.txt
  3. 2 1
      src/chan.h
  4. 2 0
      src/mod/channels.mod/channels.c
  5. 1 0
      src/mod/channels.mod/cmdschan.c
  6. 4 0
      src/mod/channels.mod/tclchan.c
  7. 2 1
      src/mod/channels.mod/userchan.c

+ 2 - 0
doc/UPDATES

@@ -1,3 +1,5 @@
+* Add chanset '+/-protect' which will set +botbitch and mass deop if any takeover is detected.
+
 1.3 - http://wraith.botpack.net/milestone/1.3
 * Binary / shell / startup changes
   * Binary error messages are no longer obscure numbers or fake segfaults. (Compile with OBSCURE_ERRORS to re-enable)

+ 3 - 1
doc/help.txt

@@ -486,7 +486,9 @@ See also: link
                        Users who lose access to a channel because of this setting
                        will see no reference to it over the botnet in any place.
                        The +o restriction goes for +v as well.
-        $brbl$b             Do RBL lookups on clients and ban on matches.
+        $bprotect$b        Set chan +botbitch and mass deop the channel if someone
+                       attempts to takeover.
+        $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
                        in the channel. After that, they will all attempt to 

+ 2 - 1
src/chan.h

@@ -230,7 +230,7 @@ struct chanset_t {
 #define CHAN_CLOSED         BIT3	/* Only users +o can join */
 #define CHAN_BITCH          BIT4	/* be a tightwad with ops             */
 #define CHAN_TAKE 	    BIT5	/* When a bot gets opped, take the chan */
-//#define CHAN_KNOCK 	    BIT6	/* Auto invite qualifying people when they knock */
+#define CHAN_PROTECT 	    BIT6	/* Go +bitch and mass deop if anyone mass ops or mass deops */
 #define CHAN_BOTBITCH       BIT7        /* only let bots be opped? */
 #define CHAN_BACKUP         BIT8	/* Join the BOT_BACKUP bots when set */
 #define CHAN_SECRET         BIT9	/* don't advertise channel on botnet  */
@@ -305,6 +305,7 @@ struct chanset_t *findchan_by_dname(const char *name);
 #define channel_nomassjoin(chan) (chan->status & CHAN_NOMASSJOIN)
 #define channel_meankicks(chan) (chan->status & CHAN_MEANKICKS)
 #define channel_rbl(chan) (chan->status & CHAN_RBL)
+#define channel_protect(chan) (chan->status & CHAN_PROTECT)
 /* Chanflag template
  *#define channel_temp(chan) (chan->status & CHAN_PRIVATE)
  */

+ 2 - 0
src/mod/channels.mod/channels.c

@@ -883,6 +883,8 @@ void channels_report(int idx, int details)
           i += my_strcpy(s + i, "meankicks ");
         if (channel_rbl(chan))
           i += my_strcpy(s + i, "rbl ");
+        if (channel_protect(chan))
+          i += my_strcpy(s + i, "protect ");
 /* Chanflag template
  *	if (channel_temp(chan))
  *	  i += my_strcpy(s + i, "temp ");

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

@@ -1249,6 +1249,7 @@ static void cmd_chaninfo(int idx, char *par)
     SHOW_FLAG("nodesynch",	channel_nodesynch(chan));
     SHOW_FLAG("nomassjoin",	channel_nomassjoin(chan));
     SHOW_FLAG("private",	channel_privchan(chan));
+    SHOW_FLAG("protect",	channel_protect(chan));
     SHOW_FLAG("rbl",		channel_rbl(chan));
 //    SHOW_FLAG("revengebot",	channel_revengebot(chan));
 //    SHOW_FLAG("revenge",	channel_revenge(chan));

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

@@ -643,6 +643,10 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
       chan->status |= CHAN_RBL;
     else if (!strcmp(item[i], "-rbl"))
       chan->status &= ~CHAN_RBL;
+    else if (!strcmp(item[i], "+protect"))
+      chan->status |= CHAN_PROTECT;
+    else if (!strcmp(item[i], "-protect"))
+      chan->status &= ~CHAN_PROTECT;
 /* Chanflag template
  *  else if (!strcmp(item[i], "+temp"))
  *    chan->status |= CHAN_TEMP;

+ 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 %c%s",
+%cfastop %cautoop %cbotbitch %cbackup %cnomassjoin %crbl %cprotect %c%s",
 	w,
 /* Chanchar template
  *      temp,
@@ -789,6 +789,7 @@ flood-exempt %d flood-lock-time %d knock %d \
         PLSMNS(channel_backup(chan)),
         PLSMNS(channel_nomassjoin(chan)),
         PLSMNS(channel_rbl(chan)),
+        PLSMNS(channel_protect(chan)),
 	HAVE_TAKE ? PLSMNS(channel_take(chan)) : ' ',
         HAVE_TAKE ? "take " : " "
 /* Chanflag template