[cvslog] (2003-01-15 01:03:15 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Tue Jan 14 19:04:00 CST 2003


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2003-01-15 01:03:15 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     NEWS eggdrop.conf doc/UPDATES1.6 doc/tcl-commands.doc
     doc/html/mod-server.html doc/html/news.html
     doc/html/tcl-commands.html doc/settings/mod.server
     scripts/compat.tcl src/patch.h src/mod/server.mod/server.c
     src/mod/server.mod/servmsg.c
     src/mod/server.mod/help/set/server.help

Log message:

Removed strict-servernames. $server is now always the server's realname and
$serveraddress is it's server list entry.

---------------------- diff included ----------------------
Index: eggdrop1.6/NEWS
diff -u eggdrop1.6/NEWS:1.25 eggdrop1.6/NEWS:1.26
--- eggdrop1.6/NEWS:1.25	Mon Dec 23 20:30:01 2002
+++ eggdrop1.6/NEWS	Tue Jan 14 19:03:04 2003
@@ -1,5 +1,5 @@
 News
-Last revised: June 13, 2002
+Last revised: January 14, 2002
      _________________________________________________________________
 
                                    News
@@ -128,6 +128,8 @@
      * A new 'pidfile' setting was added to allow you to specify the name
        of Eggdrop's pid file.
 
+     * The 'strict-servernames' setting was removed.
+
   PENALTY CALCULATION
 
      Eggdrop calculates penalty points on IRCnet now, so it won't
@@ -189,6 +191,12 @@
 
      * The 'channel get' command was added to allow channel settings to be
        easily retrieved.
+
+     * The 'server' variable now contains the server's realname instead of its
+       serverlist entry regardless of the 'strict-servernames' setting.
+
+     * The 'serveraddress' variable was added, which contains the server's
+       serverlist address and port.
 
      For more information about changed or added Tcl commands, see
      doc/tcl-commands.doc.
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.440 eggdrop1.6/doc/UPDATES1.6:1.441
--- eggdrop1.6/doc/UPDATES1.6:1.440	Tue Jan 14 18:35:01 2003
+++ eggdrop1.6/doc/UPDATES1.6	Tue Jan 14 19:03:04 2003
@@ -1,13 +1,16 @@
-$Id: UPDATES1.6,v 1.440 2003/01/15 00:35:01 wcc Exp $
+$Id: UPDATES1.6,v 1.441 2003/01/15 01:03:04 wcc Exp $
 
 Changes in Eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.14
 Found by  Fixed by  What...
-          BarkerJr  bind NICK mow gets triggered even if the nickname isn't
+various   darko``   removed strict-servernames -- $server is now always the
+                    server's realname and $serveraddress is it's server list
+                    entry
+          BarkerJr  bind NICK now gets triggered even if the nickname isn't
                     found in any channels (i.e. when the bot's nickname changes
-                    before it joins channels).
+                    before it joins channels)
           darko``   fixed parsing of userhosts in gotwall()
 reed      Wcc       updated UnderNet's max_bans to 45
 various   BarkerJr  config file updates
Index: eggdrop1.6/doc/html/mod-server.html
diff -u eggdrop1.6/doc/html/mod-server.html:1.21 eggdrop1.6/doc/html/mod-server.html:1.22
--- eggdrop1.6/doc/html/mod-server.html:1.21	Mon Dec 23 20:30:03 2002
+++ eggdrop1.6/doc/html/mod-server.html	Tue Jan 14 19:03:04 2003
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: mod-server.html,v 1.21 2002/12/24 02:30:03 wcc Exp $ -->
+<!-- $Id: mod-server.html,v 1.22 2003/01/15 01:03:04 wcc Exp $ -->
 
 <html>
   <head>
@@ -116,16 +116,6 @@
         <dd>
           <p>Set the default port which should be used if none is specified
           with &#39;.jump&#39; or in &#39;set servers&#39;.</p>
-        </dd>
-
-        <dt><strong>set strict-servernames 0</strong></dt>
-
-        <dd>
-          <p>Often, IRC servers call themselves a name other than their
-          actual hostname. If you want Eggdrop to replace your entry in the
-          config file with this name, set this to 1. If you set this setting
-          to 0, Eggdrop will keep a separate list of what IRC servers call
-          themselves.</p>
         </dd>
 
         <dt><strong>set server-cycle-wait 60</strong></dt>
