]> jfr.im git - solanum.git/blobdiff - modules/m_set.c
make more snotes L_NETWIDE
[solanum.git] / modules / m_set.c
index e28b7002ef1ac0ab22ba0de1278374a9a2c2ca90..95114fdd2aa4c680571e99aa4e132432a30d7d63 100644 (file)
@@ -55,11 +55,11 @@ struct SetStruct
 {
        const char *name;
        void (*handler)(struct Client *source_p, const char *chararg, int intarg);
-       int wants_char;         /* 1 if it expects (char *, [int]) */
-       int wants_int;          /* 1 if it expects ([char *], int) */
+       bool wants_char;        /* true if it expects (char *, [int]) */
+       bool wants_int;         /* true if it expects ([char *], int) */
 
-       /* eg:  0, 1 == only an int arg
-        * eg:  1, 1 == char and int args */
+       /* eg:  false, true == only an int arg
+        * eg:  true, true  == char and int args */
 };
 
 
@@ -88,23 +88,23 @@ static void list_quote_commands(struct Client *);
  */
 
 static struct SetStruct set_cmd_table[] = {
-       /* name               function      string arg  int arg */
+       /* name               function      string arg  bool arg */
        /* -------------------------------------------------------- */
-       {"ADMINSTRING", quote_adminstring,      1,      0       },
-       {"AUTOCONN",    quote_autoconn,         1,      1       },
-       {"AUTOCONNALL", quote_autoconnall,      0,      1       },
-       {"FLOODCOUNT",  quote_floodcount,       0,      1       },
-       {"IDENTTIMEOUT", quote_identtimeout,    0,      1       },
-       {"MAX",         quote_max,              0,      1       },
-       {"MAXCLIENTS",  quote_max,              0,      1       },
-       {"OPERSTRING",  quote_operstring,       1,      0       },
-       {"SPAMNUM",     quote_spamnum,          0,      1       },
-       {"SPAMTIME",    quote_spamtime,         0,      1       },
-       {"SPLITMODE",   quote_splitmode,        1,      0       },
-       {"SPLITNUM",    quote_splitnum,         0,      1       },
-       {"SPLITUSERS",  quote_splitusers,       0,      1       },
+       {"ADMINSTRING", quote_adminstring,      true,   false   },
+       {"AUTOCONN",    quote_autoconn,         true,   true    },
+       {"AUTOCONNALL", quote_autoconnall,      false,  true    },
+       {"FLOODCOUNT",  quote_floodcount,       false,  true    },
+       {"IDENTTIMEOUT", quote_identtimeout,    false,  true    },
+       {"MAX",         quote_max,              false,  true    },
+       {"MAXCLIENTS",  quote_max,              false,  true    },
+       {"OPERSTRING",  quote_operstring,       true,   false   },
+       {"SPAMNUM",     quote_spamnum,          false,  true    },
+       {"SPAMTIME",    quote_spamtime,         false,  true    },
+       {"SPLITMODE",   quote_splitmode,        true,   false   },
+       {"SPLITNUM",    quote_splitnum,         false,  true    },
+       {"SPLITUSERS",  quote_splitusers,       false,  true    },
        /* -------------------------------------------------------- */
-       {(char *) 0, (void (*)(struct Client *, const char *, int)) 0, 0, 0}
+       {NULL,          NULL,                   false,  false   },
 };
 
 
@@ -154,7 +154,7 @@ quote_autoconnall(struct Client *source_p, const char *arg, int newval)
 {
        if(newval >= 0)
        {
-               sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has changed AUTOCONNALL to %i",
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has changed AUTOCONNALL to %i",
                                     source_p->name, newval);
 
                GlobalSetOptions.autoconn = newval;
@@ -174,7 +174,7 @@ quote_floodcount(struct Client *source_p, const char *arg, int newval)
        if(newval >= 0)
        {
                GlobalSetOptions.floodcount = newval;
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "%s has changed FLOODCOUNT to %i", source_p->name,
                                     GlobalSetOptions.floodcount);
        }
@@ -198,10 +198,11 @@ quote_identtimeout(struct Client *source_p, const char *arg, int newval)
 
        if(newval > 0)
        {
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "%s has changed IDENTTIMEOUT to %d",
                                     get_oper_name(source_p), newval);
                GlobalSetOptions.ident_timeout = newval;
