Ver Fonte

* fight-threshold is now a +protect trigger

Bryan Drewery há 16 anos atrás
pai
commit
e01ac7b97b
3 ficheiros alterados com 9 adições e 10 exclusões
  1. 1 0
      doc/UPDATES
  2. 3 2
      doc/help.txt
  3. 5 8
      src/mod/irc.mod/irc.c

+ 1 - 0
doc/UPDATES

@@ -1,6 +1,7 @@
 * 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.
 * Channel settings 'mop' and 'mdop' now react to non-users.
+* set 'fight-threshold' now requires +protect and is a trigger for +protect. See 'help chanset' for +protect info.
 
 1.3 - http://wraith.botpack.net/milestone/1.3
 * Binary / shell / startup changes

+ 3 - 2
doc/help.txt

@@ -1635,8 +1635,9 @@ See also: reload, backup
 [N]  $blag-threshold$b   Maximum acceptable server lag for the bot to send/honor requests.
 [N]  $bkill-threshold$b  When more than this many bots have been killed/klined in the last
                           minute, close all channels.
-[N]  $bfight-threshold$b When more than this many +ob/-ob/kicks have happened on a channel in 
-                          1 minute, the channel is closed.
+[N]  $bfight-threshold$b When more than this many +obeI/-obeI/kicks have happened on a channel
+                          in 1 minute, the channel is locked down. Channel must be +protect.
+                          See also '%dhelp chanset' for +protect.
  
 [N]  $bcloak-script$b    Decides which script the bot cloaks as. 
                           If set to 0, a random script will be used.

+ 5 - 8
src/mod/irc.mod/irc.c

@@ -1446,6 +1446,8 @@ static void do_protect(struct chanset_t* chan, const char* reason) {
       putlog(LOG_MISC, "*", "%s detected in %s: Setting +botbitch to protect the channel.", reason, chan->dname);
       do_chanset(NULL, chan, "+botbitch +bitch", DO_LOCAL | DO_NET);
     }
+//        enforce_closed(chan);
+//        dprintf(DP_MODE, "TOPIC %s :Auto-closed - channel fight\n", chan->name);
 //    enforce_bitch(chan);
     reversing = 1; // Reverse any modes which triggered this.
   }
@@ -1454,14 +1456,9 @@ static void do_protect(struct chanset_t* chan, const char* reason) {
 static void
 check_netfight(struct chanset_t *chan)
 {
-  if (fight_threshold) {
-    if ((chan->channel.fighting) && (chan->channel.fighting > fight_threshold)) {
-      if (!chan_bitch(chan) || !channel_closed(chan)) {
-        putlog(LOG_WARN, "*", "Auto-closed %s - channel fight", chan->dname);
-        do_chanset(NULL, chan, "+bitch +closed +backup", DO_LOCAL | DO_NET);
-        enforce_closed(chan);
-        dprintf(DP_MODE, "TOPIC %s :Auto-closed - channel fight\n", chan->name);
-      }
+  if (channel_protect(chan) && fight_threshold) {
+    if ((chan->channel.fighting) && (chan->channel.fighting > fight_threshold) && !chan_bitch(chan)) {
+      do_protect(chan, "Channel fight");
     }
   }
   chan->channel.fighting = 0;   /* we put this here because we need to clear it once per min */