Przeglądaj źródła

* Pass burst/flood_count through restart just in case restarting in the middle of a burst

Bryan Drewery 16 lat temu
rodzic
commit
cfab76befb
3 zmienionych plików z 11 dodań i 3 usunięć
  1. 8 0
      src/misc.c
  2. 2 2
      src/mod/server.mod/server.c
  3. 1 1
      src/mod/server.mod/server.h

+ 8 - 0
src/misc.c

@@ -675,6 +675,10 @@ readsocks(const char *fname)
       rolls = atoi(str.c_str());
       rolls = atoi(str.c_str());
     else if (type == STR("+altnick_char"))
     else if (type == STR("+altnick_char"))
       altnick_char = str[0];
       altnick_char = str[0];
+    else if (type == STR("+burst"))
+      burst = atoi(str.c_str());
+    else if (type == STR("+flood_count"))
+      flood_count = atoi(str.c_str());
     else if (type == STR("+ip4"))
     else if (type == STR("+ip4"))
       ip4 = str.dup();
       ip4 = str.dup();
     else if (type == STR("+ip6"))
     else if (type == STR("+ip6"))
@@ -777,6 +781,10 @@ restart(int idx)
       stream << buf.printf(STR("+rolls %d\n"), rolls);
       stream << buf.printf(STR("+rolls %d\n"), rolls);
     if (altnick_char)
     if (altnick_char)
       stream << buf.printf(STR("+altnick_char %c\n"), altnick_char);
       stream << buf.printf(STR("+altnick_char %c\n"), altnick_char);
+    if (burst)
+      stream << buf.printf(STR("+burst %d\n"), burst);
+    if (flood_count)
+      stream << buf.printf(STR("+flood_count %d\n"), flood_count);
     stream << buf.printf(STR("+server_online %li\n"), server_online);
     stream << buf.printf(STR("+server_online %li\n"), server_online);
   }
   }
   stream << buf.printf(STR("+online_since %li\n"), online_since);
   stream << buf.printf(STR("+online_since %li\n"), online_since);

+ 2 - 2
src/mod/server.mod/server.c

@@ -97,7 +97,8 @@ static egg_timeval_t last_time;
 static time_t connect_bursting = 0;
 static time_t connect_bursting = 0;
 static int real_msgburst = 0;
 static int real_msgburst = 0;
 static int real_msgrate = 0;
 static int real_msgrate = 0;
-static int flood_count = 0;
+int flood_count = 0;
+int burst = 0;
 static bool use_flood_count = 0;
 static bool use_flood_count = 0;
 static egg_timeval_t flood_time = {0, 0};
 static egg_timeval_t flood_time = {0, 0};
 static bool use_penalties;
 static bool use_penalties;
@@ -159,7 +160,6 @@ static const struct {
 #define Q_HELP 2
 #define Q_HELP 2
 #define Q_PLAY 3
 #define Q_PLAY 3
 #define Q_CACHE 4
 #define Q_CACHE 4
-static int burst;
 
 
 #include "cmdsserv.c"
 #include "cmdsserv.c"
 
 

+ 1 - 1
src/mod/server.mod/server.h

@@ -48,7 +48,7 @@ enum {
 extern bind_table_t	*BT_ctcp, *BT_ctcr;
 extern bind_table_t	*BT_ctcp, *BT_ctcr;
 extern size_t		nick_len;
 extern size_t		nick_len;
 extern bool		trigger_on_ignore, floodless, keepnick, in_deaf, in_callerid, have_cprivmsg, have_cnotice;
 extern bool		trigger_on_ignore, floodless, keepnick, in_deaf, in_callerid, have_cprivmsg, have_cnotice;
-extern int 		servidx, ctcp_mode, answer_ctcp, serv, curserv, default_alines;
+extern int 		servidx, ctcp_mode, answer_ctcp, serv, curserv, default_alines, flood_count, burst;
 extern unsigned int     rolls;
 extern unsigned int     rolls;
 extern port_t		default_port, newserverport, curservport;
 extern port_t		default_port, newserverport, curservport;
 extern time_t		server_online, tried_jupenick, tried_nick, release_time;
 extern time_t		server_online, tried_jupenick, tried_nick, release_time;