Index: eggdrop1.6/doc/html/news.html
diff -u eggdrop1.6/doc/html/news.html:1.23 eggdrop1.6/doc/html/news.html:1.24
--- eggdrop1.6/doc/html/news.html:1.23	Mon Dec 23 20:30:03 2002
+++ eggdrop1.6/doc/html/news.html	Tue Jan 14 19:03:04 2003
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: news.html,v 1.23 2002/12/24 02:30:03 wcc Exp $ -->
+<!-- $Id: news.html,v 1.24 2003/01/15 01:03:04 wcc Exp $ -->
 
 <html>
   <head>
@@ -12,7 +12,7 @@
     </div>
     <hr>
 
-    <p><strong>News - Last revised: June 09, 2002</strong></p>
+    <p><strong>News - Last revised: January 14, 2002</strong></p>
 
     <p>What&#39;s new? First, read the following documents:</p>
 
@@ -186,6 +186,10 @@
            <p>A new &#39;pidfile&#39; setting was added to allow you to
            specify the name of Eggdrop&#39;s pid file.</p>
          </li>
+
+         <li>
+           <p>The &#39;strict-servernames&#39; setting was removed.</p>
+         </li>
        </ul>
      </blockquote>
 
@@ -297,6 +301,17 @@
           HANDLEN define in eggdrop.h. &#39;nick-len&#39; was also renamed to
           &#39;nicklen&#39; (the old variable will remain until version
           1.8.</p>
+        </li>
+
+        <li>
+          <p>The &#39;server&#39; variable now contains the server&#39;s
+          realname instead of its serverlist entry regardless of the
+          &#39;strict-servernames&#39; setting.</p>
+        </li>
+
+        <li>
+          <p>The &#39;serveraddress&#39; variable was added, which contains the
+          server&#39;s serverlist address and port.</p>
         </li>
       </ul>
       <p>For more information about changed or added Tcl commands, see
Index: eggdrop1.6/doc/html/tcl-commands.html
diff -u eggdrop1.6/doc/html/tcl-commands.html:1.24 eggdrop1.6/doc/html/tcl-commands.html:1.25
--- eggdrop1.6/doc/html/tcl-commands.html:1.24	Tue Jan 14 18:35:01 2003
+++ eggdrop1.6/doc/html/tcl-commands.html	Tue Jan 14 19:03:04 2003
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: tcl-commands.html,v 1.24 2003/01/15 00:35:01 wcc Exp $ -->
+<!-- $Id: tcl-commands.html,v 1.25 2003/01/15 01:03:04 wcc Exp $ -->
 
 <html>
   <head>
@@ -3307,11 +3307,25 @@
           <p><strong>Module:</strong> server</p>
         </dd>
 
-        <dt><strong>server</strong></dt>
+        <dt><strong>* server</strong></dt>
 
         <dd>
-          <p><strong>Value:</strong> the current server the bot is using
-          (for example: &quot;irc.math.ufl.edu:6667&quot;)</p>
+          <p><strong>Value:</strong> the current server&#39;s real name (what
+          server calls itself) and port bot is connected to (for example:
+          "irc.math.ufl.edu:6667") Note that this does not nececerilly match
+          the servers internet address.</p>
+
+          <p><strong>Module:</strong> server</p>
+        </dd>
+
+        <dt><strong>* serveraddress</strong></dt>
+
+        <dd>
+          <p><strong>Value:</strong> the current server&#39;s internet address
+          (hostname or IP) and port bot is connected to. This will correspond
+          to the entry in server list (for example: "eu.undernet.org:6667").
+          Note that this does not necessarily match the name server calls
+          itself.</p>
 
           <p><strong>Module:</strong> server</p>
         </dd>
Index: eggdrop1.6/doc/settings/mod.server
diff -u eggdrop1.6/doc/settings/mod.server:1.19 eggdrop1.6/doc/settings/mod.server:1.20
--- eggdrop1.6/doc/settings/mod.server:1.19	Mon Dec 23 20:30:04 2002
+++ eggdrop1.6/doc/settings/mod.server	Tue Jan 14 19:03:04 2003
@@ -70,12 +70,6 @@
     '.jump' or in 'set servers'.
 
 
-  set strict-servernames 0
-    Often, IRC servers call themselves a name other than their actual
-    hostname. If you want Eggdrop to replace your entry in the config
-    file with this name, set this to 1. If you set this setting to 0,
-    Eggdrop will keep a separate list of what IRC servers call themselves.
-
   set server-cycle-wait 60
     This setting defines how long Eggdrop should wait before moving from one
     server to another on disconnect. If you set 0 here, Eggdrop will not wait
