]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_set.c
MyMalloc -> rb_malloc
[irc/rqf/shadowircd.git] / modules / m_set.c
index 380350d6c974a44235520c5bbdd62c744f022e9d..6a72e75cf9a3d774b2faafd20c4459c956ad84be 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_set.c 3161 2007-01-25 07:23:01Z nenolod $
+ *  $Id: m_set.c 3406 2007-04-13 19:06:53Z jilles $
  */
 
 /* rewritten by jdc */
 
 #include "stdinc.h"
 #include "client.h"
-#include "event.h"
 #include "irc_string.h"
 #include "sprintf_irc.h"
 #include "ircd.h"
 #include "numeric.h"
-#include "commio.h"
 #include "s_serv.h"
 #include "send.h"
 #include "common.h"
@@ -52,7 +50,7 @@ struct Message set_msgtab = {
 };
 
 mapi_clist_av1 set_clist[] = { &set_msgtab, NULL };
-DECLARE_MODULE_AV1(set, NULL, NULL, set_clist, NULL, NULL, "$Revision: 3161 $");
+DECLARE_MODULE_AV1(set, NULL, NULL, set_clist, NULL, NULL, "$Revision: 3406 $");
 
 /* Structure used for the SET table itself */
 struct SetStruct
@@ -72,7 +70,6 @@ static void quote_autoconn(struct Client *, char *, int);
 static void quote_autoconnall(struct Client *, int);
 static void quote_floodcount(struct Client *, int);
 static void quote_identtimeout(struct Client *, int);
-static void quote_idletime(struct Client *, int);
 static void quote_max(struct Client *, int);
 static void quote_operstring(struct Client *, const char *);
 static void quote_spamnum(struct Client *, int);
@@ -99,7 +96,6 @@ static struct SetStruct set_cmd_table[] = {
        {"AUTOCONNALL", quote_autoconnall,      0,      1       },
        {"FLOODCOUNT",  quote_floodcount,       0,      1       },
        {"IDENTTIMEOUT", quote_identtimeout,    0,      1       },
-       {"IDLETIME",    quote_idletime,         0,      1       },
        {"MAX",         quote_max,              0,      1       },
        {"MAXCLIENTS",  quote_max,              0,      1       },
        {"OPERSTRING",  quote_operstring,       1,      0       },
@@ -213,50 +209,24 @@ quote_identtimeout(struct Client *source_p, int newval)
                           GlobalSetOptions.ident_timeout);
 }
 
-/* SET IDLETIME */
-static void
-quote_idletime(struct Client *source_p, int newval)
-{
-       if(newval >= 0)
-       {
-               if(newval == 0)
-               {
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                            "%s has disabled idletime checking", source_p->name);
-                       GlobalSetOptions.idletime = 0;
-               }
-               else
-               {
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                            "%s has changed IDLETIME to %i",
-                                            source_p->name, newval);
-                       GlobalSetOptions.idletime = (newval * 60);
-               }
-       }
-       else
-       {
-               sendto_one_notice(source_p, ":IDLETIME is currently %i",
-                       GlobalSetOptions.idletime / 60);
-       }
-}
-
 /* SET MAX */
 static void
 quote_max(struct Client *source_p, int newval)
 {
        if(newval > 0)
        {
-               if(newval > MASTER_MAX)
+               if(newval > ServerInfo.max_clients)
                {
-                       sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to > MASTER_MAX (%d)",
-                                  MASTER_MAX);
+                       sendto_one_notice(source_p,
+                                  ":You cannot set MAXCLIENTS to > max_clients (%d)",
+                                  ServerInfo.max_clients);
                        return;
                }
 
                if(newval < 32)
                {
-                       sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to < 32 (%d:%d)",
-                                  GlobalSetOptions.maxclients, highest_fd);
+                       sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to < 32 (%d)",
+                                  GlobalSetOptions.maxclients);
                        return;
                }
 
@@ -266,14 +236,14 @@ quote_max(struct Client *source_p, int newval)
                                     "%s!%s@%s set new MAXCLIENTS to %d (%lu current)",
                                     source_p->name, source_p->username, source_p->host,
                                     GlobalSetOptions.maxclients, 
-                                    dlink_list_length(&lclient_list));
+                                    rb_dlink_list_length(&lclient_list));
 
                return;
        }
        else
        {
                sendto_one_notice(source_p, ":Current Maxclients = %d (%lu)",
-                          GlobalSetOptions.maxclients, dlink_list_length(&lclient_list));
+                          GlobalSetOptions.maxclients, rb_dlink_list_length(&lclient_list));
        }
 }
 
@@ -408,7 +378,7 @@ quote_splitmode(struct Client *source_p, char *charval)
                        splitmode = 0;
                        splitchecking = 0;
 
-                       eventDelete(check_splitmode, NULL);
+                       rb_event_delete(check_splitmode_ev);
                }
                /* ON */
                else if(newval == 1)
@@ -421,7 +391,7 @@ quote_splitmode(struct Client *source_p, char *charval)
                        splitchecking = 0;
 
                        /* we might be deactivating an automatic splitmode, so pull the event */
-                       eventDelete(check_splitmode, NULL);
+                       rb_event_delete(check_splitmode_ev);
                }
                /* AUTO */
                else if(newval == 2)