[cvslog] (2005-06-09 02:56:54 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Wed Jun 8 20:56:54 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2005-06-09 02:56:54 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     modules/chanserv/chanserv.c modules/chanserv/events.c
     modules/server/channels.c modules/server/scriptcmds.c
     modules/server/help/en_US/commands.xml

Log message:

* Free channel stats when channel is deleted in chanserv
* Add help for some server commands

---------------------- diff included ----------------------
Index: eggdrop1.9/modules/chanserv/chanserv.c
diff -u eggdrop1.9/modules/chanserv/chanserv.c:1.4 eggdrop1.9/modules/chanserv/chanserv.c:1.5
--- eggdrop1.9/modules/chanserv/chanserv.c:1.4	Mon May 30 22:35:08 2005
+++ eggdrop1.9/modules/chanserv/chanserv.c	Wed Jun  8 21:56:44 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: chanserv.c,v 1.4 2005/05/31 03:35:08 stdarg Exp $";
+static const char rcsid[] = "$Id: chanserv.c,v 1.5 2005/06/09 02:56:44 stdarg Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -304,12 +304,32 @@
 	return(0);
 }
 
+static int free_channel(chanserv_channel_stats_t *chan)
+{
+	int i;
+
+	/* ###### test to make sure this gets called properly, remove later */
+	putlog(LOG_MISC, "*", "chanserv: freeing channel '%s'", chan->name);
+	free(chan->name);
+	for (i = 0; i < chan->nmembers; i++) {
+		free(chan->members[i].who);
+	}
+	free(chan->members);
+	if (chan->prev) chan->prev->next = chan->next;
+	else chanstats_head = chan->next;
+	if (chan->next) chan->next->prev = chan->prev;
+	free(chan);
+	return(0);
+}
+
 static int chanserv_timer(void *client_data)
 {
-	chanserv_channel_stats_t *chan;
+	chanserv_channel_stats_t *chan, *next;
 
-	for (chan = chanstats_head; chan; chan = chan->next) {
-		cleanup_old_members(chan);
+	for (chan = chanstats_head; chan; chan = next) {
+		next = chan->next;
+		if (!server->channel_lookup(chan->name)) free_channel(chan);
+		else cleanup_old_members(chan);
 	}
 	cleanup_old_members(&global_chan);
 	return(0);
Index: eggdrop1.9/modules/chanserv/events.c
diff -u eggdrop1.9/modules/chanserv/events.c:1.3 eggdrop1.9/modules/chanserv/events.c:1.4
--- eggdrop1.9/modules/chanserv/events.c:1.3	Sat May  7 23:40:12 2005
+++ eggdrop1.9/modules/chanserv/events.c	Wed Jun  8 21:56:44 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: events.c,v 1.3 2005/05/08 04:40:12 stdarg Exp $";
+static const char rcsid[] = "$Id: events.c,v 1.4 2005/06/09 02:56:44 stdarg Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -158,7 +158,7 @@
 	bind_add_simple("pubm", NULL, NULL, got_pub);
 	bind_add_simple("msgm", NULL, NULL, got_msg);
 	bind_add_simple("mode", NULL, NULL, got_mode);
-	timer_create_repeater(&howlong, "modefight_cleanup", modefight_cleanup);
+	modefight_timer_id = timer_create_repeater(&howlong, "modefight_cleanup", modefight_cleanup);
 	return(0);
 }
 
Index: eggdrop1.9/modules/server/channels.c
diff -u eggdrop1.9/modules/server/channels.c:1.36 eggdrop1.9/modules/server/channels.c:1.37
--- eggdrop1.9/modules/server/channels.c:1.36	Sat May  7 23:40:13 2005
+++ eggdrop1.9/modules/server/channels.c	Wed Jun  8 21:56:44 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: channels.c,v 1.36 2005/05/08 04:40:13 stdarg Exp $";
+static const char rcsid[] = "$Id: channels.c,v 1.37 2005/06/09 02:56:44 stdarg Exp $";
  #endif
 
 #include "server.h"
@@ -194,6 +194,7 @@
 			free(m);
 			break;
 		}
+		prev = m;
 	}
 }
 
Index: eggdrop1.9/modules/server/help/en_US/commands.xml
diff -u eggdrop1.9/modules/server/help/en_US/commands.xml:1.4 eggdrop1.9/modules/server/help/en_US/commands.xml:1.5
--- eggdrop1.9/modules/server/help/en_US/commands.xml:1.4	Sun Oct 17 00:14:07 2004
+++ eggdrop1.9/modules/server/help/en_US/commands.xml	Wed Jun  8 21:56:44 2005
@@ -120,6 +120,136 @@
 		</seealso>
 	</help>
 	<help>
