Răsfoiți Sursa

* Ported [2506] to 1.2.9 (fixes #186)

svn: 2613
Bryan Drewery 20 ani în urmă
părinte
comite
cb5c2ba3b3
5 a modificat fișierele cu 11 adăugiri și 2 ștergeri
  1. 1 0
      doc/UPDATES
  2. 3 1
      misc/help.txt
  3. 1 0
      src/binary.c
  4. 4 1
      src/set.c
  5. 2 0
      src/set.h

+ 1 - 0
doc/UPDATES

@@ -40,6 +40,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Removed some legacy code from failed relays that attempts to connect to port+1, port+2, port+3... (might fix #177)
 * Fixed an invalid killsock error in sharing.
 * Fixed chanset 'flood-*' not working correctly. (#69)
+* Fixed cmd_rehash killing hubs. And revised help for 'rehash'. (#186)
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 3 - 1
misc/help.txt

@@ -1398,8 +1398,10 @@ See also: color, console, echo, login, strip
 See also: md5, sha1, encrypt, decrypt
 ::rehash
 ###  $brehash$b 
+   Don't use this cmd if you don't know what it does.
+
    Reloads config data from binary. (Probably won't be needed as this is automatically
-   updated after editing the binary with -C
+   updated after editing the binary with -C)
  
 See also: restart
 ::relay

+ 1 - 0
src/binary.c

@@ -540,6 +540,7 @@ void reload_bin_data() {
 
     conf_bot *oldbots = NULL;
     
+    /* save the old bots list */
     oldbots = conf_bots_dup(conf.bots);
     /* free up our current conf struct */
     free_conf();

+ 4 - 1
src/set.c

@@ -81,7 +81,7 @@ static variable_t vars[] = {
  VAR("msg-invite",	msginvite,		sizeof(msginvite),		VAR_STRING|VAR_NOLHUB),
  VAR("msg-op",		msgop,			sizeof(msgop),			VAR_STRING|VAR_NOLHUB),
  VAR("msg-pass",	msgpass,		sizeof(msgpass),		VAR_STRING|VAR_NOLHUB),
- VAR("nick",		origbotname,		sizeof(origbotname),		VAR_STRING|VAR_NOLHUB|VAR_NICK|VAR_NODEF),
+ VAR("nick",		origbotname,		sizeof(origbotname),		VAR_STRING|VAR_NOLHUB|VAR_NICK|VAR_NODEF|VAR_NOGHUB),
  VAR("op-bots",		&op_bots,		0,				VAR_INT|VAR_NOLOC),
  VAR("op-requests",	&op_requests,		0,				VAR_RATE|VAR_NOLOC),
  VAR("process-list",	process_list,		sizeof(process_list),		VAR_STRING|VAR_LIST),
@@ -330,6 +330,9 @@ void var_set(variable_t *var, const char *target, const char *datain)
       return;
   }
 
+  if (conf.bot->hub && (var->flags & VAR_NOGHUB))
+    return;
+
   bool domem = 1, clear = 0;
 //  bool freedata = 0;
   char *data = (char *) datain;

+ 2 - 0
src/set.h

@@ -28,6 +28,8 @@
 /* Don't set the var data from the mem as default (NICK) */
 #define VAR_NODEF	BIT14
 #define VAR_CHANSET	BIT15
+/* Don't set global on hub */
+#define VAR_NOGHUB	BIT17
 
 #define VAR_LDATA 	1
 #define VAR_GDATA	2