Index: eggdrop1.6/doc/tcl-commands.doc
diff -u eggdrop1.6/doc/tcl-commands.doc:1.94 eggdrop1.6/doc/tcl-commands.doc:1.95
--- eggdrop1.6/doc/tcl-commands.doc:1.94	Tue Jan 14 18:35:01 2003
+++ eggdrop1.6/doc/tcl-commands.doc	Tue Jan 14 19:03:04 2003
@@ -1,5 +1,5 @@
 Eggdrop Tcl Commands
-Last revised: June 04, 2002
+Last revised: January 14, 2002
      _________________________________________________________________
 
 This is an exhaustive list of all the Tcl commands added to Eggdrop. All
@@ -1499,10 +1499,18 @@
       "Valis!valis at crappy.com")
     Module: server
 
-  server
-    Value: the current server the bot is using (for example:
-      "irc.math.ufl.edu:6667")
-    Module: server
+| server
+|   Value: the current server's real name (what server calls itself)
+|     and port bot is connected to (for example: "irc.math.ufl.edu:6667")
+|     Note that this does not nececerilly match the servers internet address.
+|   Module: server
+
+| serveraddress
+|   Value: the current server's internet address (hostname or IP) and port bot
+|     is connected to. This will correspond to the entry in server list (for
+|     example: "eu.undernet.org:6667"). Note that this does not necessarily
+|     match the name server calls itself.
+|   Module: server
 
   version
     Value: current bot version "1.1.2+pl1 1010201 pl1";
Index: eggdrop1.6/eggdrop.conf
diff -u eggdrop1.6/eggdrop.conf:1.9 eggdrop1.6/eggdrop.conf:1.10
--- eggdrop1.6/eggdrop.conf:1.9	Fri Dec 27 16:48:49 2002
+++ eggdrop1.6/eggdrop.conf	Tue Jan 14 19:03:04 2003
@@ -1,7 +1,7 @@
 #! /path/to/executable/eggdrop
 # ^- This should contain a fully qualified path to your Eggdrop executable.
 #
-# $Id: eggdrop.conf,v 1.9 2002/12/27 22:48:49 wcc Exp $
+# $Id: eggdrop.conf,v 1.10 2003/01/15 01:03:04 wcc Exp $
 #
 # This is a sample Eggdrop configuration file which includes all possible
 # settings that can be used to configure your bot.
@@ -824,12 +824,6 @@
 # This settings makes the bot cycle forever through the server list until
 # it successfully connects to one.
 set never-give-up 1
-
-# Often, IRC servers call themselves a name other than their actual
-# hostname. If you want Eggdrop to replace your entry in the config
-# file with this name, set this to 1. If you set this setting to 0,
-# Eggdrop will keep a separate list of what IRC servers call themselves.
-set strict-servernames 0
 
 # This setting defines how long Eggdrop should wait before moving from one
 # server to another on disconnect. If you set 0 here, Eggdrop will not wait
Index: eggdrop1.6/scripts/compat.tcl
diff -u eggdrop1.6/scripts/compat.tcl:1.8 eggdrop1.6/scripts/compat.tcl:1.9
--- eggdrop1.6/scripts/compat.tcl:1.8	Mon Dec 23 20:30:04 2002
+++ eggdrop1.6/scripts/compat.tcl	Tue Jan 14 19:03:04 2003
@@ -10,7 +10,7 @@
 # Tothwolf  06Oct1999: optimized
 # rtc       10Oct1999: added [set|get][dn|up]loads functions
 #