+		<name>dump</name>
+		<summary>send raw text to the server</summary>
+		<args>
+			<arg>
+				<name>text</name>
+				<desc>the text to send</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The dump command sends raw text to the server. The only</line>
+			<line>change is that a CRLF (\r\n) is added to the end of the line.</line>
+		</desc>
+	</help>
+	<help>
+		<name>+chan</name>
+		<summary>add a static channel to the bot</summary>
+		<args>
+			<arg>
+				<name>channel</name>
+				<desc>channel to add</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The +chan command adds a static channel to the bot.</line>
+			<line>A static channel is a channel that the bot saves information about</line>
+			<line>and remembers even if the bot is restarted at another time.</line>
+			<line>Static channels are joined automatically unless you set the +inactive</line>
+			<line>flag on the channel.</line>
+			<line></line>
+			<line>When you add static channels, don't forget to use the chansave command</line>
+			<line>to force the bot to rewrite the channel file. Not doing so</line>
+			<line>risks losing the new information if the bot is restarted before</line>
+			<line>the channel file is saved automatically.</line>
+		</desc>
+		<seealso>
+			<see>-chan</see>
+			<see>chanset</see>
+			<see>chaninfo</see>
+			<see>chansave</see>
+		</seealso>
+	</help>
+	<help>
+		<name>-chan</name>
+		<summary>removes a static channel from the bot</summary>
+		<args>
+			<arg>
+				<name>channel</name>
+				<desc>channel to remove</desc>
+			</arg>
+			<arg>
+				<name>text</name>
+				<desc>the text of the action message</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The say command sends an action to either a nick or a channel.</line>
+			<line>It is like typing /me blah blah blah in mIRC or X-Chat.</line>
+		</desc>
+		<seealso>
+			<see>say</see>
+			<see>msg</see>
+		</seealso>
+	</help>
+	<help>
+		<name>act</name>
+		<summary>send an ACTION ctcp to a nick (or channel)</summary>
+		<args>
+			<arg>
+				<name>dest</name>
+				<desc>nick or channel to send action to</desc>
+			</arg>
+			<arg>
+				<name>text</name>
+				<desc>the text of the action message</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The say command sends an action to either a nick or a channel.</line>
+			<line>It is like typing /me blah blah blah in mIRC or X-Chat.</line>
+		</desc>
+		<seealso>
+			<see>say</see>
+			<see>msg</see>
+		</seealso>
+	</help>
+	<help>
+		<name>act</name>
+		<summary>send an ACTION ctcp to a nick (or channel)</summary>
+		<args>
+			<arg>
+				<name>dest</name>
+				<desc>nick or channel to send action to</desc>
+			</arg>
+			<arg>
+				<name>text</name>
+				<desc>the text of the action message</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The say command sends an action to either a nick or a channel.</line>
+			<line>It is like typing /me blah blah blah in mIRC or X-Chat.</line>
+		</desc>
+		<seealso>
+			<see>say</see>
+			<see>msg</see>
+		</seealso>
+	</help>
+	<help>
+		<name>act</name>
+		<summary>send an ACTION ctcp to a nick (or channel)</summary>
+		<args>
+			<arg>
+				<name>dest</name>
+				<desc>nick or channel to send action to</desc>
+			</arg>
+			<arg>
+				<name>text</name>
+				<desc>the text of the action message</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The say command sends an action to either a nick or a channel.</line>
+			<line>It is like typing /me blah blah blah in mIRC or X-Chat.</line>
+		</desc>
+		<seealso>
+			<see>say</see>
+			<see>msg</see>
+		</seealso>
+	</help>
+	<help>
 		<name>op</name>
 		<summary>give ops to a nick on a channel</summary>
 		<args>
@@ -179,7 +309,7 @@
 			<arg>
 				<name>channel</name>
 				<optional>1</optional>
-				<desc>channel to remove ops on, or partyline channel if omitted</desc>
+				<desc>channel to give voice on, or partyline channel if omitted</desc>
 			</arg>
 			<arg>
 				<name>nick</name>
@@ -199,4 +329,96 @@
 			<see>devoice</see>
 		</seealso>
 	</help>
