Quellcode durchsuchen

Merge branch 'v-stale-packconfig' into maint

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

Conflicts:
	doc/UPDATES
Bryan Drewery vor 13 Jahren
Ursprung
Commit
36ae195793
2 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen
  1. 1 0
      doc/UPDATES
  2. 8 2
      src/binary.c

+ 1 - 0
doc/UPDATES

@@ -9,6 +9,7 @@ maint
   * Really fix CAPS/COLOR flood detection not obeying x|x flags
   * Support TCL 8.6 in the beta libtcl support (no scripting support yet)
   * Fix hub startup not respecting changed HUB lines in config
+  * 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.

+ 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);