-# $Id: compat.tcl,v 1.8 2002/12/24 02:30:04 wcc Exp $
+# $Id: compat.tcl,v 1.9 2003/01/15 01:03:04 wcc Exp $
 
 proc gethosts {hand} {
   getuser $hand HOSTS
@@ -112,3 +112,9 @@
 
 bind dcc - nick *dcc:handle
 bind dcc t chnick *dcc:chhandle
+
+# Following are some TCL global variables that are obsolete now and have been removed
+# but are still defined here so not to break older scripts
+
+set strict-servernames 0
+
Index: eggdrop1.6/src/mod/server.mod/help/set/server.help
diff -u eggdrop1.6/src/mod/server.mod/help/set/server.help:1.5 eggdrop1.6/src/mod/server.mod/help/set/server.help:1.6
--- eggdrop1.6/src/mod/server.mod/help/set/server.help:1.5	Thu Feb 28 23:59:42 2002
+++ eggdrop1.6/src/mod/server.mod/help/set/server.help	Tue Jan 14 19:03:05 2003
@@ -69,14 +69,6 @@
    will change back to its intended nick within 60 seconds.
    
 see also: set nick, set altnick
-%{help=set strict-servernames}%{+n}
-###  %bset strict-servernames%b <0/1>
-   Some irc servers have different names on the IRC network to 
-   what you use to connect, and this name may not resolve,
-   hence the bot no-longer changes the server name to reflect this
-   (it does record it however), enabling this setting will cause
-   the bot to change the entry for the server the name the server
-   thinks is its name.
 %{help=set check-stoned}%{+n}
 ###  %bset check-stoned%b 0/1
    This setting, when enabled, will cause the bot to ping the server
@@ -188,4 +180,4 @@
      %bserverror-quit%b       %banswer-ctcp%b    %baltnick%b
      %btrigger-on-ignore%b    %bdefault-port%b   %brealname%b
      %bserver-cycle-wait%b    %bcheck-stoned%b   %bflood-msg%b
-     %bstrict-servernames%b   %bquiet-reject%b   %bkeep-nick
+     %bquiet-reject%b         %bkeep-nick
Index: eggdrop1.6/src/mod/server.mod/server.c
diff -u eggdrop1.6/src/mod/server.mod/server.c:1.85 eggdrop1.6/src/mod/server.mod/server.c:1.86
--- eggdrop1.6/src/mod/server.mod/server.c:1.85	Mon Dec 23 20:30:08 2002
+++ eggdrop1.6/src/mod/server.mod/server.c	Tue Jan 14 19:03:05 2003
@@ -2,7 +2,7 @@
  * server.c -- part of server.mod
  *   basic irc server support
  *
- * $Id: server.c,v 1.85 2002/12/24 02:30:08 wcc Exp $
+ * $Id: server.c,v 1.86 2003/01/15 01:03:05 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -68,7 +68,6 @@
 static int min_servs;		/* minimum number of servers to be around */
 static int server_timeout;	/* server timeout for connecting */
 static int never_give_up;	/* never give up when connecting to servers? */
-static int strict_servernames;	/* don't update server list */
 static struct server_list *serverlist;	/* old-style queue, still used by
 					   server list */
 static int cycle_time;		/* cycle time till next server connect */
@@ -1198,10 +1197,10 @@
 }
 
 #if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
-static char *traced_server(ClientData cdata, Tcl_Interp *irp,
+static char *traced_serveraddress(ClientData cdata, Tcl_Interp *irp,
                            CONST char *name1, CONST char *name2, int flags)
 #else
-static char *traced_server(ClientData cdata, Tcl_Interp *irp, char *name1,
+static char *traced_serveraddress(ClientData cdata, Tcl_Interp *irp, char *name1,
                            char *name2, int flags)
 #endif
 {
@@ -1216,6 +1215,32 @@
   Tcl_SetVar2(interp, name1, name2, s, TCL_GLOBAL_ONLY);
   if (flags & TCL_TRACE_UNSETS)
     Tcl_TraceVar(irp, name1, TCL_TRACE_READS | TCL_TRACE_WRITES |
+		 TCL_TRACE_UNSETS, traced_serveraddress, cdata);
+  return NULL;
+}
+
+#if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
+static char *traced_server(ClientData cdata, Tcl_Interp *irp,
+                           CONST char *name1, CONST char *name2, int flags)
+#else
+static char *traced_server(ClientData cdata, Tcl_Interp *irp, char *name1,
+                           char *name2, int flags)
+#endif
+{
+  char s[1024];
+
+  if (server_online) {
+    int servidx = findanyidx(serv);
+    register int i;
+    struct server_list *x = serverlist;
+    for (i=0; i < curserv; x=x->next)
+      i++;
+    simple_sprintf(s, "%s:%u", x->realname, dcc[servidx].port);  /* return real server name */
+  } else
+    s[0] = 0;
+  Tcl_SetVar2(interp, name1, name2, s, TCL_GLOBAL_ONLY);
+  if (flags & TCL_TRACE_UNSETS)
+    Tcl_TraceVar(irp, name1, TCL_TRACE_READS | TCL_TRACE_WRITES |
 		 TCL_TRACE_UNSETS, traced_server, cdata);
   return NULL;
 }
@@ -1349,7 +1374,6 @@
   {"server-online",		(int *) &server_online,		2},
   {"never-give-up",		&never_give_up,			0},
   {"keep-nick",			&keepnick,			0},
-  {"strict-servernames",	&strict_servernames,		0},
   {"check-stoned",		&check_stoned,			0},
   {"serverror-quit",		&serverror_quit,		0},
   {"quiet-reject",		&quiet_reject,			0},
@@ -1763,6 +1787,9 @@
   Tcl_UntraceVar(interp, "server",
 		 TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
 		 traced_server, NULL);
+  Tcl_UntraceVar(interp, "serveraddress",
+		 TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
+		 traced_serveraddress, NULL);
   Tcl_UntraceVar(interp, "net-type",
 		 TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
 		 traced_nettype, NULL);
@@ -1876,7 +1903,6 @@
   min_servs = 0;
   server_timeout = 60;
   never_give_up = 0;
-  strict_servernames = 0;
   serverlist = NULL;
   cycle_time = 0;
   default_port = 6667;
@@ -1927,6 +1953,9 @@
   Tcl_TraceVar(interp, "server",
 	       TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
 	       traced_server, NULL);
+  Tcl_TraceVar(interp, "serveraddress",
+	       TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
+	       traced_serveraddress, NULL);
   Tcl_TraceVar(interp, "net-type",
 	       TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
 	       traced_nettype, NULL);
Index: eggdrop1.6/src/mod/server.mod/servmsg.c
diff -u eggdrop1.6/src/mod/server.mod/servmsg.c:1.66 eggdrop1.6/src/mod/server.mod/servmsg.c:1.67
--- eggdrop1.6/src/mod/server.mod/servmsg.c:1.66	Wed Jan  1 18:07:46 2003
+++ eggdrop1.6/src/mod/server.mod/servmsg.c	Tue Jan 14 19:03:05 2003
@@ -1,7 +1,7 @@
 /*
  * servmsg.c -- part of server.mod
  *
- * $Id: servmsg.c,v 1.66 2003/01/02 00:07:46 wcc Exp $
+ * $Id: servmsg.c,v 1.67 2003/01/15 01:03:05 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -225,7 +225,7 @@
 static int got001(char *from, char *msg)
 {
   struct server_list *x;
-  int i, servidx = findanyidx(serv);
+  int i;
   struct chanset_t *chan;
 
   /* Ok...param #1 of 001 = what server thinks my nick is */
@@ -250,28 +250,17 @@
 	        (chan->name[0]) ? chan->name : chan->dname,
 	        chan->channel.key[0] ? chan->channel.key : chan->key_prot);
     }
