Просмотр исходного кода

* Removed misc 'init' code left from eggdrop module/restart support

svn: 1775
Bryan Drewery 21 лет назад
Родитель
Сommit
57d4054e01

+ 5 - 22
src/mod/channels.mod/channels.c

@@ -32,15 +32,16 @@
 
 #include <sys/stat.h>
 
-static bool 			use_info;
+static bool 			use_info = 1;
 static char 			glob_chanmode[64];		/* Default chanmode (drummer,990731) */
 static int 			global_stopnethack_mode;
-static int 			global_revenge_mode;
+static int 			global_revenge_mode = 3;
 static int 			global_idle_kick;		/* Default idle-kick setting. */
 static time_t 			global_ban_time;
 static time_t			global_exempt_time;
 static time_t 			global_invite_time;
 
+
 /* Global channel settings (drummer/dw) */
 char glob_chanset[512] = "", cfg_glob_chanset[512] = "";
 static char *lastdeletedmask = NULL;
@@ -48,8 +49,8 @@ static char *lastdeletedmask = NULL;
 /* Global flood settings */
 static int 			gfld_chan_thr;
 static time_t 			gfld_chan_time;
-static int 			gfld_deop_thr;
-static time_t 			gfld_deop_time;
+static int 			gfld_deop_thr = 8;
+static time_t 			gfld_deop_time = 10;
 static int 			gfld_kick_thr;
 static time_t 			gfld_kick_time;
 static int 			gfld_join_thr;
