Przeglądaj źródła

* During update, bot uplinks aren't permanently changed now.

svn: 2046
Bryan Drewery 21 lat temu
rodzic
commit
670e017936
4 zmienionych plików z 9 dodań i 15 usunięć
  1. 1 0
      doc/UPDATES
  2. 2 14
      src/mod/update.mod/update.c
  3. 5 1
      src/users.c
  4. 1 0
      src/users.h

+ 1 - 0
doc/UPDATES

@@ -98,6 +98,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Fixed cmd_stick/cmd_unstick not making leaf bots set/unset the masks in channels. (#41)
 * Use /tmp/ as the default tempdir until tempdir is read from config
 * Detection system run by localhub will kill all other running bots with DIE/SUICIDE now.
+* During update, bot uplinks aren't permanently changed now.
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 2 - 14
src/mod/update.mod/update.c

@@ -176,20 +176,8 @@ static void got_nu(char *botnick, char *code, char *par)
 
    if (newts > buildts) {
      if (!conf.bot->hub) {
-       struct bot_addr *obi = (struct bot_addr *) get_user(&USERENTRY_BOTADDR, conf.bot->u);
-       struct bot_addr *bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
-
-       bi->uplink = strdup(botnick);
-       if (obi) {
-         bi->address = strdup(obi->address);
-         bi->telnet_port = obi->telnet_port;
-         bi->relay_port = obi->relay_port;
-         bi->hublevel = obi->hublevel;
-       } 
-       set_user(&USERENTRY_BOTADDR, conf.bot->u, bi);
-     /* Change our uplink to them */
-     /* let cont_link restructure us.. */
-       putlog(LOG_MISC, "*", "Changed uplink to %s for update.", botnick);
+       dont_restructure = 1;
+       putlog(LOG_MISC, "*", "Linking to %s for binary update.", botnick);
        botunlink(-2, tandbot->bot, "Restructure for update.");
        usleep(1000 * 500);
        botlink("", -3, botnick);

+ 5 - 1
src/users.c

@@ -38,6 +38,7 @@
 
 char userfile[121] = "";	/* where the user records are stored */
 time_t ignore_time = 10;		/* how many minutes will ignores last? */
+bool	dont_restructure = 0;		/* set when we botlink() to a hub with +U, only stops bot from restructuring */
 
 /* is this nick!user@host being ignored? */
 bool match_ignore(char *uhost)
@@ -1077,7 +1078,7 @@ void autolink_cycle_hub(char *start)
       return;
     if (dcc[i].type == &DCC_BOT) {
       if (dcc[i].status & (STAT_OFFEREDU | STAT_GETTINGU | STAT_SENDINGU))
-        continue; /* lets let the binary have it's peace. */
+        continue; /* lets let the binary update have it's peace. */
 
       if ((bot = findbot(dcc[i].nick)) && bot->buildts != buildts)
         continue; /* same thing. */
@@ -1178,6 +1179,9 @@ void autolink_cycle_leaf(char *start)
       /* Failed a link... let's just wait for next regular call */
       return;
 
+    if (dont_restructure)
+      return;
+
     if (uplink[0]) {
       /* Trying the uplink */
       botlink("", -3, uplink);

+ 1 - 0
src/users.h

@@ -176,5 +176,6 @@ void link_pref_val(struct userrec *u, char *lval);
 
 extern char			userfile[];
 extern time_t			ignore_time;
+extern bool			dont_restructure;
 
 #endif				/* _EGG_USERS_H */