]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add an option to allow disengaging joinflood on initial boot.
authorSadie Powell <sadie@witchery.services>
Mon, 12 Oct 2020 17:47:21 +0000 (18:47 +0100)
committerSadie Powell <sadie@witchery.services>
Mon, 12 Oct 2020 17:47:21 +0000 (18:47 +0100)
docs/conf/modules.conf.example
src/modules/m_joinflood.cpp

index a1bd056708da0d3f3025bf3267ca82bf5415f026..5db81955764afb8148403da6d334ab2310d83978 100644 (file)
 # duration:  The number of seconds to close a channel for when it is
 #            being flooded with joins.
 #
+# bootwait:  The number of seconds to disengage joinflood for after
+#            a server boots. This allows users to reconnect without
+#            being throttled by joinflood.
+#
 # splitwait: The number of seconds to disengage joinflood for after
 #            a server splits. This allows users to reconnect without
 #            being throttled by joinflood.
 #
 #<joinflood duration="1m"
+#           bootwait="30s"
 #           splitwait="30s">
 
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
index e5af2a4c671b847057480463d60f47407d0e9bc6..28b12a0860ad29f5e324ac3782195ca483655c4c 100644 (file)
@@ -139,6 +139,7 @@ class ModuleJoinFlood
  private:
        JoinFlood jf;
        time_t ignoreuntil;
+       unsigned long bootwait;
        unsigned long splitwait;
 
  public:
@@ -156,7 +157,10 @@ class ModuleJoinFlood
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("joinflood");
                duration = tag->getDuration("duration", 60, 10, 600);
+               bootwait = tag->getDuration("bootwait", 30);
                splitwait = tag->getDuration("splitwait", 30);
+
+               ignoreuntil = ServerInstance->startup_time + bootwait;
        }
 
        void OnServerSplit(const Server* server, bool error) CXX11_OVERRIDE