[cvslog] (2002-09-27 19:30:42 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Fri Sep 27 14:31:00 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2002-09-27 19:30:12 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     eggdrop.simple.conf src/chan.h src/chanprog.c
     src/mod/irc.mod/chan.c src/mod/irc.mod/tclirc.c

Log message:

* Added some simple optimizations to user lookups. Only in effect for hand2nick and chattr for now.
* Added some basic sanity checks to eggdrop.simple.conf (credit for ideas to slennox)

---------------------- diff included ----------------------
Index: eggdrop1.6/eggdrop.simple.conf
diff -u eggdrop1.6/eggdrop.simple.conf:1.21 eggdrop1.6/eggdrop.simple.conf:1.22
--- eggdrop1.6/eggdrop.simple.conf:1.21	Thu Jul 25 15:44:55 2002
+++ eggdrop1.6/eggdrop.simple.conf	Fri Sep 27 14:30:02 2002
@@ -1,7 +1,7 @@
 #! /path/to/executable/eggdrop
 # ^- Set that to the directory Eggdrop is in, i.e. "#! /home/lamest/egg/eggdrop"
 #
-# $Id: eggdrop.simple.conf,v 1.21 2002/07/25 20:44:55 wcc Exp $
+# $Id: eggdrop.simple.conf,v 1.22 2002/09/27 19:30:02 stdarg Exp $
 #
 # This is a sample configuration file for your bot.  You will definitely
 # want to edit this to set up your bot. Right now, it creates a bot called
@@ -147,3 +147,19 @@
 # extra entries.
 source scripts/userinfo.tcl
 loadhelp userinfo.help
+
+#
+# Don't edit below here unless you know what you are doing!
+#
+
+if {[info exists env(USER)]} {
+	if {$username == "eggdrop"} { set username $env(USER) }
+}
+
+if {[lsearch -exact [channels] "#lamest"] != -1} {
+	putlog "***"
+	putlog "*** Are you sure you want to be on channel #lamest?"
+	putlog "***"
+	putlog "*** If not, remove 'channel add #lamest' and all of the 'channel set #lamest' examples from the config file."
+	putlog "***"
+}
Index: eggdrop1.6/src/chan.h
diff -u eggdrop1.6/src/chan.h:1.30 eggdrop1.6/src/chan.h:1.31
--- eggdrop1.6/src/chan.h:1.30	Fri Aug  2 18:50:38 2002
+++ eggdrop1.6/src/chan.h	Fri Sep 27 14:30:02 2002
@@ -3,7 +3,7 @@
  *   stuff common to chan.c and mode.c
  *   users.h needs to be loaded too
  *
- * $Id: chan.h,v 1.30 2002/08/02 23:50:38 wcc Exp $
+ * $Id: chan.h,v 1.31 2002/09/27 19:30:02 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -36,6 +36,7 @@
   time_t last;			/* for measuring idle time		*/
   time_t delay;			/* for delayed autoop			*/
   struct userrec *user;
+  int tried_getuser;
   struct memstruct *next;
 } memberlist;
 
Index: eggdrop1.6/src/chanprog.c
diff -u eggdrop1.6/src/chanprog.c:1.33 eggdrop1.6/src/chanprog.c:1.34
--- eggdrop1.6/src/chanprog.c:1.33	Sun Aug 11 13:45:52 2002
+++ eggdrop1.6/src/chanprog.c	Fri Sep 27 14:30:02 2002
@@ -7,7 +7,7 @@
  *   telling the current programmed settings
  *   initializing a lot of stuff and loading the tcl scripts
  *
- * $Id: chanprog.c,v 1.33 2002/08/11 18:45:52 wcc Exp $
+ * $Id: chanprog.c,v 1.34 2002/09/27 19:30:02 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -166,8 +166,10 @@
   register struct chanset_t	*chan;
 
   for (chan = chanset; chan; chan = chan->next)
-    for (m = chan->channel.member; m && m->nick[0]; m = m->next)
+    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
       m->user = NULL;
+      m->tried_getuser = 0;
+    }
 }
 
 /* Clear the user pointer of a specific nick in the chanlists.
@@ -184,6 +186,7 @@
     for (m = chan->channel.member; m && m->nick[0]; m = m->next)
       if (!rfc_casecmp(m->nick, nick)) {
 	m->user = NULL;
+	m->tried_getuser = 0;
 	break;
       }
 }
Index: eggdrop1.6/src/mod/irc.mod/chan.c
diff -u eggdrop1.6/src/mod/irc.mod/chan.c:1.98 eggdrop1.6/src/mod/irc.mod/chan.c:1.99
--- eggdrop1.6/src/mod/irc.mod/chan.c:1.98	Sun Sep 22 13:10:21 2002
+++ eggdrop1.6/src/mod/irc.mod/chan.c	Fri Sep 27 14:30:02 2002
@@ -6,7 +6,7 @@
  *   user kickban, kick, op, deop
  *   idle kicking
  *
- * $Id: chan.c,v 1.98 2002/09/22 18:10:21 wcc Exp $
+ * $Id: chan.c,v 1.99 2002/09/27 19:30:02 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -819,7 +819,11 @@
   /* Okay, sort through who needs to be deopped. */
   for (m = chan->channel.member; m && m->nick[0]; m = m->next) { 
     sprintf(s, "%s!%s", m->nick, m->userhost);
-    get_user_flagrec(m->user ? m->user : get_user_by_host(s), &fr, chan->dname);
+    if (!m->user && !m->tried_getuser) {
+	    m->tried_getuser = 1;
+	    m->user = get_user_by_host(s);
+    }
+    get_user_flagrec(m->user, &fr, chan->dname);
       if (glob_bot(fr) && chan_hasop(m) && !match_my_nick(m->nick))
 	stop_reset = 1;
       check_this_member(chan, m->nick, &fr);
Index: eggdrop1.6/src/mod/irc.mod/tclirc.c
diff -u eggdrop1.6/src/mod/irc.mod/tclirc.c:1.36 eggdrop1.6/src/mod/irc.mod/tclirc.c:1.37
--- eggdrop1.6/src/mod/irc.mod/tclirc.c:1.36	Thu Jul 18 14:01:45 2002
+++ eggdrop1.6/src/mod/irc.mod/tclirc.c	Fri Sep 27 14:30:02 2002
@@ -1,7 +1,7 @@
 /*
  * tclirc.c -- part of irc.mod
  *
- * $Id: tclirc.c,v 1.36 2002/07/18 19:01:45 guppy Exp $
+ * $Id: tclirc.c,v 1.37 2002/09/27 19:30:02 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -761,8 +761,9 @@
 
   while (chan && (thechan == NULL || thechan == chan)) {
     for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
-      if (!m->user) {
+      if (!m->user && !m->tried_getuser) {
 	egg_snprintf(nuh, sizeof nuh, "%s!%s", m->nick, m->userhost);
+	m->tried_getuser = 1;
 	m->user = get_user_by_host(nuh);
       }
       if (m->user && !rfc_casecmp(m->user->handle, argv[1])) {
----------------------- End of diff -----------------------



More information about the Changes mailing list