Sfoglia il codice sorgente

Fix './wraith -V' not showing the updated HUB info

Bryan Drewery 13 anni fa
parent
commit
f73fa44715
2 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 2 0
      doc/UPDATES
  2. 8 2
      src/binary.c

+ 2 - 0
doc/UPDATES

@@ -1,3 +1,5 @@
+* Fix './wraith -V' not showing the updated HUB info
+
 1.4.1 - http://wraith.botpack.net/milestone/1.4.1
   * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
   * Remove 'chanset +meankicks'. You can customize your kicks in doc/responses.txt and recompile.

+ 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 [3]
+    printf("HUB %s %s %s\n",
+	static_cast<bd::String>(hubInfo[0]).c_str(),
+	static_cast<bd::String>(hubInfo[1]).c_str(),
+	static_cast<bd::String>(hubInfo[2]).c_str());
   }
   printf("SALT1 %s\n", salt1);
   printf("SALT2 %s\n", salt2);