@@ -911,25 +912,7 @@ cmd_t channels_bot[] = {
 
 void channels_init()
 {
-  gfld_chan_thr = 0;
-  gfld_chan_time = 0;
-  gfld_deop_thr = 8;
-  gfld_deop_time = 10;
-  gfld_kick_thr = 0;
-  gfld_kick_time = 0;
-  gfld_join_thr = 0;
-  gfld_join_time = 0;
-  gfld_ctcp_thr = 0;
-  gfld_ctcp_time = 0;
-  global_idle_kick = 0;
-  lastdeletedmask = 0;
-  use_info = 1;
   strcpy(glob_chanmode, "nt");
-  global_stopnethack_mode = 0;
-  global_revenge_mode = 3;
-  global_ban_time = 0;
-  global_exempt_time = 0;
-  global_invite_time = 0;
   strcpy(glob_chanset,
          "+enforcebans "
 	 "+dynamicbans "

+ 1 - 6
src/mod/compress.mod/compress.c

@@ -51,7 +51,7 @@
 static unsigned int compressed_files;	/* Number of files compressed.      */
 static unsigned int uncompressed_files;	/* Number of files uncompressed.    */
 static unsigned int share_compressed;	/* Compress userfiles when sharing? */
-static unsigned int compress_level;	/* Default compression used.	    */
+static unsigned int compress_level = 9;	/* Default compression used.	    */
 
 
 static int uncompress_to_file(char *f_src, char *f_target);
@@ -380,10 +380,5 @@ int compress_report(int idx, int details)
 
 void compress_init()
 {
-  compressed_files	= 0;
-  uncompressed_files	= 0;
-  share_compressed	= 0;
-  compress_level	= 9;
-
   uff_addtable(compress_uff_table);
 }

+ 1 - 2
src/mod/console.mod/console.c

@@ -233,7 +233,7 @@ static struct user_entry_type USERENTRY_CONSOLE = {
   console_write_userfile,
 #endif /* HUB */
   console_kill,
-  NULL,
+  def_get,
   console_set,
   console_display,
   "CONSOLE"
@@ -388,6 +388,5 @@ console_init()
   add_builtins("dcc", mydcc);
   add_builtins("chon", mychon);
 
-  USERENTRY_CONSOLE.get = def_get;
   add_entry_type(&USERENTRY_CONSOLE);
 }

+ 0 - 6
src/mod/irc.mod/irc.c

@@ -1533,12 +1533,6 @@ getin_5secondly()
 void
 irc_init()
 {
-  for (struct chanset_t *chan = chanset; chan; chan = chan->next) {
-    if (shouldjoin(chan))
-      dprintf(DP_MODE, "JOIN %s %s\n", (chan->name[0]) ? chan->name : chan->dname, chan->key_prot);
-    chan->status &= ~(CHAN_ACTIVE | CHAN_PEND | CHAN_ASKEDBANS);
-    chan->ircnet_status &= ~(CHAN_ASKED_INVITED | CHAN_ASKED_EXEMPTS);
-  }
   timer_create_secs(60, "irc_minutely", (Function) irc_minutely);
   timer_create_secs(5, "getin_5secondly", (Function) getin_5secondly);
 

+ 22 - 55
src/mod/server.mod/server.c

@@ -28,42 +28,40 @@
 #include <stdarg.h>
 
 bool floodless = 0;		/* floodless iline? */
-bool strict_servernames;
-bool checked_hostmask;	/* Used in request_op()/check_hostmask() cleared on connect */
+bool checked_hostmask = 0;	/* Used in request_op()/check_hostmask() cleared on connect */
 int ctcp_mode;
 int serv = -1;		/* sock # of server currently */
 int servidx = -1;		/* idx of server */
 char newserver[121] = "";	/* new server? */
-port_t newserverport;		/* new server port? */
+port_t newserverport = 0;		/* new server port? */
 char newserverpass[121] = "";	/* new server password? */
 static char serverpass[121] = "";
 static time_t trying_server;	/* trying to connect to a server right now? */
-static int curserv;		/* current position in server list: */
-int flud_thr;		/* msg flood threshold */
-time_t flud_time;		/* msg flood time */
-int flud_ctcp_thr;	/* ctcp flood threshold */
-time_t flud_ctcp_time;	/* ctcp flood time */
+static int curserv = 999;		/* current position in server list: */
+int flud_thr = 5;		/* msg flood threshold */
+time_t flud_time = 60;		/* msg flood time */
+int flud_ctcp_thr = 3;	/* ctcp flood threshold */
+time_t flud_ctcp_time = 60;	/* ctcp flood time */
 char botuserhost[UHOSTLEN] = "";	/* bot's user@host (refreshed whenever the bot joins a channel) */
 					/* may not be correct user@host BUT it's how the server sees it */
 static bool keepnick = 1;		/* keep trying to regain my intended
 				   nickname? */
 static bool nick_juped = 0;	/* True if origbotname is juped(RPL437) (dw) */
-bool quiet_reject;	/* Quietly reject dcc chat or sends from
+bool quiet_reject = 1;	/* Quietly reject dcc chat or sends from
 				   users without access? */
 static time_t waiting_for_awake;	/* set when i unidle myself, cleared when
 				   i get the response */
 time_t server_online;	/* server connection time */
 char botrealname[121] = "";	/* realname of bot */
-static time_t server_timeout;	/* server timeout for connecting */
+static time_t server_timeout = 15;	/* server timeout for connecting */
 struct server_list *serverlist = NULL;	/* old-style queue, still used by
 					   server list */
 time_t cycle_time;			/* cycle time till next server connect */
 port_t default_port;		/* default IRC port */
-static char oldnick[NICKLEN] = "";	/* previous nickname *before* rehash */
 bool trigger_on_ignore;	/* trigger bindings if user is ignored ? */
-int answer_ctcp;		/* answer how many stacked ctcp's ? */
+int answer_ctcp = 1;		/* answer how many stacked ctcp's ? */
 static bool check_mode_r;	/* check for IRCNET +r modes */
-static int net_type;
+static int net_type = NETT_EFNET;
 static bool resolvserv;		/* in the process of resolving a server host */
 static time_t lastpingtime;	/* IRCNet LAGmeter support -- drummer */
 static char stackablecmds[511] = "";
@@ -80,7 +78,7 @@ static int calc_penalty(char *);
 static bool fast_deq(int);
 static char *splitnicks(char **);
 static void msgq_clear(struct msgq_head *qh);
-static int stack_limit;
+static int stack_limit = 4;
 
 /* New bind tables. */
 static bind_table_t *BT_raw = NULL, *BT_msg = NULL;
@@ -97,7 +95,7 @@ bind_table_t *BT_ctcr = NULL, *BT_ctcp = NULL, *BT_msgc = NULL;
 #define msgrate 2
 
 /* Maximum messages to store in each queue. */
-static int maxqmsg;
+static int maxqmsg = 300;
 static struct msgq_head mq, hq, modeq;
 static int burst;
 
@@ -1018,46 +1016,22 @@ static cmd_t my_ctcps[] =
 
 void server_init()
 {
+  strcpy(botrealname, "A deranged product of evil coders");
+  strcpy(stackable2cmds, "USERHOST ISON");
+
+  mq.head = hq.head = modeq.head = NULL;
+  mq.last = hq.last = modeq.last = NULL;
+  mq.tot = hq.tot = modeq.tot = 0;
+  mq.warned = hq.warned = modeq.warned = 0;
+
   /*
    * Init of all the variables *must* be done in _start rather than
    * globally.
    */
-  botname[0] = 0;
-  trying_server = 0;
-  server_lag = 0;
-  curserv = 0;
-  flud_thr = 5;
-  flud_time = 60;
-  flud_ctcp_thr = 3;
-  flud_ctcp_time = 60;
-  quiet_reject = 1;
-  waiting_for_awake = 0;
-  server_online = 0;
-  strcpy(botrealname, "A deranged product of evil coders");
-  server_timeout = 15;
-  strict_servernames = 1;
-  serverlist = NULL;
-  cycle_time = 0;
-  oldnick[0] = 0;
-  trigger_on_ignore = 0;
-  answer_ctcp = 1;
-  check_mode_r = 0;
-  maxqmsg = 300;
-  burst = 0;
-  net_type = NETT_EFNET;
-  use_penalties = 0;
-  use_fastdeq = 0;
-  stackablecmds[0] = 0;
-  strcpy(stackable2cmds, "USERHOST ISON");
-  resolvserv = 0;
-  lastpingtime = 0;
-  last_time = 0;
-  stack_limit = 4;
 
   BT_msgc = bind_table_add("msgc", 5, "ssUss", MATCH_FLAGS, 0); 
   BT_msg = bind_table_add("msg", 4, "ssUs", MATCH_FLAGS, 0);
   BT_raw = bind_table_add("raw", 2, "ss", 0, BIND_STACKABLE);
-
   BT_ctcr = bind_table_add("ctcr", 6, "ssUsss", 0, BIND_STACKABLE);
   BT_ctcp = bind_table_add("ctcp", 6, "ssUsss", 0, BIND_STACKABLE);
 
@@ -1070,14 +1044,7 @@ void server_init()
   timer_create_secs(30, "server_check_lag", (Function) server_check_lag);
   timer_create_secs(300, "server_5minutely", (Function) server_5minutely);
   timer_create_secs(60, "minutely_checks", (Function) minutely_checks);
-  mq.head = hq.head = modeq.head = NULL;
-  mq.last = hq.last = modeq.last = NULL;
-  mq.tot = hq.tot = modeq.tot = 0;
-  mq.warned = hq.warned = modeq.warned = 0;
-  newserver[0] = 0;
-  newserverport = 0;
-  curserv = 999;
-  checked_hostmask = 0;
+
   do_nettype();
 }
 #endif /* LEAF */

+ 3 - 10
src/mod/server.mod/servmsg.c

@@ -192,16 +192,9 @@ static int got001(char *from, char *msg)
       putlog(LOG_MISC, "*", "Invalid server list!");
       return 0;
     }
-    if (x->realname)
+    if (x->realname) 
       free(x->realname);
-    if (strict_servernames == 1) {
-      x->realname = NULL;
-      if (x->name)
-	free(x->name);
-      x->name = strdup(from);
-    } else {
-      x->realname = strdup(from);
-    }
+    x->realname = strdup(from);
   }
   return 0;
 }
@@ -1081,7 +1074,7 @@ static int whoispenalty(char *from, char *msg)
 
     for (; x; x = x->next) {
       if (i == curserv) {
-        if ((strict_servernames == 1) || !x->realname) {
+        if (!x->realname) {
           if (strcmp(x->name, from))
             ii = 1;
         } else {

+ 0 - 1
src/mod/transfer.mod/transfer.c

@@ -1261,7 +1261,6 @@ void transfer_report(int idx, int details)
 
 void transfer_init()
 {
-  fileq = NULL;
 #ifdef LEAF
   server_transfer_setup(NULL);
 #endif /* LEAF */