[cvslog] (2005-11-29 01:19:04 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Mon Nov 28 19:19:04 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2005-11-29 01:19:04 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     modules/oldbotnet/oldbotnet.c modules/server/party_commands.c

Log message:

* More syntax documentation and cleanups for partyline commands.
* Added -obot partyline command for oldbotnet module.

---------------------- diff included ----------------------
Index: eggdrop1.9/modules/oldbotnet/oldbotnet.c
diff -u eggdrop1.9/modules/oldbotnet/oldbotnet.c:1.11 eggdrop1.9/modules/oldbotnet/oldbotnet.c:1.12
--- eggdrop1.9/modules/oldbotnet/oldbotnet.c:1.11	Sun Oct 17 00:14:06 2004
+++ eggdrop1.9/modules/oldbotnet/oldbotnet.c	Mon Nov 28 19:18:54 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: oldbotnet.c,v 1.11 2004/10/17 05:14:06 stdarg Exp $";
+static const char rcsid[] = "$Id: oldbotnet.c,v 1.12 2005/11/29 01:18:54 wcc Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -29,7 +29,8 @@
 static int oldbotnet_close(int why);
 
 /* Partyline commands. */
-static int party_plusobot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text);
+static int party_plus_obot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text);
+static int party_minus_obot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text);
 static int party_olink(partymember_t *p, char *nick, user_t *u, char *cmd, char *text);
 
 /* Oldbotnet commands. */
@@ -49,7 +50,8 @@
 static int oldbotnet_on_delete(void *client_data, int idx);
 
 static bind_list_t party_binds[] = {
-	{"n", "+obot", party_plusobot},		/* DDD	*/
+	{"n", "+obot", party_plus_obot},	/* DDD	*/
+	{"n", "-obot", party_minus_obot},	/* DDD	*/
 	{"n", "olink", party_olink},		/* DDD	*/
 	{0}
 };
@@ -149,7 +151,8 @@
 	return(i);
 }
 
-static int party_plusobot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text)
+/* +obot <obot> <host> <port> [username] [password] */
+static int party_plus_obot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text)
 {
 	char *name, *host, *port, *username, *password;
 	user_t *obot;
@@ -157,7 +160,7 @@
 
 	egg_get_words(text, NULL, &name, &host, &port, &username, &password, NULL);
 	if (!port) {
-		partymember_printf(p, _("Syntax: <obot> <host> <port> [username] [password]"));
+		partymember_printf(p, _("Syntax: +obot <obot> <host> <port> [username] [password]"));
 		goto done;
 	}
 
@@ -193,7 +196,37 @@
 	return(0);
 }
 
-/* Partyline command to link to a 1.6 bot. */
+/* -obot <obot> */
+static int party_minus_obot(partymember_t *p, char *nick, user_t *u, char *cmd, char *text)
+{
+	char *host;
+	user_t *obot;
+
+	while (text && isspace(*text)) text++;
+
+	if (!text || !*text) {
+		partymember_printf(p, "Syntax: -obot <obot>");
+		return(0);
+	}
+
+	obot = user_lookup_by_handle(text);
+	if (!obot) {
+		partymember_printf(p, _("Could not find user '%s'."), text);
+		return(0);
+	}
+
+	user_get_setting(obot, "oldbotnet", "host", &host);
+	if (!host) {
+		partymember_printf(p, _("Error: '%s' is not an obot."), obot->handle);
+		return(0);
+	}
+
+	partymember_printf(p, _("Deleting user '%s'."), obot->handle);
+	user_delete(obot);
+	return(BIND_RET_LOG);
+}
+
+/* olink <obot> */
 static int party_olink(partymember_t *p, char *nick, user_t *u, char *cmd, char *text)
 {
 	char *host, *port, *username, *password;
Index: eggdrop1.9/modules/server/party_commands.c
diff -u eggdrop1.9/modules/server/party_commands.c:1.23 eggdrop1.9/modules/server/party_commands.c:1.24
--- eggdrop1.9/modules/server/party_commands.c:1.23	Mon Nov 28 01:09:28 2005
+++ eggdrop1.9/modules/server/party_commands.c	Mon Nov 28 19:18:54 2005
@@ -18,11 +18,12 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: party_commands.c,v 1.23 2005/11/28 07:09:28 wcc Exp $";
+static const char rcsid[] = "$Id: party_commands.c,v 1.24 2005/11/29 01:18:54 wcc Exp $";
 #endif
 
 #include "server.h"
 
+/* servers */
 static int party_servers(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	server_t *s;
@@ -63,6 +64,7 @@
 	}
 }
 