-</helpfile>
+	<help>
+		<name>devoice</name>
+		<summary>take voice from a nick on a channel</summary>
+		<args>
+			<arg>
+				<name>channel</name>
+				<optional>1</optional>
+				<desc>channel to take voice on, or partyline channel if omitted</desc>
+			</arg>
+			<arg>
+				<name>nick</name>
+				<desc>nick to take voice to</desc>
+			</arg>
+		</args>
+		<desc>
+<line>The devoice command takes voice (-v) from the specified nick. If a</line>
+<line>channel is not specified, the current partyline channel name is</line>
+<line>used.</line>
+		</desc>
+		<seealso>
+			<see>op</see>
+			<see>deop</see>
+			<see>halfop</see>
+			<see>dehalfop</see>
+			<see>voice</see>
+		</seealso>
+	</help>
+	<help>
+		<name>msg</name>
+		<summary>send a privmsg to a nick (or channel)</summary>
+		<args>
+			<arg>
+				<name>dest</name>
+				<desc>nick or channel to send privmsg to</desc>
+			</arg>
+			<arg>
+				<name>text</name>
+				<desc>the text to send</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The msg command sends a privmsg to either a nick or a channel.</line>
+			<line>It is a synonym for the say command.</line>
+		</desc>
+		<seealso>
+			<see>say</see>
+			<see>act</see>
+		</seealso>
+	</help>
+	<help>
+		<name>say</name>
+		<summary>send a privmsg to a nick (or channel)</summary>
+		<args>
+			<arg>
+				<name>dest</name>
+				<desc>nick or channel to send privmsg to</desc>
+			</arg>
+			<arg>
+				<name>text</name>
+				<desc>the text to send</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The say command sends a privmsg to either a nick or a channel.</line>
+			<line>It is a synonym for the msg command.</line>
+		</desc>
+		<seealso>
+			<see>msg</see>
+			<see>act</see>
+		</seealso>
+	</help>
+	<help>
+		<name>act</name>
+		<summary>send an ACTION ctcp to a nick (or channel)</summary>
+		<args>
+			<arg>
+				<name>dest</name>
+				<desc>nick or channel to send action to</desc>
+			</arg>
+			<arg>
+				<name>text</name>
+				<desc>the text of the action message</desc>
+			</arg>
+		</args>
+		<desc>
+			<line>The say command sends an action to either a nick or a channel.</line>
+			<line>It is like typing /me blah blah blah in mIRC or X-Chat.</line>
+		</desc>
+		<seealso>
+			<see>say</see>
+			<see>msg</see>
+		</seealso>
+	</help>
Index: eggdrop1.9/modules/server/scriptcmds.c
diff -u eggdrop1.9/modules/server/scriptcmds.c:1.46 eggdrop1.9/modules/server/scriptcmds.c:1.47
--- eggdrop1.9/modules/server/scriptcmds.c:1.46	Mon Oct  4 10:48:30 2004
+++ eggdrop1.9/modules/server/scriptcmds.c	Wed Jun  8 21:56:44 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: scriptcmds.c,v 1.46 2004/10/04 15:48:30 stdarg Exp $";
+static const char rcsid[] = "$Id: scriptcmds.c,v 1.47 2005/06/09 02:56:44 stdarg Exp $";
 #endif
 
 #include "server.h"
@@ -44,6 +44,19 @@
 	return (current_server.strcmp)(nick1, nick2);
 }
 
+static int script_server_list(script_var_t *retval)
+{
+	server_t *s;
+
+	retval->type = SCRIPT_ARRAY | SCRIPT_FREE | SCRIPT_VAR;
+	retval->len = 0;
+
+	for (s = server_list; s; s = s->next) {
+		script_list_append(retval, script_list(3, script_string(s->host, -1), script_string(s->pass, -1), script_int(s->port)));
+	}
+	return(0);
+}
+
 static int name_to_priority(const char *queue, const char *next)
 {
 	int prio;
@@ -390,6 +403,7 @@
 
 	/* Server List commands. */
 	{"", "jump", script_jump, NULL, 0, "i", "num", SCRIPT_INTEGER, SCRIPT_VAR_ARGS | SCRIPT_PASS_COUNT},	/* DDC */
+	{"", "server_list", script_server_list, NULL, 0, "", "", 0, SCRIPT_PASS_RETVAL},
 	{"", "server_add", server_add, NULL, 1, "sis", "host ?port? ?pass?", SCRIPT_INTEGER, SCRIPT_VAR_ARGS},	/* DDC */
 	{"", "server_del", server_del, NULL, 1, "i", "server-num", SCRIPT_INTEGER, 0},				/* DDC */
 	{"", "server_clear", server_clear, NULL, 0, "", "", SCRIPT_INTEGER, 0},					/* DDC */
----------------------- End of diff -----------------------



More information about the Changes mailing list