+               set_authd_timeout("ident_timeout", newval);
        }
        else
                sendto_one_notice(source_p, ":IDENTTIMEOUT is currently %d",
@@ -231,7 +232,7 @@ quote_max(struct Client *source_p, const char *arg, int newval)
 
                GlobalSetOptions.maxclients = newval;
 
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "%s!%s@%s set new MAXCLIENTS to %d (%lu current)",
                                     source_p->name, source_p->username, source_p->host,
                                     GlobalSetOptions.maxclients,
@@ -259,7 +260,7 @@ quote_operstring(struct Client *source_p, const char *arg, int newval)
                rb_strlcpy(GlobalSetOptions.operstring, arg,
                        sizeof(GlobalSetOptions.operstring));
 
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "%s has changed OPERSTRING to '%s'",
                                     get_oper_name(source_p), arg);
        }
@@ -278,7 +279,7 @@ quote_adminstring(struct Client *source_p, const char *arg, int newval)
                rb_strlcpy(GlobalSetOptions.adminstring, arg,
                        sizeof(GlobalSetOptions.adminstring));
 
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "%s has changed ADMINSTRING to '%s'",
                                     get_oper_name(source_p), arg);
        }
@@ -292,7 +293,7 @@ quote_spamnum(struct Client *source_p, const char *arg, int newval)
        {
                if(newval == 0)
                {
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                             "%s has disabled ANTI_SPAMBOT", source_p->name);
                        GlobalSetOptions.spam_num = newval;
                        return;
@@ -305,7 +306,7 @@ quote_spamnum(struct Client *source_p, const char *arg, int newval)
                {
                        GlobalSetOptions.spam_num = newval;
                }
-               sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has changed SPAMNUM to %i",
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has changed SPAMNUM to %i",
                                     source_p->name, GlobalSetOptions.spam_num);
        }
        else
@@ -328,7 +329,7 @@ quote_spamtime(struct Client *source_p, const char *arg, int newval)
                {
                        GlobalSetOptions.spam_time = newval;
                }
-               sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has changed SPAMTIME to %i",
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has changed SPAMTIME to %i",
                                     source_p->name, GlobalSetOptions.spam_time);
        }
        else
@@ -371,11 +372,11 @@ quote_splitmode(struct Client *source_p, const char *charval, int intval)
                /* OFF */
                if(newval == 0)
                {
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                             "%s is disabling splitmode", get_oper_name(source_p));
 
-                       splitmode = 0;
-                       splitchecking = 0;
+                       splitmode = false;
+                       splitchecking = false;
 
                        rb_event_delete(check_splitmode_ev);
                        check_splitmode_ev = NULL;
@@ -383,12 +384,12 @@ quote_splitmode(struct Client *source_p, const char *charval, int intval)
                /* ON */
                else if(newval == 1)
                {
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                             "%s is enabling and activating splitmode",
                                             get_oper_name(source_p));
 
-                       splitmode = 1;
-                       splitchecking = 0;
+                       splitmode = true;
+                       splitchecking = false;
 
                        /* we might be deactivating an automatic splitmode, so pull the event */
                        rb_event_delete(check_splitmode_ev);
@@ -397,11 +398,11 @@ quote_splitmode(struct Client *source_p, const char *charval, int intval)
                /* AUTO */
                else if(newval == 2)
                {
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                             "%s is enabling automatic splitmode",
                                             get_oper_name(source_p));
 
-                       splitchecking = 1;
+                       splitchecking = true;
                        check_splitmode(NULL);
                }
        }
@@ -420,7 +421,7 @@ quote_splitnum(struct Client *source_p, const char *arg, int newval)
 {
        if(newval >= 0)
        {
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "%s has changed SPLITNUM to %i", source_p->name, newval);
                split_servers = newval;
 
@@ -437,7 +438,7 @@ quote_splitusers(struct Client *source_p, const char *arg, int newval)
 {
        if(newval >= 0)
        {
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "%s has changed SPLITUSERS to %i", source_p->name, newval);
                split_users = newval;