-  if (egg_strcasecmp(from, dcc[servidx].host)) {
-    putlog(LOG_MISC, "*", "(%s claims to be %s; updating server list)",
-	   dcc[servidx].host, from);
-    for (i = curserv; i > 0 && x != NULL; i--)
-      x = x->next;
-    if (x == NULL) {
-      putlog(LOG_MISC, "*", "Invalid server list!");
-      return 0;
-    }
-    if (x->realname)
-      nfree(x->realname);
-    if (strict_servernames == 1) {
-      x->realname = NULL;
-      if (x->name)
-	nfree(x->name);
-      x->name = nmalloc(strlen(from) + 1);
-      strcpy(x->name, from);
-    } else {
-      x->realname = nmalloc(strlen(from) + 1);
-      strcpy(x->realname, from);
-    }
+
+  for (i = curserv; i > 0 && x != NULL; i--)
+    x = x->next;
+  if (x == NULL) {
+    putlog(LOG_MISC, "*", "Invalid server list!");
+    return 0;
   }
+  if (x->realname)
+    nfree(x->realname);
+  x->realname = nmalloc(strlen(from) + 1);
+  strcpy(x->realname, from);
   return 0;
 }
 
@@ -1088,23 +1077,13 @@
 static int whoispenalty(char *from, char *msg)
 {
   struct server_list *x = serverlist;
-  int i, ii;
+  int i;
 
   if (x && use_penalties) {
-    i = ii = 0;
-    for (; x; x = x->next) {
-      if (i == curserv) {
-        if ((strict_servernames == 1) || !x->realname) {
-          if (strcmp(x->name, from))
-            ii = 1;
-        } else {
-          if (strcmp(x->realname, from))
-            ii = 1;
-        }
-      }
+    i = 0;
+    for (; x && i < curserv; x = x->next)
       i++;
-    }
-    if (ii) {
+    if (strcmp(x->realname, from)) {
       last_time += 1;
       if (debug_output)
         putlog(LOG_SRVOUT, "*", "adding 1sec penalty (remote whois)");
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.868 eggdrop1.6/src/patch.h:1.869
--- eggdrop1.6/src/patch.h:1.868	Tue Jan 14 18:35:01 2003
+++ eggdrop1.6/src/patch.h	Tue Jan 14 19:03:05 2003
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.868 2003/01/15 00:35:01 wcc Exp $
+ * $Id: patch.h,v 1.869 2003/01/15 01:03:05 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1042590744");		/* current unixtime */
+patch("1042592486");		/* current unixtime */
 /*
  *
  *
  */
-patch("nickbind");
+patch("tclvar_server");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list