+/* +server <host> [port] [pass] */
 static int party_plus_server(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	char *host, *pass;
@@ -86,6 +88,7 @@
 	return(BIND_RET_LOG);
 }
 
+/* -server <host> [port] [pass] */
 static int party_minus_server(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	char *host, *pass;
@@ -107,10 +110,11 @@
 	return(BIND_RET_LOG);
 }
 
+/* dump <commands> */
 static int party_dump(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	if (!text || !*text) {
-		partymember_printf(p, _("Syntax: dump <server stuff>"));
+		partymember_printf(p, _("Syntax: dump <commands>"));
 		return(0);
 	}
 
@@ -118,6 +122,7 @@
 	return(BIND_RET_LOG);
 }
 
+/* jump [host] [port] [pass] */
 static int party_jump(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	char *host, *pass;
@@ -183,36 +188,43 @@
 	return(BIND_RET_LOG);
 }
 
+/* op [channel] <nick> */
 static int party_op(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	return party_chanmembermode(p, u, cmd, text, "o", "+o");
 }
 
+/* deop [channel] <nick> */
 static int party_deop(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	return party_chanmembermode(p, u, cmd, text, "o", "-o");
 }
 
+/* halfop [channel] <nick> */
 static int party_halfop(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	return party_chanmembermode(p, u, cmd, text, "lo", "+l");
 }
 
+/* dehalfop [channel] <nick> */
 static int party_dehalfop(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	return party_chanmembermode(p, u, cmd, text, "lo", "-l");
 }
 
+/* voice [channel] <nick> */
 static int party_voice(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	return party_chanmembermode(p, u, cmd, text, "lo", "+v");
 }
 
+/* devoice [channel] <nick> */
 static int party_devoice(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	return party_chanmembermode(p, u, cmd, text, "lo", "-v");
 }
 
+/* say|msg <nick/chan> <message> */
 static int party_msg(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	char *dest;
@@ -231,6 +243,7 @@
 	return(BIND_RET_LOG);
 }
 
+/* act <nick/chan> <action> */
 static int party_act(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	char *dest;
@@ -276,13 +289,12 @@
 static int party_pls_chan(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	const char *settings;
-	char *name;
+	char *name, *key;
 	channel_t *chan;
-	char *key;
 
 	egg_get_arg(text, &settings, &name);
 	if (!name) {
-		partymember_printf(p, "Syntax: %s <channel> [settings]", cmd);
+		partymember_printf(p, "Syntax: +chan <channel> [settings]");
 		return(0);
 	}
 
@@ -298,12 +310,12 @@
 }
 
 /* -chan <name> */
-static int party_mns_chan(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
+static int party_minus_chan(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
 {
 	while (text && isspace(*text)) text++;
 
 	if (!text || !*text) {
-		partymember_printf(p, "Syntax: %s <channel>", cmd);
+		partymember_printf(p, "Syntax: -chan <channel>");
 		return(0);
 	}
 
@@ -458,7 +470,7 @@
 	{"m", "jump", party_jump},			/* DDD	*/
 	{"m", "channels", party_channels},		/* DDD	*/	/* m */
 	{"n", "+chan", party_pls_chan},			/* DDC	*/	/* n */
-	{"n", "-chan", party_mns_chan},			/* DDC	*/	/* n */
+	{"n", "-chan", party_minus_chan},			/* DDC	*/	/* n */
 	{"n", "chanset", party_chanset},		/* DDC	*/	/* n|n */
 	{"m", "chaninfo", party_chaninfo},		/* DDC	*/	/* m|m */
 	{"n", "chansave", party_chansave},		/* DDC	*/	/* n|n */
----------------------- End of diff -----------------------



More information about the Changes mailing list