Ver Fonte

* Port [3345] to 1.2.14
* Add chanset 'flood-lock-time' to control how long to keep the channel locked during drone floods.



svn: 3346

Bryan Drewery há 19 anos atrás
pai
commit
cd48c406a1

+ 1 - 0
doc/UPDATES

@@ -35,6 +35,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Add channel flag 'nomassjoin' to set +im on a timer during join floods (drones)
 * Add channel flag 'nomassjoin' to set +im on a timer during join floods (drones)
 * Add BOT flag +f for handling cpu intensive floods (none supported yet)
 * Add BOT flag +f for handling cpu intensive floods (none supported yet)
 * Add chanset 'flood-exempt' to exempt ops/voices from flood controls (see 'help chaninfo')
 * Add chanset 'flood-exempt' to exempt ops/voices from flood controls (see 'help chaninfo')
+* Add chanset 'flood-lock-time' to control how long to keep the channel locked during drone floods.
 
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags
 * Fix cmd_chanset accepting invalid flags

+ 3 - 0
misc/help.txt

@@ -386,6 +386,9 @@ See also: link
                               Op/1           Ops are exempt from flood checks
                               Op/1           Ops are exempt from flood checks
                               Voice/2        Voices are exempt from flood checks
                               Voice/2        Voices are exempt from flood checks
  
  
+        $bflood-lock-time$b   How long in seconds to keep the channel locked
+                         during drone floods.
+
         $binvite-time$b       Set here how long temporary invites will last (in
         $binvite-time$b       Set here how long temporary invites will last (in
                           minutes). If you set this setting to 0, the bot will
                           minutes). If you set this setting to 0, the bot will
                           never remove them. The bot will check the invites
                           never remove them. The bot will check the invites

+ 1 - 0
src/chan.h

@@ -159,6 +159,7 @@ struct chanset_t {
   time_t flood_ctcp_time;
   time_t flood_ctcp_time;
   int flood_nick_thr;
   int flood_nick_thr;
   time_t flood_nick_time;
   time_t flood_nick_time;
+  int flood_lock_time;
   int limitraise;
   int limitraise;
   int checklimit;
   int checklimit;
   int closed_ban;
   int closed_ban;

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

@@ -1246,6 +1246,7 @@ static void cmd_chaninfo(int idx, char *par)
     SHOW_INT("Closed-Private:", chan->closed_private, NULL, "Don't!");
     SHOW_INT("Closed-Private:", chan->closed_private, NULL, "Don't!");
     SHOW_INT("Exempt-time: ", chan->exempt_time, NULL, "Forever");
     SHOW_INT("Exempt-time: ", chan->exempt_time, NULL, "Forever");
     SHOW_INT("Flood-exempt: ", chan->flood_exempt_mode, F_STR, "None");
     SHOW_INT("Flood-exempt: ", chan->flood_exempt_mode, F_STR, "None");
+    SHOW_INT("Flood-lock-time: ", chan->flood_lock_time, NULL, "Don't");
     SHOW_INT("Idle Kick after (idle-kick): ", chan->idle_kick, "", "Don't!");
     SHOW_INT("Idle Kick after (idle-kick): ", chan->idle_kick, "", "Don't!");
     SHOW_INT("Invite-time: ", chan->invite_time, NULL, "Forever");
     SHOW_INT("Invite-time: ", chan->invite_time, NULL, "Forever");
     SHOW_INT("Limit raise (limit): ", chan->limitraise, NULL, "Disabled");
     SHOW_INT("Limit raise (limit): ", chan->limitraise, NULL, "Disabled");

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

@@ -478,6 +478,15 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
           chan->flood_exempt_mode = 0;
           chan->flood_exempt_mode = 0;
       } else
       } else
         chan->flood_exempt_mode = atoi(item[i]);
         chan->flood_exempt_mode = atoi(item[i]);
+    } else if (!strcmp(item[i], "flood-lock-time")) {
+      i++;
+      if (i >= items) {
+        if (result)
+          simple_snprintf(result, RESULT_LEN, "channel flood-lock-time needs argument");
+        return ERROR;
+      }
+      chan->flood_lock_time = atoi(item[i]);
+     
 
 
 /* Chanint template
 /* Chanint template
  *  } else if (!strcmp(item[i], "temp")) {
  *  } else if (!strcmp(item[i], "temp")) {
@@ -875,6 +884,7 @@ int channel_add(char *result, char *newname, char *options)
 /* Chanint template
 /* Chanint template
  *  chan->temp = 0;
  *  chan->temp = 0;
  */
  */
+    chan->flood_lock_time = 120;
     chan->flood_exempt_mode = 0;
     chan->flood_exempt_mode = 0;
     chan->flood_pub_thr = gfld_chan_thr;
     chan->flood_pub_thr = gfld_chan_thr;
     chan->flood_pub_time = gfld_chan_time;
     chan->flood_pub_time = gfld_chan_time;

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

@@ -732,7 +732,7 @@ limit %d flood-chan %d:%lu \
 flood-ctcp %d:%lu flood-join %d:%lu flood-kick %d:%lu flood-deop %d:%lu \
 flood-ctcp %d:%lu flood-join %d:%lu flood-kick %d:%lu flood-deop %d:%lu \
 flood-nick %d:%lu closed-ban %d closed-invite %d closed-private %d ban-time %lu \
 flood-nick %d:%lu closed-ban %d closed-invite %d closed-private %d ban-time %lu \
 exempt-time %lu invite-time %lu voice-non-ident %d \
 exempt-time %lu invite-time %lu voice-non-ident %d \
-flood-exempt %d \
+flood-exempt %d flood-lock-time %d \
 %cenforcebans %cdynamicbans %cuserban %cbitch %cprotectops \
 %cenforcebans %cdynamicbans %cuserban %cbitch %cprotectops \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
@@ -769,6 +769,7 @@ flood-exempt %d \
         chan->invite_time,
         chan->invite_time,
         chan->voice_non_ident,
         chan->voice_non_ident,
         chan->flood_exempt_mode,
         chan->flood_exempt_mode,
+        chan->flood_lock_time,
  	PLSMNS(channel_enforcebans(chan)),
  	PLSMNS(channel_enforcebans(chan)),
 	PLSMNS(channel_dynamicbans(chan)),
 	PLSMNS(channel_dynamicbans(chan)),
 	PLSMNS(!channel_nouserbans(chan)),
 	PLSMNS(!channel_nouserbans(chan)),