Jelajahi Sumber

* All bots are now spawned with -B regardless of order in config.

svn: 1692
Bryan Drewery 21 tahun lalu
induk
melakukan
116def649a
3 mengubah file dengan 6 tambahan dan 4 penghapusan
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/conf.c
  3. 4 3
      src/main.c

+ 1 - 0
doc/UPDATES

@@ -46,6 +46,7 @@ This is a summary of ChangeLog basically.
 * Added an action when a bot performs an invite, including username and full address.
 * No longer making the bot fatal() if it cannot open a new socket.
 * Fixed NAT bug for botlinks.
+* All bots are now spawned with -B regardless of order in config.
 
 1.2
 * No longer displaying SALTS on ./bin -v

+ 1 - 1
src/conf.c

@@ -80,7 +80,7 @@ spawnbots()
         kill(bot->pid, SIGKILL);
       else
         continue;
-    } else if (!strcmp(bot->nick, conf.bot->nick) || (bot->pid && !updating)) {
+    } else if (bot->pid && !updating) {
       continue;
     } else {
       int status = 0;

+ 4 - 3
src/main.c

@@ -68,6 +68,7 @@ const time_t 	buildts = CVSBUILD;		/* build timestamp (UTC) */
 const char	egg_version[1024] = "1.2.1";
 
 bool 	localhub = 1; 		/* we set this to 0 if we get a -B */
+bool	used_B = 0;		/* did we get started with -B? */
 int 	role;
 bool 	loading = 0;
 int	default_flags = 0;	/* Default user flags and */
@@ -300,6 +301,7 @@ static void dtx_arg(int argc, char *argv[])
 #ifdef LEAF
       case 'B':
         localhub = 0;
+        used_B = 1;
         strncpyz(origbotname, optarg, NICKLEN + 1);
         break;
 #endif /* LEAF */
@@ -609,7 +611,7 @@ static void startup_checks(int hack) {
 
   fillconf(&conf);
 #ifdef LEAF
-  if (localhub) {
+  if (localhub && !used_B) {
     if (do_killbot[0]) {
       if (killbot(do_killbot) == 0)
           printf("'%s' successfully killed.\n", do_killbot);
@@ -630,8 +632,7 @@ static void startup_checks(int hack) {
       }
 #ifdef LEAF
       spawnbots();
-      if (updating)
-        exit(0); /* just let the timer restart us (our parent) */
+      exit(0); /* our job is done! */
     }
   }
   if (!localhub)		/* only clear conf on NON localhubs, we need it for cmd_conf */