[cvslog] (2003-04-07 07:20:22 UTC) Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Mon Apr 7 01:20:22 CST 2003


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2003-04-07 07:20:22 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     doc/SCRIPTING-COMMANDS modules/server/input.c
     modules/server/scriptcmds.c modules/server/servsock.c
     src/telnet.c testcode/client.c

Log message:

* Renamed match_nick to irccmp
* Added a default fake005 in case it's not set in the config file

---------------------- diff included ----------------------
Index: eggdrop1.7/doc/SCRIPTING-COMMANDS
diff -u eggdrop1.7/doc/SCRIPTING-COMMANDS:1.6 eggdrop1.7/doc/SCRIPTING-COMMANDS:1.7
--- eggdrop1.7/doc/SCRIPTING-COMMANDS:1.6	Fri Apr  4 14:41:54 2003
+++ eggdrop1.7/doc/SCRIPTING-COMMANDS	Mon Apr  7 02:20:11 2003
@@ -265,13 +265,15 @@
 
 *** SERVER MODULE COMMANDS ***
 
-  match_nick <nick1> <nick2>
-    Description: Compare nick1 and nick2 case independently, as specified by
-      the current server.
-    Notes: Should also be used for channel name matching.
-    Returns: < 0 if nick1 < nick2
-             = 0 if nick1 = nick2
-	     > 0 if nick1 > nick2
+  irccmp <str1> <str2>
+    Description: Compare str1 and str2 case independently, as specified by
+      the current server. Typical uses are comparing nicks and channel names.
+    Returns: < 0 if str1 < str2
+             = 0 if str1 = str2
+	     > 0 if str1 > str2
+
+  get_uhost <nick>
+    Returns: the uhost for the given nick, or "" if unknown
 
   putserv [noqueue|quick|normal|slow] [next] <text>
     Description: sends text to the server through the specified queue. The
@@ -299,9 +301,6 @@
 
   channel_members <chan>
     Returns: the list of nicks on the given channel
-
-  channel_get_uhost <nick>
-    Returns: the uhost for the given nick, or "" if unknown
 
   channel_topic <chan>
     Returns: the topic, nick that set the topic, time topic was set
Index: eggdrop1.7/modules/server/input.c
diff -u eggdrop1.7/modules/server/input.c:1.17 eggdrop1.7/modules/server/input.c:1.18
--- eggdrop1.7/modules/server/input.c:1.17	Mon Mar 31 23:56:02 2003
+++ eggdrop1.7/modules/server/input.c	Mon Apr  7 02:20:11 2003
@@ -65,8 +65,6 @@
 /* 001: welcome to IRC */
 static int got001(char *from_nick, char *from_uhost, user_t *u, char *cmd, int nargs, char *args[])
 {
-	char *fake;
-
 	current_server.registered = 1;
 
 	/* First arg is what server decided our nick is. */
@@ -75,12 +73,6 @@
 	/* Save the name the server calls itself. */
 	str_redup(&current_server.server_self, from_nick);
 
-	if (server_config.fake005 && server_config.fake005[0]) {
-		fake = strdup(server_config.fake005);
-		server_parse_input(fake);
-		free(fake);
-	}
-
 	check_bind_event("init-server");
 
 	/* If the init-server bind made us leave the server, stop processing. */
@@ -177,6 +169,18 @@
 	return(0);
 }
 
+static int got376(char *from_nick, char *from_uhost, user_t *u, char *cmd, int nargs, char *args[])
+{
+	char *fake;
+
+	if (server_config.fake005 && server_config.fake005[0]) {
+		fake = strdup(server_config.fake005);
+		server_parse_input(fake);
+		free(fake);
+	}
+	return(0);
+}
+
 static int check_ctcp_ctcr(int which, int to_channel, user_t *u, char *nick, char *uhost, char *dest, char *trailing)
 {
 	char *cmd, *space, *logdest, *text, *ctcptype;
@@ -515,6 +519,7 @@
 	{"ERROR", goterror},
 	{"001", got001},
 	{"005", got005},
+	{"376", got376},
 	{"432",	got432},
 	{"433",	got433},
 	{"435", got435},
Index: eggdrop1.7/modules/server/scriptcmds.c
diff -u eggdrop1.7/modules/server/scriptcmds.c:1.26 eggdrop1.7/modules/server/scriptcmds.c:1.27
--- eggdrop1.7/modules/server/scriptcmds.c:1.26	Fri Apr  4 14:41:54 2003
+++ eggdrop1.7/modules/server/scriptcmds.c	Mon Apr  7 02:20:11 2003
@@ -22,7 +22,7 @@
 
 /* FIXME: #include mess
 #ifndef lint
-static const char rcsid[] = "$Id: scriptcmds.c,v 1.26 2003/04/04 20:41:54 stdarg Exp $";
+static const char rcsid[] = "$Id: scriptcmds.c,v 1.27 2003/04/07 07:20:11 stdarg Exp $";
 #endif
 */
 
@@ -56,7 +56,7 @@
 	return match_my_nick(nick);
 }
 
-static int script_match_nick(char *nick1, char *nick2)
+static int script_irccmp(char *nick1, char *nick2)
 {
 	return (current_server.strcmp)(nick1, nick2);
 }
