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

* Added cmd_version (same as (bot|net)verison)

svn: 1958
Bryan Drewery 21 лет назад
Родитель
Сommit
5895489954
3 измененных файлов с 16 добавлено и 3 удалено
  1. 1 0
      doc/UPDATES
  2. 7 2
      misc/help.txt
  3. 8 1
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -51,6 +51,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Added some error logging for failed bind() listen() and getsockname()
 * Fixed DNS returning a blank reply for reverse lookups with missing records.
 * Setting -take now automatically sets +fastop as well (#13).
+* Added cmd_version (does same as .botversion)
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 7 - 2
misc/help.txt

@@ -340,7 +340,7 @@ See also: bots, downbots
 ###  $bbotversion$b <bot>
    The bot will display it's pack version and uname.
  
-See also: netversion, about%{+m|m}, status%{-}
+See also: version, netversion, about%{+m|m}, status%{-}
 :hub:chaddr
 ###  $bchaddr$b <bot> <address[:bot port[/user port]]>
    Changes the address for a bot. This is the address your bot will try to
@@ -1313,7 +1313,7 @@ See also: botserver, servers%{+n}, config%{-}
 ###  $bnetversion$b <bot>
    All bots on the botnet will display their pack version, and uname.
  
-See also: botversion, about%{+m|m}, status%{-}
+See also: botversion, version, about%{+m|m}, status%{-}
 :hub:netw:
 ###  $bnetw$b
    All bots on the botnet will run 'w' on their shell and display
@@ -1635,6 +1635,11 @@ See also: status
    will not appear in the list.
  
 See also: match, whois
+::version:
+###  $bversion$b
+   Displays the pack version and uname.
+ 
+See also: botversion, netversion, about%{+m|m}, status%{-}
 :leaf:voice
 ###  $bvoice$b <nickname> [channel|*]
     will give a +v voice to a person you specify, so long as the

+ 8 - 1
src/cmds.c

@@ -3591,8 +3591,9 @@ static void cmd_botversion(int idx, char * par) {
     dprintf(idx, "Usage: botversion <bot>\n");
     return;
   }
-  if (!egg_strcasecmp(par, conf.bot->nick) && nextbot(par)<0) {
+  if (egg_strcasecmp(par, conf.bot->nick) && nextbot(par)<0) {
     dprintf(idx, "%s isn't a linked bot\n", par);
+    return;
   }
   botnet_send_cmd(conf.bot->nick, par, dcc[idx].nick, idx, "ver");
 }
@@ -3610,6 +3611,11 @@ static void rcmd_ver(char * fbot, char * fhand, char * fidx) {
   botnet_send_cmdreply(conf.bot->nick, fbot, fhand, fidx, tmp);
 }
 
+static void cmd_version(int idx, char *par)
+{ 
+  putlog(LOG_CMDS, "*", "#%s# version", dcc[idx].nick);
+  botnet_send_cmd(conf.bot->nick, conf.bot->nick, dcc[idx].nick, idx, "ver");
+}
 
 /* netnick, botnick */
 static void cmd_netnick (int idx, char *par) {
@@ -4284,6 +4290,7 @@ cmd_t C_dcc[] =
   {"netserver", 	"m", 	(Function) cmd_netserver, 	NULL, 0},
   {"timesync",		"a",	(Function) cmd_timesync,	NULL, 0},
   {"botversion", 	"o", 	(Function) cmd_botversion, 	NULL, HUB},
+  {"version", 		"o", 	(Function) cmd_version, 	NULL, 0},
   {"netversion", 	"o", 	(Function) cmd_netversion, 	NULL, HUB},
   {"userlist", 		"m", 	(Function) cmd_userlist, 	NULL, 0},
   {"ps", 		"n", 	(Function) cmd_ps, 		NULL, 0},