1
0
Эх сурвалжийг харах

* Don't consider hub linked until a userfile has been downloaded.

This will ensure that child bots linking in will never get an empty userfile.
Bryan Drewery 16 жил өмнө
parent
commit
c466ccf556

+ 4 - 2
src/dcc.c

@@ -318,14 +318,16 @@ bot_version(int idx, char *par)
     if (bot_hublevel(dcc[idx].user) < 999) {
       if (!bot_aggressive_to(dcc[idx].user)) {   //not aggressive, so they are technically my uplink.
         uplink_idx = idx;
-        have_linked_to_hub = 1;
+        // This is now done in share_endstartup
+        //have_linked_to_hub = 1;
       }
       dcc[idx].hub = 1;
     }
 
     botnet_send_nlinked(idx, dcc[idx].nick, conf.bot->nick, '!', vlocalhub, vbuildts, vcommit, vversion);
   } else {
-    have_linked_to_hub = 1;
+        // This is now done in share_endstartup
+        //have_linked_to_hub = 1;
     uplink_idx = idx;
     dcc[idx].hub = 1;
   }

+ 3 - 1
src/mod/share.mod/share.c

@@ -1062,8 +1062,10 @@ share_endstartup(int idx, char *par)
   // Share any local changes out
   dump_resync(idx);
   /* Send to any other sharebots */
-  if (conf.bot->hub || conf.bot->localhub)
+  if (conf.bot->hub || conf.bot->localhub) {
+    have_linked_to_hub = 1;
     hook_read_userfile();
+  }
 
   if (!conf.bot->hub) {
     /* Our hostmask may have been updated on connect, but the new userfile may not have it. */