@@ -330,7 +330,8 @@
 static script_command_t server_script_cmds[] = {
         {"", "jump", script_jump, NULL, 0, "i", "num", SCRIPT_INTEGER, SCRIPT_VAR_ARGS | SCRIPT_PASS_COUNT},
         {"", "isbotnick", script_isbotnick, NULL, 1, "s", "nick", SCRIPT_INTEGER, 0},
-	{"", "match_nick", script_match_nick, NULL, 2, "ss", "nick1 nick2", SCRIPT_INTEGER, 0},
+	{"", "irccmp", script_irccmp, NULL, 2, "ss", "str1 str2", SCRIPT_INTEGER, 0},
+	{"", "get_uhost", uhost_cache_lookup, NULL, 1, "s", "nick", SCRIPT_STRING, 0},
 	{"", "server_add", server_add, NULL, 1, "sis", "host ?port? ?pass?", SCRIPT_INTEGER, SCRIPT_VAR_ARGS},
 	{"", "server_del", server_del, NULL, 1, "i", "server-num", SCRIPT_INTEGER, 0},
 	{"", "server_clear", server_clear, NULL, 0, "", "", SCRIPT_INTEGER, 0},
@@ -351,7 +352,6 @@
 	/* Channel commands. */
 	{"", "channel_list", script_channel_list, NULL, 0, "", "", 0, SCRIPT_PASS_RETVAL},
 	{"", "channel_members", script_channel_members, NULL, 1, "s", "channel", 0, SCRIPT_PASS_RETVAL},
-	{"", "channel_get_uhost", uhost_cache_lookup, NULL, 1, "s", "nick", SCRIPT_STRING, 0},
 	{"", "channel_topic", script_channel_topic, NULL, 1, "s", "channel", 0, SCRIPT_PASS_RETVAL},
 	{"", "channel_bans", script_channel_bans, NULL, 1, "s", "channel", 0, SCRIPT_PASS_RETVAL},
 	{"", "channel_mode", script_channel_mode, NULL, 1, "ss", "channel ?nick?", SCRIPT_STRING|SCRIPT_FREE, SCRIPT_VAR_ARGS},
Index: eggdrop1.7/modules/server/servsock.c
diff -u eggdrop1.7/modules/server/servsock.c:1.11 eggdrop1.7/modules/server/servsock.c:1.12
--- eggdrop1.7/modules/server/servsock.c:1.11	Thu Mar  6 03:15:33 2003
+++ eggdrop1.7/modules/server/servsock.c	Mon Apr  7 02:20:11 2003
@@ -47,6 +47,7 @@
 	str_redup(&current_server.server_self, serv->host);
 	str_redup(&current_server.pass, serv->pass);
 	current_server.strcmp = strcasecmp;
+	if (!server_config.fake005) server_config.fake005 = strdup(":fakeserver 005 fakenick MODES=3 MAXCHANNELS=10 MAXBANS=100 NICKLEN=9 TOPICLEN=307 KICKLEN=307 CHANTYPES=#& PREFIX=(ov)@+ NETWORK=fakenetwork CASEMAPPING=rfc1459 CHANMODES=b,k,l,imnprst :are available on this server");
 
 	if (serv->port) current_server.port = serv->port;
 	else current_server.port = server_config.default_port;
Index: eggdrop1.7/src/telnet.c
diff -u eggdrop1.7/src/telnet.c:1.3 eggdrop1.7/src/telnet.c:1.4
--- eggdrop1.7/src/telnet.c:1.3	Mon Feb 10 20:32:05 2003
+++ eggdrop1.7/src/telnet.c	Mon Apr  7 02:20:11 2003
@@ -141,6 +141,7 @@
 {
 	telnet_session_t *session = client_data;
 
+	if (!host) host = ip;
 	session->host = strdup(host);
 	process_results(session);
 	return(0);
Index: eggdrop1.7/testcode/client.c
diff -u eggdrop1.7/testcode/client.c:1.8 eggdrop1.7/testcode/client.c:1.9
--- eggdrop1.7/testcode/client.c:1.8	Sun Aug 11 15:50:35 2002
+++ eggdrop1.7/testcode/client.c	Mon Apr  7 02:20:11 2003
@@ -22,8 +22,8 @@
 int server_connect(void *client_data, int idx, const char *peer_ip, int peer_port)
 {
 	printf("Connected to server (%s %d)!\n", peer_ip, peer_port);
-	sslmode_on(idx, 0); /* 0 means client, 1 means server */
-	zipmode_on(idx);
+	//sslmode_on(idx, 0); /* 0 means client, 1 means server */
+	//zipmode_on(idx);
 	linemode_on(idx);
 	return(0);
 }
@@ -81,7 +81,7 @@
 	server_idx = sockbuf_new();
 	sockbuf_set_sock(server_idx, sock, SOCKBUF_CLIENT);
 	sockbuf_set_handler(server_idx, &server_event, NULL);
-	sslmode_init();
+	//sslmode_init();
 
 	stdin_idx = sockbuf_new();
 	socket_set_nonblock(0, 1);
----------------------- End of diff -----------------------


More information about the Changes mailing list