فهرست منبع

Merge branch 'v-stale-packconfig' into next

* v-stale-packconfig:
  Use simpler method of removing hublevel
  Fix './wraith -V' not showing the updated HUB info

Conflicts:
	doc/UPDATES
Bryan Drewery 13 سال پیش
والد
کامیت
694b26e574
2فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 1 0
      doc/UPDATES
  2. 8 2
      src/binary.c

+ 1 - 0
doc/UPDATES

@@ -2,6 +2,7 @@ next
   * Bot will now jump from the server it's on if it is removed from the server list. (fixes a changing network bug)
   * Properly honor exemptions when kicking matched RBL clients
   * Fix LASTON not being shared
+  * Fix './wraith -V' not showing the updated HUB info
 
 maint
   * Prevent crashing on startup if openssl can not be loaded

+ 8 - 2
src/binary.c

@@ -479,7 +479,8 @@ void writecfg() {
   const char salt1[] = SALT1;
   const char salt2[] = SALT2;
   bd::Array<bd::String> owners(bd::String(settings.owners).split(","));
-  bd::Array<bd::String> hubs(bd::String(settings.hubs).split(","));
+  const bd::Array<bd::String> hubs(conf.hubs);
+  bd::Array<bd::String> hubInfo;
 
   printf("PACKNAME %s\n", settings.packname);
   // Display the shellhash as salted-sha1 if it is not already
@@ -496,7 +497,12 @@ void writecfg() {
     printf("OWNER %s\n", ownerInfo.join(" ").c_str());
   }
   for (size_t i = 0; i < hubs.length(); ++i) {
-    printf("HUB %s\n", static_cast<bd::String>(hubs[i]).c_str());
+    hubInfo = static_cast<bd::String>(hubs[i]).split(' ');
+    // Trim away hublevel
+    if (hubInfo.length() == 4) {
+      hubInfo.resize(3);
+    }
+    printf("HUB %s\n", static_cast<bd::String>(hubInfo.join(" ")).c_str());
   }
   printf("SALT1 %s\n", salt1);
   printf("SALT2 %s\n", salt2);