Просмотр исходного кода

* cmd_cycle now will only cycle the net if done on the hub. Doing it on a leaf cycles only that one bot.

svn: 1985
Bryan Drewery 21 лет назад
Родитель
Сommit
1c2343ab29
3 измененных файлов с 12 добавлено и 6 удалено
  1. 1 0
      doc/UPDATES
  2. 4 2
      misc/help.txt
  3. 7 4
      src/mod/channels.mod/cmdschan.c

+ 1 - 0
doc/UPDATES

@@ -63,6 +63,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Fixed cmd_boot to allow users to boot users they can whois. (Users with lower flags)
 * Fixed a file descriptor leak in the 'last' checking.
 * Fixed bot's being tagged with op/login stats. (#22)
+* cmd_cycle now will only cycle the net if done on the hub. Doing it on a leaf cycles only that one bot.
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 4 - 2
misc/help.txt

@@ -790,8 +790,10 @@ See also: color, echo, login, page, strip
      automatically on startup.
 ::cycle:
 ###  $bcycle$b <channel> [delay]
-   Makes all linked bots cycle the specified channel. Delay defaults to 10
-   seconds, which means bots will part and not rejoin for that time.
+   If done on the hub, makes all linked bots cycle the specified channel. 
+   Otherwise, only the bot it's done on will cycle.
+   Delay defaults to 10 seconds, which means bots will part and not rejoin
+   until that time has passed.
  
 See also: down
 ::date

+ 7 - 4
src/mod/channels.mod/cmdschan.c

@@ -872,7 +872,6 @@ static void cmd_mns_chrec(int idx, char *par)
 static void cmd_cycle(int idx, char *par)
 {
   char *chname = NULL;
-  char buf2[1024] = "";
   int delay = 10;
   struct chanset_t *chan = NULL;
 
@@ -893,13 +892,17 @@ static void cmd_cycle(int idx, char *par)
   if (par[0])
     delay = atoi(newsplit(&par));
 
-  sprintf(buf2, "cycle %s %d", chname, delay); /* this just makes the bot PART */
-  putallbots(buf2);
-  if (!conf.bot->hub) {
+  if (conf.bot->hub) {
+    char buf2[1024] = "";
+
+    simple_sprintf(buf2, "cycle %s %d", chname, delay); /* this just makes the bot PART */
+    putallbots(buf2);
+  } else {
     do_chanset(NULL, chan, "+inactive", DO_LOCAL);
     dprintf(DP_SERVER, "PART %s\n", chan->name);
     chan->channel.jointime = ((now + delay) - server_lag);
   }
+  dprintf(idx, "Cycling %s for %d seconds.\n", chan->dname, delay);
 }
 
 static void cmd_down(int idx, char *par)