[cvslog] (2002-09-20 21:42:00 UTC) Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Fri Sep 20 16:42:01 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2002-09-20 21:41:59 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     lib/eggdrop/botnetutil.c lib/eggdrop/module.h modules/Makefile.am
     src/Makefile.am src/cmds.c src/dcc.c src/dccutil.c src/dccutil.h
     src/main.c src/misc.c src/modules.c src/tcl.c src/tcldcc.c
     src/tclmisc.c src/tcluser.c src/userrec.c src/users.c src/users.h

Log message:

* Mo-Ize removed the botnet code, thanks

---------------------- diff included ----------------------
Index: eggdrop1.7/lib/eggdrop/botnetutil.c
diff -u eggdrop1.7/lib/eggdrop/botnetutil.c:1.4 eggdrop1.7/lib/eggdrop/botnetutil.c:1.5
--- eggdrop1.7/lib/eggdrop/botnetutil.c:1.4	Sun May  5 11:40:32 2002
+++ eggdrop1.7/lib/eggdrop/botnetutil.c	Fri Sep 20 16:41:49 2002
@@ -23,7 +23,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: botnetutil.c,v 1.4 2002/05/05 16:40:32 tothwolf Exp $";
+static const char rcsid[] = "$Id: botnetutil.c,v 1.5 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #if HAVE_CONFIG_H
@@ -41,6 +41,35 @@
   '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
   '[', ']'
 };
+
+static char base64toarray[256] =
+{
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0,
+  0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+  15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 62, 0, 63, 0, 0, 0, 26, 27, 28,
+  29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+  49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+int base64_to_int(char *buf)
+{
+  int i = 0;
+
+  while (*buf) {
+    i = i << 6;
+    i += base64toarray[(int) *buf];
+    buf++;
+  }
+  return i;
+}
 
 char *int_to_base64(unsigned int val)
 {
Index: eggdrop1.7/lib/eggdrop/module.h
diff -u eggdrop1.7/lib/eggdrop/module.h:1.29 eggdrop1.7/lib/eggdrop/module.h:1.30
--- eggdrop1.7/lib/eggdrop/module.h:1.29	Fri Sep 20 15:18:22 2002
+++ eggdrop1.7/lib/eggdrop/module.h	Fri Sep 20 16:41:49 2002
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 /*
- * $Id: module.h,v 1.29 2002/09/20 20:18:22 stdarg Exp $
+ * $Id: module.h,v 1.30 2002/09/20 21:41:49 stdarg Exp $
  */
 
 #ifndef _EGG_MOD_MODULE_H
@@ -36,9 +36,6 @@
    validating if they aren't needed */
 #include "src/users.h"
 #include "src/bg.h"
-#include "src/botcmd.h"
-#include "src/botmsg.h"
-#include "src/botnet.h"
 #include "src/chan.h"
 #include "src/chanprog.h"
 #include "src/cmds.h"
@@ -57,7 +54,6 @@
 #include "src/misc.h"
 #include "src/modules.h"
 #include "src/net.h"
-#include "src/tandem.h"
 #include "src/tclegg.h"
 #include "src/tcl.h"
 #include "src/tclhash.h"
@@ -121,22 +117,22 @@
 /* #define int_to_base10 ((char * (*) (int))egg->global[22]) */
 /* #define simple_sprintf ((int (*)())egg->global[23]) */
 /* 24 - 27 */
-#define botnet_send_zapf ((void (*)(int, char *, char *, char *))egg->global[24])
-#define botnet_send_zapf_broad ((void (*)(int, char *, char *, char *))egg->global[25])
-#define botnet_send_unlinked ((void (*)(int, char *, char *))egg->global[26])
-#define botnet_send_bye ((void(*)(void))egg->global[27])
+/* #define botnet_send_zapf ((void (*)(int, char *, char *, char *))egg->global[24]) */
+/* #define botnet_send_zapf_broad ((void (*)(int, char *, char *, char *))egg->global[25]) */
+/* #define botnet_send_unlinked ((void (*)(int, char *, char *))egg->global[26]) */
+/* #define botnet_send_bye ((void(*)(void))egg->global[27]) */
 /* 28 - 31 */
-#define botnet_send_chat ((void(*)(int,char*,char*))egg->global[28])
-#define botnet_send_filereject ((void(*)(int,char*,char*,char*))egg->global[29])
-#define botnet_send_filesend ((void(*)(int,char*,char*,char*))egg->global[30])
-#define botnet_send_filereq ((void(*)(int,char*,char*,char*))egg->global[31])
+/* #define botnet_send_chat ((void(*)(int,char*,char*))egg->global[28]) */
+/* #define botnet_send_filereject ((void(*)(int,char*,char*,char*))egg->global[29]) */
+/* #define botnet_send_filesend ((void(*)(int,char*,char*,char*))egg->global[30]) */
+/* #define botnet_send_filereq ((void(*)(int,char*,char*,char*))egg->global[31]) */
 /* 32 - 35 */
-#define botnet_send_join_idx ((void(*)(int,int))egg->global[32])
-#define botnet_send_part_idx ((void(*)(int,char *))egg->global[33])
-#define updatebot ((void(*)(int,char*,char,int))egg->global[34])
-#define nextbot ((int (*)(char *))egg->global[35])
+/* #define botnet_send_join_idx ((void(*)(int,int))egg->global[32]) */
+/* #define botnet_send_part_idx ((void(*)(int,char *))egg->global[33]) */
+/* #define updatebot ((void(*)(int,char*,char,int))egg->global[34]) */
+/* #define nextbot ((int (*)(char *))egg->global[35]) */
 /* 36 - 39 */
-#define zapfbot ((void (*)(int))egg->global[36])
+/* #define zapfbot ((void (*)(int))egg->global[36]) */
 /* 37: n_free -- UNUSED (Tothwolf) */
 #define u_pass_match ((int (*)(struct userrec *,char *))egg->global[38])
 /* 39: user_malloc -- UNUSED (Tothwolf) */
Index: eggdrop1.7/modules/Makefile.am
diff -u eggdrop1.7/modules/Makefile.am:1.6 eggdrop1.7/modules/Makefile.am:1.7
--- eggdrop1.7/modules/Makefile.am:1.6	Fri Sep 20 15:18:22 2002
+++ eggdrop1.7/modules/Makefile.am	Fri Sep 20 16:41:49 2002
@@ -1,6 +1,6 @@
-# $Id: Makefile.am,v 1.6 2002/09/20 20:18:22 stdarg Exp $
+# $Id: Makefile.am,v 1.7 2002/09/20 21:41:49 stdarg Exp $
 
 # FIXME: list will prolly become dynamic
-SUBDIRS			= blowfish compress console perlscript server tclscript javascript
+SUBDIRS			= blowfish perlscript server tclscript
 
 MAINTAINERCLEANFILES	= Makefile.in
Index: eggdrop1.7/src/Makefile.am
diff -u eggdrop1.7/src/Makefile.am:1.27 eggdrop1.7/src/Makefile.am:1.28
--- eggdrop1.7/src/Makefile.am:1.27	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/src/Makefile.am	Fri Sep 20 16:41:49 2002
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.27 2002/09/20 02:06:25 stdarg Exp $
+# $Id: Makefile.am,v 1.28 2002/09/20 21:41:49 stdarg Exp $
 
 # FIXME: optionally allow a system wide install by ignoring the line below.
 bindir			= $(exec_prefix)
@@ -22,12 +22,6 @@
 bin_PROGRAMS		= eggdrop
 eggdrop_SOURCES		= bg.c \
 			bg.h \
-			botcmd.c \
-			botcmd.h \
-			botmsg.c \
-			botmsg.h \
-			botnet.c \
-			botnet.h \
 			chan.h \
 			chanprog.c \
 			chanprog.h \
@@ -64,7 +58,6 @@
 			net.c \
 			net.h \
 			patch.h \
-			tandem.h \
 			tcl.c \
 			tcl.h \
 			tcldcc.c \
@@ -106,19 +99,9 @@
 #        by ./configure
 eggdrop_LDADD		= @LIBLTDL@ \
 			-dlopen ../modules/blowfish/blowfish.la \
-			-dlopen ../modules/channels/channels.la \
-			$(EGG_CMP) \
-			-dlopen ../modules/console/console.la \
-			-dlopen ../modules/ctcp/ctcp.la \
-			-dlopen ../modules/filesys/filesys.la \
-			-dlopen ../modules/irc/irc.la \
-			-dlopen ../modules/notes/notes.la \
 			$(EGG_PRL) \
 			-dlopen ../modules/server/server.la \
-			-dlopen ../modules/share/share.la \
 			$(EGG_TCL) \
-			-dlopen ../modules/transfer/transfer.la \
-			-dlopen ../modules/uptime/uptime.la \
 			$(top_builddir)/lib/eggdrop/libeggdrop.la \
 			$(XLIBS)
 
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.106 eggdrop1.7/src/cmds.c:1.107
--- eggdrop1.7/src/cmds.c:1.106	Tue Jun 18 01:12:32 2002
+++ eggdrop1.7/src/cmds.c	Fri Sep 20 16:41:49 2002
@@ -24,11 +24,10 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: cmds.c,v 1.106 2002/06/18 06:12:32 guppy Exp $";
+static const char rcsid[] = "$Id: cmds.c,v 1.107 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"
-#include "tandem.h"
 #include "modules.h"
 #include "logfile.h"
 #include "misc.h"
@@ -37,9 +36,6 @@
 				   check_bind_chjn, check_bind_chof	*/
 #include "users.h"		/* get_user_by_host, set_user,
 				   USERENTRY_PASS			*/
-#include "botnet.h"		/* answer_local_whom, nextbot, tell_bots
-				   tell_bottree, botlink, botunlink,
-				   lastbot, tandem_relay		*/
 #include "chanprog.h"		/* masktype, tell_verbose_status, 
 				   tell_settings, maskname, logmodes
 				   isowner, reload			*/
@@ -157,27 +153,6 @@
 	if (dcc[i].u.chat->away != NULL)
 	  dprintf(idx, "      AWAY: %s\n", dcc[i].u.chat->away);
       }
-  for (i = 0; i < dcc_total; i++)
-    if (dcc[i].type == &DCC_BOT) {
-      if (!ok) {
-	ok = 1;
-	dprintf(idx, _("Bots connected:\n"));
-      }
-      strftime(s, 14, "%d %b %H:%M", localtime(&dcc[i].timeval));
-      spaces[len = HANDLEN - strlen(dcc[i].nick)] = 0;
-      if (atr & USER_OWNER) {
-	dprintf(idx, "  [%.2lu]  %s%c%s%s (%s) %s\n",
-		dcc[i].sock, dcc[i].status & STAT_CALLED ? "<-" : "->",
-		dcc[i].status & STAT_SHARE ? '+' : ' ',
-		dcc[i].nick, spaces, s, dcc[i].u.bot->version);
-      } else {
-	dprintf(idx, "  %s%c%s%s (%s) %s\n",
-		dcc[i].status & STAT_CALLED ? "<-" : "->",
-		dcc[i].status & STAT_SHARE ? '+' : ' ',
-		dcc[i].nick, spaces, s, dcc[i].u.bot->version);
-      }
-      spaces[len] = ' ';
-    }
   ok = 0;
   for (i = 0; i < dcc_total; i++) {
     if ((dcc[i].type == &DCC_CHAT) && (dcc[i].u.chat->channel != chan)) {
@@ -244,77 +219,6 @@
   }
 }
 
-static int cmd_botinfo(struct userrec *u, int idx, char *par)
-{
-  char s[512], s2[32];
-  struct chanset_t *chan;
-  unsigned long uptime, tmp, hr, min;
-
-  uptime = now - online_since;
-  s2[0] = 0;
-  if (uptime > 86400) {
-    tmp = (uptime / 86400);
-    sprintf(s2, "%lu day%s, ", tmp, (tmp == 1) ? "" : "s");
-    uptime -= (tmp * 86400);
-  }
-  hr = (uptime / 3600); 
-  uptime -= (hr * 3600);
-  min = (uptime / 60); 
-  sprintf(&s2[strlen(s2)], "%02lu:%02lu", hr, min);
-
-  simple_sprintf(s, "%d:%s@%s", dcc[idx].sock, dcc[idx].nick, botnetnick);
-  botnet_send_infoq(-1, s);
-  s[0] = 0;
-  if (module_find("server", 0, 0)) {
-    for (chan = chanset; chan; chan = chan->next) { 
-      if (!channel_secret(chan)) {
-	if ((strlen(s) + strlen(chan->dname) + strlen(network)
-                   + strlen(botnetnick) + strlen(ver) + 1) >= 490) {
-          strcat(s,"++  ");
-          break; /* yeesh! */
-	}
-	strcat(s, chan->dname);
-	strcat(s, ", ");
-      }
-    }
-
-    if (s[0]) {
-      s[strlen(s) - 2] = 0;
-      dprintf(idx, "*** [%s] %s <%s> (%s) [UP %s]\n", botnetnick,
-	      ver, network, s, s2);
-    } else
-      dprintf(idx, "*** [%s] %s <%s> (%s) [UP %s]\n", botnetnick,
-	      ver, network, _("no channels"), s2);
-  } else
-    dprintf(idx, "*** [%s] %s <NO_IRC> [UP %s]\n", botnetnick, ver, s2);
-
-  return(1);
-}
-
-static int cmd_whom(struct userrec *u, int idx, char *par)
-{
-  if (par[0] == '*') {
-    answer_local_whom(idx, -1);
-    return(1);
-  } else if (dcc[idx].u.chat->channel < 0) {
-    dprintf(idx, _("You have chat turned off.\n"));
-    return(0);
-  }
-  if (!par[0]) {
-    answer_local_whom(idx, dcc[idx].u.chat->channel);
-  } else {
-    int chan = -1;
-
-    chan = atoi(par);
-    if ((chan < 0) || (chan > 99999)) {
-      dprintf(idx, "Channel number out of range: must be between 0 and 99999.\n");
-      return(0);
-    }
-    answer_local_whom(idx, chan);
-  }
-  return(1);
-}
-
 static int cmd_me(struct userrec *u, int idx, char *par)
 {
   int i;
@@ -330,39 +234,13 @@
   if (dcc[idx].u.chat->away != NULL)
     not_away(idx);
   for (i = 0; i < dcc_total; i++)
-    if (dcc[i].type && (dcc[i].type->flags & DCT_CHAT) &&
-	(dcc[i].u.chat->channel == dcc[idx].u.chat->channel) &&
-	((i != idx) || (dcc[i].status & STAT_ECHO)))
-      dprintf(i, "* %s %s\n", dcc[idx].nick, par);
-  botnet_send_act(idx, botnetnick, dcc[idx].nick,
-		  dcc[idx].u.chat->channel, par);
   check_bind_act(dcc[idx].nick, dcc[idx].u.chat->channel, par);
   return(0);
 }
 
 static int cmd_motd(struct userrec *u, int idx, char *par)
 {
-  int i;
-
-  if (par[0]) {
-    if (!strcasecmp(par, botnetnick))
-      show_motd(idx);
-    else {
-      i = nextbot(par);
-      if (i < 0)
-	dprintf(idx, _("That bot isn't connected.\n"));
-      else {
-	char x[40];
-
-	simple_sprintf(x, "%s%d:%s@%s",
-		       (dcc[idx].status & STAT_TELNET) ? "#" : "!",
-		       dcc[idx].sock, dcc[idx].nick, botnetnick);
-	botnet_send_motd(i, x, par);
-      }
-    }
-  } else {
     show_motd(idx);
-  }
   return(1);
 }
 
@@ -371,11 +249,13 @@
   if (strlen(par) > 60)
     par[60] = 0;
   set_away(idx, par);
+  return(1);
 }
 
 static int cmd_back(struct userrec *u, int idx, char *par)
 {
   not_away(idx);
+  return(1);
 }
 
 static int cmd_newpass(struct userrec *u, int idx, char *par)
@@ -399,24 +279,6 @@
   return(0);
 }
 
-static int cmd_bots(struct userrec *u, int idx, char *par)
-{
-  tell_bots(idx);
-  return(1);
-}
-
-static int cmd_bottree(struct userrec *u, int idx, char *par)
-{
-  tell_bottree(idx, 0);
-  return(1);
-}
-
-static int cmd_vbottree(struct userrec *u, int idx, char *par)
-{
-  tell_bottree(idx, 1);
-  return(1);
-}
-
 static int cmd_rehelp(struct userrec *u, int idx, char *par)
 {
   dprintf(idx, _("Reload help cache...\n"));
@@ -457,36 +319,12 @@
 
 static int cmd_who(struct userrec *u, int idx, char *par)
 {
-  int i;
-
-  if (par[0]) {
-    if (dcc[idx].u.chat->channel < 0) {
-      dprintf(idx, _("You have chat turned off.\n"));
-      return(0);
-    }
-    if (!strcasecmp(par, botnetnick))
-      tell_who(u, idx, dcc[idx].u.chat->channel);
-    else {
-      i = nextbot(par);
-      if (i < 0) {
-	dprintf(idx, _("That bot isn't connected.\n"));
-      } else if (dcc[idx].u.chat->channel > 99999)
-	dprintf(idx, _("You are on a local channel.\n"));
-      else {
-	char s[40];
-
-	simple_sprintf(s, "%d:%s@%s", dcc[idx].sock,
-		       dcc[idx].nick, botnetnick);
-	botnet_send_who(i, s, par, dcc[idx].u.chat->channel);
-      }
-    }
-  } else {
     putlog(LOG_CMDS, "*", "#%s# who", dcc[idx].nick);
     if (dcc[idx].u.chat->channel < 0)
       tell_who(u, idx, 0);
     else
       tell_who(u, idx, dcc[idx].u.chat->channel);
-  }
+
   return(1);
 }
 
@@ -587,26 +425,6 @@
     return(0);
   }
   who = newsplit(&par);
-  if (strchr(who, '@') != NULL) {
-    char whonick[HANDLEN + 1];
-
-    splitcn(whonick, who, '@', HANDLEN + 1);
-    if (!strcasecmp(who, botnetnick)) {
-      cmd_boot(u, idx, whonick);
-      return(0);
-    }
-    if (remote_boots > 0) {
-      i = nextbot(who);
-      if (i < 0) {
-        dprintf(idx, _("No such bot connected.\n"));
-        return(0);
-      }
-      botnet_send_reject(i, dcc[idx].nick, botnetnick, whonick,
-			 who, par[0] ? par : dcc[idx].nick);
-    } else
-      dprintf(idx, _("Remote boots are disabled here.\n"));
-    return(0);
-  }
   for (i = 0; i < dcc_total; i++)
     if (dcc[i].type && !strcasecmp(dcc[i].nick, who)
         && !ok && (dcc[i].type->flags & DCT_CANBOOT)) {
@@ -854,8 +672,7 @@
       dprintf(idx, _("You can't change a bot owner's handle.\n"));
     else if (isowner(hand) && strcasecmp(dcc[idx].nick, hand))
       dprintf(idx, _("You can't change a permanent bot owner's handle.\n"));
-    else if (!strcasecmp(newhand, botnetnick) && (!(atr2 & USER_BOT) ||
-             nextbot(hand) != -1))
+    else if (!strcasecmp(newhand, botnetnick) && !(atr2 & USER_BOT))
       dprintf(idx, _("Hey! That's MY name!\n"));
     else if (change_handle(u2, newhand)) {
       dprintf(idx, _("Changed.\n"));
@@ -1067,6 +884,7 @@
 {
   dprintf(idx, "%s\n", _("Reloading user file..."));
   reload();
+  return(1);
 }
 
 void cmd_die(struct userrec *u, int idx, char *par)
@@ -1116,70 +934,6 @@
   return(1);
 }
 
-static int cmd_link(struct userrec *u, int idx, char *par)
-{
-  char *s;
-  int i;
-
-  if (!par[0]) {
-    dprintf(idx, "Usage: link [some-bot] <new-bot>\n");
-    return(0);
-  }
-  s = newsplit(&par);
-  if (!par[0] || !strcasecmp(par, botnetnick))
-    botlink(dcc[idx].nick, idx, s);
-  else {
-    char x[40];
-
-    i = nextbot(s);
-    if (i < 0) {
-      dprintf(idx, _("No such bot online.\n"));
-      return(0);
-    }
-    simple_sprintf(x, "%d:%s@%s", dcc[idx].sock, dcc[idx].nick, botnetnick);
-    botnet_send_link(i, x, s, par);
-  }
-  return(1);
-}
-
-static int cmd_unlink(struct userrec *u, int idx, char *par)
-{
-  int i;
-  char *bot;
-
-  if (!par[0]) {
-    dprintf(idx, "Usage: unlink <bot> [reason]\n");
-    return(0);
-  }
-  bot = newsplit(&par);
-  i = nextbot(bot);
-  if (i < 0) {
-    botunlink(idx, bot, par);
-    return(0);
-  }
-  /* If we're directly connected to that bot, just do it
-   * (is nike gunna sue?)
-   */
-  if (!strcasecmp(dcc[i].nick, bot))
-    botunlink(idx, bot, par);
-  else {
-    char x[40];
-
-    simple_sprintf(x, "%d:%s@%s", dcc[idx].sock, dcc[idx].nick, botnetnick);
-    botnet_send_unlink(i, x, lastbot(bot), bot, par);
-  }
-  return(1);
-}
-
-static int cmd_relay(struct userrec *u, int idx, char *par)
-{
-  if (!par[0]) {
-    dprintf(idx, "Usage: relay <bot>\n");
-    return(0);
-  }
-  tandem_relay(idx, par, 0);
-}
-
 static int cmd_save(struct userrec *u, int idx, char *par)
 {
   dprintf(idx, _("Saving user file...\n"));
@@ -1194,30 +948,6 @@
   return(1);
 }
 
-static int cmd_trace(struct userrec *u, int idx, char *par)
-{
-  int i;
-  char x[NOTENAMELEN + 11], y[11];
-
-  if (!par[0]) {
-    dprintf(idx, "Usage: trace <botname>\n");
-    return(0);
-  }
-  if (!strcasecmp(par, botnetnick)) {
-    dprintf(idx, _("That's me!  Hiya! :)\n"));
-    return(0);
-  }
-  i = nextbot(par);
-  if (i < 0) {
-    dprintf(idx, _("Unreachable bot.\n"));
-    return(0);
-  }
-  simple_sprintf(x, "%d:%s@%s", dcc[idx].sock, dcc[idx].nick, botnetnick);
-  simple_sprintf(y, ":%d", now);
-  botnet_send_trace(i, x, par, y);
-  return(1);
-}
-
 /* After messing with someone's user flags, make sure the dcc-chat flags
  * are set correctly.
  */
@@ -1235,13 +965,6 @@
     if (dcc[i].type && (dcc[i].type->flags & DCT_MASTER) &&
 	(!strcasecmp(u->handle, dcc[i].nick))) {
       stat = dcc[i].status;
-      if ((dcc[i].type == &DCC_CHAT) &&
-	  ((u->flags & (USER_OP | USER_MASTER | USER_OWNER |
-			USER_BOTMAST))
-	   != (oatr & (USER_OP | USER_MASTER | USER_OWNER |
-		       USER_BOTMAST)))) {
-	botnet_send_join_idx(i, -1);
-      }
       if ((oatr & USER_MASTER) && !(u->flags & USER_MASTER)) {
 	struct flag_record fr = {FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
@@ -1311,8 +1034,6 @@
 	  if (dcc[i].u.chat->channel >= 0) {
 	    chanout_but(-1, dcc[i].u.chat->channel,
 			"*** %s has returned.\n", dcc[i].nick);
-	    if (dcc[i].u.chat->channel < 100000)
-	      botnet_send_join_idx(i, -1);
 	  }
 	} else {
 	  killsock(dcc[i].sock);
@@ -1320,12 +1041,6 @@
 	}
       }
     }
-    if (dcc[i].type == &DCC_BOT && !strcasecmp(u->handle, dcc[i].nick)) {
-      if ((dcc[i].status & STAT_LEAF) && !(u->flags & BOT_LEAF))
-	dcc[i].status &= ~(STAT_LEAF | STAT_WARNED);
-      if (!(dcc[i].status & STAT_LEAF) && (u->flags & BOT_LEAF))
-	dcc[i].status |= STAT_LEAF;
-    }
   }
   return u->flags;
 }
@@ -1341,10 +1056,6 @@
   for (i = 0; i < dcc_total; i++) {
     if (dcc[i].type && (dcc[i].type->flags & DCT_MASTER) &&
 	!strcasecmp(u->handle, dcc[i].nick)) {
-      if ((dcc[i].type == &DCC_CHAT) &&
-	  ((chflags & (USER_OP | USER_MASTER | USER_OWNER))
-	   != (ochatr & (USER_OP | USER_MASTER | USER_OWNER))))
-	botnet_send_join_idx(i, -1);
       if ((ochatr & USER_MASTER) && !(chflags & USER_MASTER)) {
 	if (!(atr & USER_MASTER))
 	  dcc[i].u.chat->con_flags &= ~(LOG_MISC | LOG_CMDS);
@@ -1592,8 +1303,7 @@
     return(0);
   }
   for (idx2 = 0; idx2 < dcc_total; idx2++)
-    if (dcc[idx2].type && dcc[idx2].type != &DCC_RELAY && dcc[idx2].type != &DCC_FORK_BOT &&
-	!strcasecmp(dcc[idx2].nick, hand))
+    if (dcc[idx2].type && !strcasecmp(dcc[idx2].nick, hand))
       break;
   if (idx2 != dcc_total) {
     dprintf(idx,
@@ -1712,139 +1422,6 @@
   return(1);
 }
 
-static int cmd_chat(struct userrec *u, int idx, char *par)
-{
-  char *arg;
-  int newchan, oldchan;
-  module_entry *me;
-
-  arg = newsplit(&par);
-  if (!strcasecmp(arg, "off")) {
-    /* Turn chat off */
-    if (dcc[idx].u.chat->channel < 0) {
-      dprintf(idx, _("You weren't in chat anyway!\n"));
-      return(0);
-    } else {
-      dprintf(idx, _("Leaving chat mode...\n"));
-      check_bind_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
-		     dcc[idx].u.chat->channel);
-      chanout_but(-1, dcc[idx].u.chat->channel,
-		  "*** %s left the party line.\n",
-		  dcc[idx].nick);
-      if (dcc[idx].u.chat->channel < 100000)
-	botnet_send_part_idx(idx, "");
-    }
-    dcc[idx].u.chat->channel = (-1);
-  } else {
-    if (arg[0] == '*') {
-      if (((arg[1] < '0') || (arg[1] > '9'))) {
-	if (!arg[1])
-	  newchan = 0;
-	else {
-	    newchan = -1;
-	}
-	if (newchan < 0) {
-	  dprintf(idx, _("No channel by that name.\n"));
-	  return(0);
-	}
-      } else
-	newchan = 100000 + atoi(arg + 1);
-      if (newchan < 100000 || newchan > 199999) {
-	dprintf(idx, "Channel number out of range: local channels must be *0-*99999.\n");
-	return(0);
-      }
-    } else {
-      if (((arg[0] < '0') || (arg[0] > '9')) && (arg[0])) {
-	if (!strcasecmp(arg, "on"))
-	  newchan = 0;
-	else {
-	    newchan = -1;
-	}
-	if (newchan < 0) {
-	  dprintf(idx, _("No channel by that name.\n"));
-	  return(0);
-	}
-      } else
-	newchan = atoi(arg);
-      if ((newchan < 0) || (newchan > 99999)) {
-	dprintf(idx, "Channel number out of range: must be between 0 and 99999.\n");
-	return(0);
-      }
-    }
-    /* If coming back from being off the party line, make sure they're
-     * not away.
-    */
-    if ((dcc[idx].u.chat->channel < 0) && (dcc[idx].u.chat->away != NULL))
-      not_away(idx);
-    if (dcc[idx].u.chat->channel == newchan) {
-      if (!newchan) {
-	dprintf(idx, _("You're already on the party line!\n"));
-        return(0);
-      } else {
-	dprintf(idx, "You're already on channel %s%d!\n",
-		(newchan < 100000) ? "" : "*", newchan % 100000);
-        return(0);
-      }
-    } else {
-      oldchan = dcc[idx].u.chat->channel;
-      if (oldchan >= 0)
-	check_bind_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, oldchan);
-      if (!oldchan) {
-	chanout_but(-1, 0, "*** %s left the party line.\n", dcc[idx].nick);
-      } else if (oldchan > 0) {
-	chanout_but(-1, oldchan, "*** %s left the channel.\n", dcc[idx].nick);
-      }
-      dcc[idx].u.chat->channel = newchan;
-      if (!newchan) {
-	dprintf(idx, _("Entering the party line...\n"));
-	chanout_but(-1, 0, "*** %s joined the party line.\n", dcc[idx].nick);
-      } else {
-	dprintf(idx, _("Joining channel '%s'...\n"), arg);
-	chanout_but(-1, newchan, "*** %s joined the channel.\n", dcc[idx].nick);
-      }
-      check_bind_chjn(botnetnick, dcc[idx].nick, newchan, geticon(dcc[idx].user),
-		     dcc[idx].sock, dcc[idx].host);
-      if (newchan < 100000)
-	botnet_send_join_idx(idx, oldchan);
-      else if (oldchan < 100000)
-	botnet_send_part_idx(idx, "");
-    }
-  }
-  /* New style autosave here too -- rtc, 09/28/1999*/
-  if ((me = module_find("console", 1, 1))) {
-    Function *func = me->funcs;
-    (func[CONSOLE_DOSTORE]) (idx);
-  }
-  return(1);
-}
-
-static int cmd_echo(struct userrec *u, int idx, char *par)
-{
-  module_entry *me;
-
-  if (!par[0]) {
-    dprintf(idx, "%s\n", dcc[idx].status & STAT_ECHO ?
-	    "Echo is currently on." : "Echo is currently off.");
-    return(0);
-  }
-  if (!strcasecmp(par, "on")) {
-    dprintf(idx, _("Echo turned on.\n"));
-    dcc[idx].status |= STAT_ECHO;
-  } else if (!strcasecmp(par, "off")) {
-    dprintf(idx, _("Echo turned off.\n"));
-    dcc[idx].status &= ~STAT_ECHO;
-  } else {
-    dprintf(idx, "Usage: echo <on/off>\n");
-    return(0);
-  }
-  /* New style autosave here too -- rtc, 09/28/1999*/
-  if ((me = module_find("console", 1, 1))) {
-    Function *func = me->funcs;
-    (func[CONSOLE_DOSTORE]) (idx);
-  }
-  return(1);
-}
-
 static int cmd_su(struct userrec *u, int idx, char *par)
 {
   int atr = u ? u->flags : 0;
@@ -1875,8 +1452,6 @@
 		  _("No password set for user. You may not .su to them.\n"));
 	  return(0);
 	}
-	if (dcc[idx].u.chat->channel < 100000)
-	  botnet_send_part_idx(idx, "");
 	chanout_but(-1, dcc[idx].u.chat->channel,
 		    "*** %s left the party line.\n", dcc[idx].nick);
 	/* Store the old nick in the away section, for weenies who can't get
@@ -1896,8 +1471,6 @@
 	       					  TLN_ECHO_C : "");
 	dcc[idx].type = &DCC_CHAT_PASS;
       } else if (atr & USER_OWNER) {
-	if (dcc[idx].u.chat->channel < 100000)
-	  botnet_send_part_idx(idx, "");
 	chanout_but(-1, dcc[idx].u.chat->channel,
 		    "*** %s left the party line.\n", dcc[idx].nick);
 	dprintf(idx, _("Setting your username to %s.\n"), par);
@@ -2176,8 +1749,7 @@
       return(0);
     }
     for (idx2 = 0; idx2 < dcc_total; idx2++)
-      if (dcc[idx2].type && dcc[idx2].type != &DCC_RELAY && dcc[idx2].type != &DCC_FORK_BOT &&
-          !strcasecmp(dcc[idx2].nick, handle))
+      if (dcc[idx2].type && !strcasecmp(dcc[idx2].nick, handle))
         break;
     if (idx2 != dcc_total) {
       dprintf(idx, _("You can't remove a directly linked bot.\n"));
@@ -2336,23 +1908,12 @@
 
 static int cmd_modules(struct userrec *u, int idx, char *par)
 {
-  int ptr;
-  char *bot;
   module_entry *me;
 
-  if (!par[0]) {  
     dprintf(idx, _("Modules loaded:\n"));
     for (me = module_list; me; me = me->next)
       dprintf(idx, "  Module: %s (v%d.%d)\n", me->name, me->major, me->minor);
     dprintf(idx, _("End of modules list.\n"));
-  } else {
-    bot = newsplit(&par);
-    if ((ptr = nextbot(bot)) >= 0)
-      dprintf(ptr, "v %s %s %d:%s\n", botnetnick, bot, dcc[idx].sock,
-	      dcc[idx].nick);
-    else
-      dprintf(idx, _("No such bot online.\n"));
-  }
   return(1);
 }
 
@@ -2370,14 +1931,6 @@
     dprintf(idx, "   in: %s", btos(traffic.in_total.irc + traffic.in_today.irc));
               dprintf(idx, " (%s today)\n", btos(traffic.in_today.irc));
   }
-  if (traffic.out_total.bn > 0 || traffic.in_total.bn > 0 || traffic.out_today.bn > 0 ||
-      traffic.in_today.bn > 0) {
-    dprintf(idx, "Botnet:\n");
-    dprintf(idx, "  out: %s", btos(traffic.out_total.bn + traffic.out_today.bn));
-              dprintf(idx, " (%s today)\n", btos(traffic.out_today.bn));
-    dprintf(idx, "   in: %s", btos(traffic.in_total.bn + traffic.in_today.bn));
-              dprintf(idx, " (%s today)\n", btos(traffic.in_today.bn));
-  }
   if (traffic.out_total.dcc > 0 || traffic.in_total.dcc > 0 || traffic.out_today.dcc > 0 ||
       traffic.in_today.dcc > 0) {
     dprintf(idx, "Partyline:\n");
@@ -2406,17 +1959,17 @@
   dprintf(idx, "---\n");
   dprintf(idx, "Total:\n");
   itmp = traffic.out_total.irc + traffic.out_total.bn + traffic.out_total.dcc + traffic.out_total.trans
-         + traffic.out_total.unknown + traffic.out_today.irc + traffic.out_today.bn
+         + traffic.out_total.unknown + traffic.out_today.irc
          + traffic.out_today.dcc + traffic.out_today.trans + traffic.out_today.unknown;
-  itmp2 = traffic.out_today.irc + traffic.out_today.bn + traffic.out_today.dcc
+  itmp2 = traffic.out_today.irc + traffic.out_today.dcc
          + traffic.out_today.trans + traffic.out_today.unknown;
   dprintf(idx, "  out: %s", btos(itmp));
               dprintf(idx, " (%s today)\n", btos(itmp2));
-  dprintf(idx, "   in: %s", btos(traffic.in_total.irc + traffic.in_total.bn + traffic.in_total.dcc
+  dprintf(idx, "   in: %s", btos(traffic.in_total.irc + traffic.in_total.dcc
 	  + traffic.in_total.trans + traffic.in_total.unknown + traffic.in_today.irc
-	  + traffic.in_today.bn + traffic.in_today.dcc + traffic.in_today.trans
+	  + traffic.in_today.dcc + traffic.in_today.trans
 	  + traffic.in_today.unknown));
-  dprintf(idx, " (%s today)\n", btos(traffic.in_today.irc + traffic.in_today.bn
+  dprintf(idx, " (%s today)\n", btos(traffic.in_today.irc
           + traffic.in_today.dcc + traffic.in_today.trans
 	  + traffic.in_today.unknown));
   return(1);
@@ -2461,20 +2014,12 @@
 
 static int cmd_quit(struct userrec *u, int idx, char *text)
 {
-  if (dcc[idx].u.chat->channel >= 0 && dcc[idx].u.chat->channel < GLOBAL_CHANS)
-    check_bind_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
-		   dcc[idx].u.chat->channel);
-  check_bind_chof(dcc[idx].nick, dcc[idx].sock);
   dprintf(idx, _("*** Ja mata!\n"));
   flush_lines(idx, dcc[idx].u.chat);
   putlog(LOG_MISC, "*", _("DCC connection closed (%s!%s)"), dcc[idx].nick,
 	 dcc[idx].host);
   if (dcc[idx].u.chat->channel >= 0) {
-    chanout_but(-1, dcc[idx].u.chat->channel,
-		"*** %s left the party line%s%s\n", dcc[idx].nick,
-		text[0] ? ": " : ".", text);
-    if (dcc[idx].u.chat->channel < 100000)
-      botnet_send_part_idx(idx, text);
+    chanout_but(-1, dcc[idx].u.chat->channel, "*** %s left the party line%s%s\n", dcc[idx].nick, text[0] ? ": " : ".", text);
   }
 
   if (dcc[idx].u.chat->su_nick) {
@@ -2483,8 +2028,6 @@
     dprintf(idx, _("Returning to real nick %s!\n"), dcc[idx].u.chat->su_nick);
     free_null(dcc[idx].u.chat->su_nick);
     dcc_chatter(idx);
-    if (dcc[idx].u.chat->channel < 100000 && dcc[idx].u.chat->channel >= 0)
-      botnet_send_join_idx(idx, -1);
   } else if ((dcc[idx].sock != STDOUT) || backgrd) {
     killsock(dcc[idx].sock);
     lostdcc(idx);
@@ -2518,11 +2061,7 @@
   {"backup",		"m|m",	(Function) cmd_backup,		NULL},
   {"boot",		"t",	(Function) cmd_boot,		NULL},
   {"botattr",		"t",	(Function) cmd_botattr,		NULL},
-  {"botinfo",		"",	(Function) cmd_botinfo,		NULL},
-  {"bots",		"",	(Function) cmd_bots,		NULL},
-  {"bottree",		"",	(Function) cmd_bottree,		NULL},
   {"chaddr",		"t",	(Function) cmd_chaddr,		NULL},
-  {"chat",		"",	(Function) cmd_chat,		NULL},
   {"chattr",		"m|m",	(Function) cmd_chattr,		NULL},
   {"chhandle",		"t",	(Function) cmd_chhandle,	NULL},
   {"chnick",		"t",	(Function) cmd_chhandle,	NULL},
@@ -2531,11 +2070,9 @@
   {"console",		"to|o",	(Function) cmd_console,		NULL},
   {"dccstat",		"t",	(Function) cmd_dccstat,		NULL},
   {"die",		"n",	(Function) cmd_die,		NULL},
-  {"echo",		"",	(Function) cmd_echo,		NULL},
   {"fixcodes",		"",	(Function) cmd_fixcodes,	NULL},
   {"help",		"",	(Function) cmd_help,		NULL},
   {"ignores",		"m",	(Function) cmd_ignores,		NULL},
-  {"link",		"t",	(Function) cmd_link,		NULL},
   {"loadmod",		"n",	(Function) cmd_loadmod,		NULL},
   {"match",		"to|o",	(Function) cmd_match,		NULL},
   {"me",		"",	(Function) cmd_me,		NULL},
@@ -2549,21 +2086,16 @@
   {"quit",		"",	(Function) cmd_quit,		NULL},
   {"rehash",		"m",	(Function) cmd_rehash,		NULL},
   {"rehelp",		"n",	(Function) cmd_rehelp,		NULL},
-  {"relay",		"o",	(Function) cmd_relay,		NULL},
   {"reload",		"m|m",	(Function) cmd_reload,		NULL},
   {"restart",		"m",	(Function) cmd_restart,		NULL},
   {"save",		"m|m",	(Function) cmd_save,		NULL},
   {"simul",		"n",	(Function) cmd_simul,		NULL},
   {"status",		"m|m",	(Function) cmd_status,		NULL},
   {"su",		"",	(Function) cmd_su,		NULL},
-  {"trace",		"",	(Function) cmd_trace,		NULL},
-  {"unlink",		"t",	(Function) cmd_unlink,		NULL},
   {"unloadmod",		"n",	(Function) cmd_unloadmod,	NULL},
   {"uptime",		"m|m",	(Function) cmd_uptime,		NULL},
-  {"vbottree",		"",	(Function) cmd_vbottree,	NULL},
   {"who",		"",	(Function) cmd_who,		NULL},
   {"whois",		"to|o",	(Function) cmd_whois,		NULL},
-  {"whom",		"",	(Function) cmd_whom,		NULL},
   {"traffic",		"m|m",	(Function) cmd_traffic,		NULL},
   {"whoami",		"",	(Function) cmd_whoami,		NULL},
   {NULL,		NULL,	NULL,				NULL}
Index: eggdrop1.7/src/dcc.c
diff -u eggdrop1.7/src/dcc.c:1.91 eggdrop1.7/src/dcc.c:1.92
--- eggdrop1.7/src/dcc.c:1.91	Tue Jun 18 01:12:32 2002
+++ eggdrop1.7/src/dcc.c	Fri Sep 20 16:41:49 2002
@@ -25,14 +25,13 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: dcc.c,v 1.91 2002/06/18 06:12:32 guppy Exp $";
+static const char rcsid[] = "$Id: dcc.c,v 1.92 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"
 #include <ctype.h>
 #include <errno.h>
 #include "modules.h"
-#include "tandem.h"
 #include "logfile.h"
 #include "dns.h"
 #include "misc.h"
@@ -44,10 +43,6 @@
 			   check_bind_listen				*/
 #include "users.h"	/* match_ignore, addignore, get_user_by_host	*/
 #include "chanprog.h"	/* reaffirm_owners				*/
-#include "botnet.h"	/* in_chain, dump_links, addbot, nextbot, 
-			   findbot					*/
-#include "botmsg.h"	/* add_note					*/
-#include "botcmd.h"	/* bot_share					*/	
 #include "cmds.h"	/* check_dcc_attrs				*/
 #include "dccutil.h"	/* dprintf_eggdrop, lostdcc, chatout, 
 			   dcc_chatter, chanout_but, add_cr, not_away
@@ -60,9 +55,6 @@
 #include "match.h"	/* wild_match					*/
 #include "dcc.h"	/* prototypes					*/
 
-/* Includes for botnet md5 challenge/response code <cybah> */
-#include "md5.h"
-
 extern struct userrec	*userlist;
 extern struct chanset_t	*chanset;
 extern time_t		 now;
@@ -185,418 +177,6 @@
   *o = *p;
 }
 
-static void greet_new_bot(int idx)
-{
-  int bfl = bot_flags(dcc[idx].user);
-  int i;
-
-  dcc[idx].timeval = now;
-  dcc[idx].u.bot->version[0] = 0;
-  dcc[idx].u.bot->numver = 0;
-  if (bfl & BOT_REJECT) {
-    putlog(LOG_BOTS, "*", _("Rejecting link from %s"), dcc[idx].nick);
-    dprintf(idx, "bye %s\n", "rejected");
-    killsock(dcc[idx].sock);
-    lostdcc(idx);
-    return;
-  }
-  if (bfl & BOT_LEAF)
-    dcc[idx].status |= STAT_LEAF;
-  dcc[idx].status |= STAT_LINKING;
-#ifndef NO_OLD_BOTNET
-  dprintf(idx, "version %d %d %s <%s>\n", egg_numver, HANDLEN, ver, network);
-#else
-  dprintf(idx, "v %d %d %s <%s>\n", egg_numver, HANDLEN, ver, network);
-#endif
-  for (i = 0; i < dcc_total; i++)
-    if (dcc[i].type == &DCC_FORK_BOT) {
-      killsock(dcc[i].sock);
-      lostdcc(i);
-    }
-}
-
-static void bot_version(int idx, char *par)
-{
-  char x[1024];
-  int l;
-
-  dcc[idx].timeval = now;
-  if (in_chain(dcc[idx].nick)) {
-    dprintf(idx, "error Sorry, already connected.\n");
-    dprintf(idx, "bye\n");
-    killsock(dcc[idx].sock);
-    lostdcc(idx);
-    return;
-  }
-  if ((par[0] >= '0') && (par[0] <= '9')) {
-    char *work;
-
-    work = newsplit(&par);
-    dcc[idx].u.bot->numver = atoi(work);
-  } else
-    dcc[idx].u.bot->numver = 0;
-
-#ifndef NO_OLD_BOTNET
-  if (b_numver(idx) < NEAT_BOTNET) {
-#if HANDLEN != 9
-    putlog(LOG_BOTS,"*", "Non-matching handle lengths with %s, they use 9 characters.",
-	  dcc[idx].nick);
-
-dprintf(idx, "error Non-matching handle length: mine %d, yours 9\n",
-	    HANDLEN);
-    dprintf(idx, "bye %s\n", "bad handlen");
-    killsock(dcc[idx].sock);
-    lostdcc(idx);
-    return;
-#else
-    dprintf(idx, "thisbot %s\n", botnetnick);
-#endif
-  } else {
-#endif
-    dprintf(idx, "tb %s\n", botnetnick);
-    l = atoi(newsplit(&par));
-    if (l != HANDLEN) {
-      putlog(LOG_BOTS, "*", "Non-matching handle lengths with %s, they use %d characters.", 
-	    dcc[idx].nick, l);
-      dprintf(idx, "error Non-matching handle length: mine %d, yours %d\n",
-	      HANDLEN, l);
-      dprintf(idx, "bye %s\n", "bad handlen");
-      killsock(dcc[idx].sock);
-      lostdcc(idx);
-      return;
-    }
-#ifndef NO_OLD_BOTNET
-  }
-#endif
-  strlcpy(dcc[idx].u.bot->version, par, 120);
-  putlog(LOG_BOTS, "*", _("Linked to %s."), dcc[idx].nick);
-  chatout("*** Linked to %s\n", dcc[idx].nick);
-  botnet_send_nlinked(idx, dcc[idx].nick, botnetnick, '!',
-		      dcc[idx].u.bot->numver);
-  dump_links(idx);
-  dcc[idx].type = &DCC_BOT;
-  addbot(dcc[idx].nick, dcc[idx].nick, botnetnick, '-',
-	 dcc[idx].u.bot->numver);
-  check_bind_link(dcc[idx].nick, botnetnick);
-  snprintf(x, sizeof x, "v %d", dcc[idx].u.bot->numver);
-  bot_share(idx, x);
-  dprintf(idx, "el\n");
-}
-
-void failed_link(int idx)
-{
-  char s[81], s1[512];
-
-  if (dcc[idx].port >= dcc[idx].u.bot->port + 3) {
-    if (dcc[idx].u.bot->linker[0]) {
-      snprintf(s, sizeof s, "Couldn't link to %s.", dcc[idx].nick);
-      strcpy(s1, dcc[idx].u.bot->linker);
-      add_note(s1, botnetnick, s, -2, 0);
-    }
-    if (dcc[idx].u.bot->numver >= (-1))
-      putlog(LOG_BOTS, "*", _("Failed link to %s."), dcc[idx].nick);
-    killsock(dcc[idx].sock);
-    strcpy(s, dcc[idx].nick);
-    lostdcc(idx);
-    autolink_cycle(s);		/* Check for more auto-connections */
-    return;
-  }
-
-  /* Try next port */
-  killsock(dcc[idx].sock);
-  dcc[idx].sock = getsock(SOCK_STRONGCONN);
-  dcc[idx].port++;
-  dcc[idx].timeval = now;
-  if (dcc[idx].sock < 0 ||
-      open_telnet_raw(dcc[idx].sock, dcc[idx].addr[0] ?
-		      dcc[idx].addr : dcc[idx].host,
-		      dcc[idx].port) < 0) {
-    failed_link(idx);
-  }
-}
-
-static void cont_link(int idx, char *buf, int i)
-{
-  char x[1024];
-  int atr = bot_flags(dcc[idx].user);
-  int users, bots;
-
-  if (atr & BOT_HUB) {
-    /* Disconnect all +a bots because we just got a hub */
-    for (i = 0; i < dcc_total; i++) {
-      if (dcc[i].type && (i != idx) && (bot_flags(dcc[i].user) & BOT_ALT)) {
-	if ((dcc[i].type == &DCC_FORK_BOT) ||
-	    (dcc[i].type == &DCC_BOT_NEW)) {
-	  killsock(dcc[i].sock);
-	  lostdcc(i);
-	}
-      }
-    }
-    /* Just those currently in the process of linking */
-    if (in_chain(dcc[idx].nick)) {
-      i = nextbot(dcc[idx].nick);
-      if (i > 0) {
-	bots = bots_in_subtree(findbot(dcc[idx].nick));
-	users = users_in_subtree(findbot(dcc[idx].nick));
-	snprintf(x, sizeof x,
-		      "Unlinked %s (restructure) (lost %d bot%s and %d user%s)",
-		      dcc[i].nick, bots, (bots != 1) ? "s" : "",
-		      users, (users != 1) ? "s" : "");
-	chatout("*** %s\n", x);
-	botnet_send_unlinked(i, dcc[i].nick, x);
-	dprintf(i, "bye %s\n", "restructure");
-	killsock(dcc[i].sock);
-	lostdcc(i);
-      }
-    }
-  }
-  dcc[idx].type = &DCC_BOT_NEW;
-  dcc[idx].u.bot->numver = 0;
-
-  /* Don't send our password here, just the username. The code later on
-   * will determine if the password needs to be sent in cleartext or if
-   * we can send an MD5 digest. <cybah>
-   */
-  dprintf(idx, "%s\n", botnetnick);
-  return;
-}
-
-/* This function generates a digest by combining 'challenge' with
- * 'password' and then sends it to the other bot. <Cybah>
- */
-static void dcc_bot_digest(int idx, char *challenge, char *password)
-{
-  MD5_CTX       md5context;
-  char          digest_string[33];       /* 32 for digest in hex + null */
-  unsigned char digest[16];
-  int           i;
-
-  MD5_Init(&md5context);
-  MD5_Update(&md5context, (unsigned char *) challenge, strlen(challenge));
-  MD5_Update(&md5context, (unsigned char *) password, strlen(password));
-  MD5_Final(digest, &md5context);
-
-  for (i = 0; i < 16; i++)
-    sprintf(digest_string + (i*2), "%.2x", digest[i]);
-  dprintf(idx, "digest %s\n", digest_string);
-  putlog(LOG_BOTS, "*", _("Received challenge from %s... sending response ..."),
-	 dcc[idx].nick);
-}
-
-static void dcc_bot_new(int idx, char *buf, int x)
-{
-  struct userrec *u = get_user_by_handle(userlist, dcc[idx].nick);
-  char *code;
-
-  strip_telnet(dcc[idx].sock, buf, &x);
-  code = newsplit(&buf);
-  if (!strcasecmp(code, "*hello!")) {
-    greet_new_bot(idx);
-  } else if (!strcasecmp(code, "version") || !strcasecmp(code, "v")) {
-    bot_version(idx, buf);
-  } else if (!strcasecmp(code, "badpass")) {
-    /* We entered the wrong password */
-    putlog(LOG_BOTS, "*", _("Bad password on connect attempt to %s."), dcc[idx].nick);
-  } else if (!strcasecmp(code, "passreq")) {
-    char *pass = get_user(&USERENTRY_PASS, u);
-
-    if (!pass || !strcmp(pass, "-")) {
-      putlog(LOG_BOTS, "*", _("Password required for connection to %s."), dcc[idx].nick);
-      dprintf(idx, "-\n");
-    } else {
-      /* Determine if the other end supports an MD5 digest instead of a
-       * cleartext password. <Cybah>
-       */
-      if(buf && buf[0] && strchr(buf, '<') && strchr(buf+1, '>')) {
-        dcc_bot_digest(idx, buf, pass);
-      } else {
-        dprintf(idx, "%s\n", pass);
-      }
-    }
-  } else if (!strcasecmp(code, "error")) {
-    putlog(LOG_BOTS, "*", _("ERROR linking %s: %s"), dcc[idx].nick, buf);
-  }
-  /* Ignore otherwise */
-}
-
-static void eof_dcc_bot_new(int idx)
-{
-  putlog(LOG_BOTS, "*", _("Lost Bot: %s"), dcc[idx].nick, dcc[idx].port);
-  killsock(dcc[idx].sock);
-  lostdcc(idx);
-}
-
-static void timeout_dcc_bot_new(int idx)
-{
-  putlog(LOG_BOTS, "*", _("Timeout: bot link to %s at %s:%d"), dcc[idx].nick,
-	 dcc[idx].host, dcc[idx].port);
-  killsock(dcc[idx].sock);
-  lostdcc(idx);
-}
-
-static void display_dcc_bot_new(int idx, char *buf)
-{
-  sprintf(buf, "bot*  waited %lus", now - dcc[idx].timeval);
-}
-
-static void free_dcc_bot_(int n, void *x)
-{
-  if (dcc[n].type == &DCC_BOT) {
-    unvia(n, findbot(dcc[n].nick));
-    rembot(dcc[n].nick);
-  }
-  free(x);
-}
-
-struct dcc_table DCC_BOT_NEW =
-{
-  "BOT_NEW",
-  0,
-  eof_dcc_bot_new,
-  dcc_bot_new,
-  &bot_timeout,
-  timeout_dcc_bot_new,
-  display_dcc_bot_new,
-  free_dcc_bot_,
-  NULL
-};
-
-/* Hash function for tandem bot commands */
-extern botcmd_t C_bot[];
-
-static void dcc_bot(int idx, char *code, int i)
-{
-  char *msg;
-  int f;
-
-  strip_telnet(dcc[idx].sock, code, &i);
-  if (debug_output) {
-    if (code[0] == 's')
-      putlog(LOG_BOTSHARE, "*", "{%s} %s", dcc[idx].nick, code + 2);
-    else
-      putlog(LOG_BOTNET, "*", "[%s] %s", dcc[idx].nick, code);
-  }
-  msg = strchr(code, ' ');
-  if (msg) {
-    *msg = 0;
-    msg++;
-  } else
-    msg = "";
-  for (f = i = 0; C_bot[i].name && !f; i++) {
-    int y = strcasecmp(code, C_bot[i].name);
-
-    if (!y) {
-      /* Found a match */
-      (C_bot[i].func)(idx, msg);
-      f = 1;
-    } else if (y < 0)
-      return;
-  }
-}
-
-static void eof_dcc_bot(int idx)
-{
-  char x[1024];
-  int bots, users;
-
-  bots = bots_in_subtree(findbot(dcc[idx].nick));
-  users = users_in_subtree(findbot(dcc[idx].nick));
-  snprintf(x, sizeof x,
-	       "Lost bot: %s (lost %d bot%s and %d user%s)",
-  		 dcc[idx].nick, bots, (bots != 1) ? "s" : "", users,
-		 (users != 1) ? "s" : "");
-  putlog(LOG_BOTS, "*", "%s.", x);
-  chatout("*** %s\n", x);
-  botnet_send_unlinked(idx, dcc[idx].nick, x);
-  killsock(dcc[idx].sock);
-  lostdcc(idx);
-}
-
-static void display_dcc_bot(int idx, char *buf)
-{
-  int i = simple_sprintf(buf, "bot   flags: ");
-
-  buf[i++] = b_status(idx) & STAT_PINGED ? 'P' : 'p';
-  buf[i++] = b_status(idx) & STAT_SHARE ? 'U' : 'u';
-  buf[i++] = b_status(idx) & STAT_CALLED ? 'C' : 'c';
-  buf[i++] = b_status(idx) & STAT_OFFERED ? 'O' : 'o';
-  buf[i++] = b_status(idx) & STAT_SENDING ? 'S' : 's';
-  buf[i++] = b_status(idx) & STAT_GETTING ? 'G' : 'g';
-  buf[i++] = b_status(idx) & STAT_WARNED ? 'W' : 'w';
-  buf[i++] = b_status(idx) & STAT_LEAF ? 'L' : 'l';
-  buf[i++] = b_status(idx) & STAT_LINKING ? 'I' : 'i';
-  buf[i++] = b_status(idx) & STAT_AGGRESSIVE ? 'a' : 'A';
-  buf[i++] = 0;
-}
-
-static void display_dcc_fork_bot(int idx, char *buf)
-{
-  sprintf(buf, "conn  bot");
-}
-
-struct dcc_table DCC_BOT =
-{
-  "BOT",
-  DCT_BOT,
-  eof_dcc_bot,
-  dcc_bot,
-  NULL,
-  NULL,
-  display_dcc_bot,
-  free_dcc_bot_,
-  NULL
-};
-
-struct dcc_table DCC_FORK_BOT =
-{
-  "FORK_BOT",
-  0,
-  failed_link,
-  cont_link,
-  &connect_timeout,
-  failed_link,
-  display_dcc_fork_bot,
-  free_dcc_bot_,
-  NULL
-};
-
-/* This function generates a digest by combining a challenge consisting
- * of our process id + connection time + botnetnick.  The digest is then
- * compared to the one given by the remote bot.
- *
- * Returns 1 if the digest matches, otherwise returns 0.
- * <Cybah>
- */
-static int dcc_bot_check_digest(int idx, char *remote_digest)
-{
-  MD5_CTX       md5context;
-  char          digest_string[33];       /* 32 for digest in hex + null */
-  unsigned char digest[16];
-  int           i;
-  char          *password = get_user(&USERENTRY_PASS, dcc[idx].user);
-
-  MD5_Init(&md5context);
-
-  snprintf(digest_string, 33, "<%x%x@", getpid(),
-	       (unsigned int) dcc[idx].timeval);
-  MD5_Update(&md5context, (unsigned char *) digest_string,
-	    strlen(digest_string));
-  MD5_Update(&md5context, (unsigned char *) botnetnick, strlen(botnetnick));
-  MD5_Update(&md5context, (unsigned char *) ">", 1);
-  MD5_Update(&md5context, (unsigned char *) password, strlen(password));
-
-  MD5_Final(digest, &md5context);
-
-  for (i = 0; i < 16; i++)
-    sprintf(digest_string + (i * 2), "%.2x", digest[i]);
-
-  if (!strcmp(digest_string, remote_digest))
-    return 1;
-  putlog(LOG_BOTS, "*", _("Response (password hash) from %s incorrect"),
-	 dcc[idx].nick);
-  return 0;
-}
-
 static void dcc_chat_pass(int idx, char *buf, int atr)
 {
   if (!atr)
@@ -604,36 +184,7 @@
   strip_telnet(dcc[idx].sock, buf, &atr);
   atr = dcc[idx].user ? dcc[idx].user->flags : 0;
 
-  /* Check for MD5 digest from remote _bot_. <cybah> */
-  if ((atr & USER_BOT) && !strncasecmp(buf, "digest ", 7)) {
-    if(dcc_bot_check_digest(idx, buf+7)) {
-      free(dcc[idx].u.chat);
-      dcc[idx].type = &DCC_BOT_NEW;
-      dcc[idx].u.bot = calloc(1, sizeof(struct bot_info));
-      dcc[idx].status = STAT_CALLED;
-      dprintf(idx, "*hello!\n");
-      greet_new_bot(idx);
-      return;
-    } else {
-      /* Invalid password/digest */
-      dprintf(idx, "badpass\n");
-      putlog(LOG_MISC, "*", _("Bad Password: [%s]%s/%d"), dcc[idx].nick, dcc[idx].host,
-             dcc[idx].port);
-      killsock(dcc[idx].sock);
-      lostdcc(idx);
-      return;
-    }
-  }
-
   if (u_pass_match(dcc[idx].user, buf)) {
-    if (atr & USER_BOT) {
-      free(dcc[idx].u.chat);
-      dcc[idx].type = &DCC_BOT_NEW;
-      dcc[idx].u.bot = calloc(1, sizeof(struct bot_info));
-      dcc[idx].status = STAT_CALLED;
-      dprintf(idx, "*hello!\n");
-      greet_new_bot(idx);
-    } else {
       /* Log entry for successful login -slennox 3/28/1999 */
       putlog(LOG_MISC, "*", _("Logged in: %s (%s/%d)"), dcc[idx].nick,
 	     dcc[idx].host, dcc[idx].port);
@@ -647,11 +198,7 @@
       if (dcc[idx].status & STAT_TELNET)
 	dprintf(idx, TLN_IAC_C TLN_WONT_C TLN_ECHO_C "\n");
       dcc_chatter(idx);
-    }
   } else {
-    if (atr & USER_BOT)
-      dprintf(idx, "badpass\n");
-    else
       dprintf(idx, _("Negative on that, Houston.\n"));
     putlog(LOG_MISC, "*", _("Bad Password: [%s]%s/%d"), dcc[idx].nick,
 	   dcc[idx].host, dcc[idx].port);
@@ -665,7 +212,6 @@
       free_null(dcc[idx].u.chat->su_nick);
       dcc[idx].type = &DCC_CHAT;
       if (dcc[idx].u.chat->channel < 100000)
-	botnet_send_join_idx(idx, -1);
       chanout_but(-1, dcc[idx].u.chat->channel, _("*** %s has joined the party line.\n"), dcc[idx].nick);
     } else {
       killsock(dcc[idx].sock);
@@ -760,7 +306,6 @@
 
 static void out_dcc_general(int idx, char *buf, void *x)
 {
-  register struct chat_info *p = (struct chat_info *) x;
   char *y = buf;
 
   if (dcc[idx].status & STAT_TELNET)
@@ -812,8 +357,6 @@
   if (dcc[idx].u.chat->channel >= 0) {
     chanout_but(idx, dcc[idx].u.chat->channel, "*** %s lost dcc link.\n",
 		dcc[idx].nick);
-    if (dcc[idx].u.chat->channel < 100000)
-      botnet_send_part_idx(idx, "lost dcc link");
     check_bind_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
 		   dcc[idx].u.chat->channel);
   }
@@ -934,8 +477,6 @@
 	else
 	  chanout_but(idx, dcc[idx].u.chat->channel, "<%s> %s\n",
 		      dcc[idx].nick, buf);
-	botnet_send_chan(-1, botnetnick, dcc[idx].nick,
-			 dcc[idx].u.chat->channel, buf);
     }
   if (dcc[idx].type == &DCC_CHAT)	/* Could have change to files */
     if (dcc[idx].status & STAT_PAGE)
@@ -1154,85 +695,6 @@
   NULL
 };
 
-static void eof_dcc_dupwait(int idx)
-{
-  putlog(LOG_BOTS, "*", _("Lost telnet connection from %s while checking for duplicate"), dcc[idx].host);
-  killsock(dcc[idx].sock);
-  lostdcc(idx);
-}
-
-static void dcc_dupwait(int idx, char *buf, int i)
-{
-  /* We just ignore any data at this point. */
-  return;
-}
-
-/* We now check again. If the bot is still marked as duplicate, there is no
- * botnet lag we could push it on, so we just drop the connection.
- */
-static void timeout_dupwait(int idx)
-{
-  char x[100];
-
-  /* Still duplicate? */
-  if (in_chain(dcc[idx].nick)) {
-    snprintf(x, sizeof x, "%s!%s", dcc[idx].nick, dcc[idx].host);
-    dprintf(idx, "error Already connected.\n");
-    putlog(LOG_BOTS, "*", _("Refused telnet connection from %s (duplicate)"), x);
-    killsock(dcc[idx].sock);
-    lostdcc(idx);
-  } else {
-    /* Ha! Now it's gone and we can grant this bot access. */
-    dcc_telnet_pass(idx, dcc[idx].u.dupwait->atr);
-  }
-}
-
-static void display_dupwait(int idx, char *buf)
-{
-  sprintf(buf, "wait  duplicate?");
-}
-
-static void kill_dupwait(int idx, void *x)
-{
-  register struct dupwait_info *p = (struct dupwait_info *) x;
-
-  if (p) {
-    if (p->chat && DCC_CHAT.kill)
-      DCC_CHAT.kill(idx, p->chat);
-    free(p);
-  }
-}
-
-struct dcc_table DCC_DUPWAIT =
-{
-  "DUPWAIT",
-  DCT_VALIDIDX,
-  eof_dcc_dupwait,
-  dcc_dupwait,
-  &dupwait_timeout,
-  timeout_dupwait,
-  display_dupwait,
-  kill_dupwait,
-  NULL
-};
-
-/* This function is called if a bot gets removed from the list. It checks
- * wether we have a pending duplicate connection for that bot and continues
- * with the login in that case.
- */
-void dupwait_notify(char *who)
-{
-  register int idx;
-
-  assert(who);
-  for (idx = 0; idx < dcc_total; idx++)
-    if ((dcc[idx].type == &DCC_DUPWAIT) &&
-	!strcasecmp(dcc[idx].nick, who)) {
-      dcc_telnet_pass(idx, dcc[idx].u.dupwait->atr);
-      break;
-    }
-}
-
 static void dcc_telnet_id(int idx, char *buf, int atr)
 {
   int ok = 0;
@@ -1287,24 +749,6 @@
   }
   correct_handle(buf);
   strcpy(dcc[idx].nick, buf);
-  if (glob_bot(fr)) {
-    if (!strcasecmp(botnetnick, dcc[idx].nick)) {
-      dprintf(idx, "error You cannot link using my botnetnick.\n");
-      putlog(LOG_BOTS, "*", _("Refused telnet connection from %s (tried using my botnetnick)"), dcc[idx].host);
-      killsock(dcc[idx].sock);
-      lostdcc(idx);
-      return;
-    } else if (in_chain(dcc[idx].nick)) {
-      struct chat_info *ci;
-
-      ci = dcc[idx].u.chat;
-      dcc[idx].type = &DCC_DUPWAIT;
-      dcc[idx].u.dupwait = calloc(1, sizeof(struct dupwait_info));
-      dcc[idx].u.dupwait->chat = ci;
-      dcc[idx].u.dupwait->atr = atr;
-      return;
-    }
-  }
   dcc_telnet_pass(idx, atr);
 }
 
@@ -1316,23 +760,6 @@
   get_user_flagrec(dcc[idx].user, &fr, NULL);
   /* No password set? */
   if (u_pass_match(dcc[idx].user, "-")) {
-    if (glob_bot(fr)) {
-      char ps[20];
-
-      makepass(ps);
-      set_user(&USERENTRY_PASS, dcc[idx].user, ps);
-      changeover_dcc(idx, &DCC_BOT_NEW, sizeof(struct bot_info));
-
-      dcc[idx].status = STAT_CALLED;
-      dprintf(idx, "*hello!\n");
-      greet_new_bot(idx);
-#ifdef NO_OLD_BOTNET
-      dprintf(idx, "h %s\n", ps);
-#else
-      dprintf(idx, "handshake %s\n", ps);
-#endif
-      return;
-    }
     dprintf(idx, "Can't telnet until you have a password set.\n");
     putlog(LOG_MISC, "*", _("Refused [%s]%s (no password)"), dcc[idx].nick, dcc[idx].host);
     killsock(dcc[idx].sock);
@@ -1340,13 +767,6 @@
     return;
   }
   ok = 0;
-  if (dcc[idx].type == &DCC_DUPWAIT) {
-    struct chat_info *ci;
-
-    ci = dcc[idx].u.dupwait->chat;
-    free(dcc[idx].u.dupwait);
-    dcc[idx].u.chat = ci;
-  }
   dcc[idx].type = &DCC_CHAT_PASS;
   dcc[idx].timeval = now;
   if (glob_botmast(fr))
@@ -1365,31 +785,8 @@
     dcc[idx].u.file->chat = ci;
   }
 
-  if (glob_bot(fr)) {
-    /* Must generate a string consisting of our process ID and the current
-     * time. The bot will add it's password to the end and use it to generate
-     * an MD5 checksum (always 128bit). The checksum is sent back and this
-     * end does the same. The remote bot is only allowed access if the
-     * checksums match.
-     *
-     * Please don't fuck with 'timeval', or the digest we generate later for
-     * authentication will not be correct - you've been warned ;)
-     * <Cybah>
-     */
-    putlog(LOG_BOTS, "*", _("Challenging %s..."), dcc[idx].nick);
-    dprintf(idx, "passreq <%x%x@%s>\n", getpid(), dcc[idx].timeval, botnetnick);
-  } else {
-    /* NOTE: The MD5 digest used above to prevent cleartext passwords being
-     *       sent across the net will _only_ work when we have the cleartext
-     *       password. User passwords are encrypted (with blowfish usually)
-     *       so the same thing cant be done. Botnet passwords are always
-     *       stored in cleartext, or at least something that can be reversed.
-     *       <Cybah>
-     */
-
     /* Turn off remote telnet echo (send IAC WILL ECHO). */
     dprintf(idx, "\n%s" TLN_IAC_C TLN_WILL_C TLN_ECHO_C "\n", _("Enter your password."));
-  }
 }
 
 static void eof_dcc_telnet_id(int idx)
@@ -1647,8 +1044,6 @@
     if (dcc[idx].type == &DCC_CHAT) {
       if (dcc[idx].u.chat->channel >= 0) {
 	chanout_but(-1, dcc[idx].u.chat->channel, _("*** %s has joined the party line.\n"), dcc[idx].nick);
-	if (dcc[idx].u.chat->channel < 10000)
-	  botnet_send_join_idx(idx, -1);
 	check_bind_chjn(botnetnick, dcc[idx].nick, dcc[idx].u.chat->channel,
 		       geticon(dcc[idx].user), dcc[idx].sock, dcc[idx].host);
       }
@@ -1905,8 +1300,6 @@
       ok = 0;
     else if (!(u->flags & USER_PARTY))
       ok = 0;
-    if (!ok && u && (u->flags & USER_BOT))
-      ok = 1;
     if (!ok && (dcc[idx].status & LSTN_PUBLIC))
       ok = 1;
     if (!ok) {
Index: eggdrop1.7/src/dccutil.c
diff -u eggdrop1.7/src/dccutil.c:1.54 eggdrop1.7/src/dccutil.c:1.55
--- eggdrop1.7/src/dccutil.c:1.54	Sun May 26 03:34:13 2002
+++ eggdrop1.7/src/dccutil.c	Fri Sep 20 16:41:49 2002
@@ -27,7 +27,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: dccutil.c,v 1.54 2002/05/26 08:34:13 stdarg Exp $";
+static const char rcsid[] = "$Id: dccutil.c,v 1.55 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include <sys/stat.h>
@@ -35,7 +35,6 @@
 #include <errno.h>
 #include "chan.h"
 #include "modules.h"
-#include "tandem.h"
 #include "logfile.h"
 #include "misc.h"
 #include "cmdt.h"		/* cmd_t				*/
@@ -43,10 +42,12 @@
 #include "core_binds.h"		/* check_bind_chon, check_bind_chjn,
 				   check_bind_chof, check_bind_away	*/
 #include "dccutil.h"		/* prototypes				*/
+#include "users.h" /* get_user_by_handle */
 
 extern struct dcc_t	*dcc;
+extern struct userrec *userlist;
 extern int		 dcc_total, max_dcc, dcc_flood_thr, backgrd, MAXSOCKS;
-extern char		 botnetnick[], spaces[], version[];
+extern char		 spaces[], version[];
 extern time_t		 now;
 extern sock_list	*socklist;
 
@@ -54,6 +55,7 @@
 extern struct dcc_table	DCC_CHAT, DCC_LOST;
 #endif /* MAKING_MODS   */
 
+char botnetnick[HANDLEN + 1] = "";
 char	motdfile[121] = "text/motd";	/* File where the motd is stored */
 int	connect_timeout = 15;		/* How long to wait before a telnet
 					   connection times out */
@@ -226,11 +228,6 @@
       if (i == -2)
 	i = 0;
       dcc[idx].u.chat->channel = i;
-      if (dcc[idx].u.chat->channel >= 0) {
-	if (dcc[idx].u.chat->channel < 100000) {
-	  botnet_send_join_idx(idx, -1);
-	}
-      }
       check_bind_chjn(botnetnick, dcc[idx].nick, dcc[idx].u.chat->channel,
 		     geticon(dcc[idx].user), dcc[idx].sock, dcc[idx].host);
     }
@@ -344,9 +341,6 @@
   if (dcc[idx].u.chat->channel >= 0) {
     chanout_but(-1, dcc[idx].u.chat->channel,
 		"*** %s is no longer away.\n", dcc[idx].nick);
-    if (dcc[idx].u.chat->channel < 100000) {
-      botnet_send_away(-1, botnetnick, dcc[idx].sock, NULL, idx);
-    }
   }
   dprintf(idx, "You're not away any more.\n");
   free_null(dcc[idx].u.chat->away);
@@ -369,9 +363,6 @@
   if (dcc[idx].u.chat->channel >= 0) {
     chanout_but(-1, dcc[idx].u.chat->channel,
 		"*** %s is now away: %s\n", dcc[idx].nick, s);
-    if (dcc[idx].u.chat->channel < 100000) {
-      botnet_send_away(-1, botnetnick, dcc[idx].sock, s, idx);
-    }
   }
   dprintf(idx, "You are now away.\n");
   check_bind_away(botnetnick, dcc[idx].sock, s);
@@ -468,8 +459,6 @@
 
 	snprintf(x, sizeof x, _("%s has been forcibly removed for flooding.\n"), dcc[idx].nick);
 	chanout_but(idx, chat->channel, "*** %s", x);
-	if (chat->channel < 100000)
-	  botnet_send_part_idx(idx, x);
       }
       check_bind_chof(dcc[idx].nick, dcc[idx].sock);
       if ((dcc[idx].sock != STDOUT) || backgrd) {
@@ -504,8 +493,6 @@
     snprintf(x, sizeof x, _("%s booted %s from the party line%s%s\n"), by, dcc[idx].nick,
 		 reason[0] ? ": " : "", reason);
     chanout_but(idx, dcc[idx].u.chat->channel, "*** %s.\n", x);
-    if (dcc[idx].u.chat->channel < 100000)
-      botnet_send_part_idx(idx, x);
   }
   check_bind_chof(dcc[idx].nick, dcc[idx].sock);
   if ((dcc[idx].sock != STDOUT) || backgrd) {
@@ -517,4 +504,101 @@
     dcc_chatter(idx);
   }
   return;
+}
+
+int add_note(char *to, char *from, char *msg, int idx, int echo)
+{
+  int status, i, iaway, sock;
+  char ss[81], ssf[81];
+  struct userrec *u;
+
+  if (strlen(msg) > 450)
+    msg[450] = 0;		/* Notes have a limit */
+  /* note length + PRIVMSG header + nickname + date  must be <512  */
+  /* Might be form "sock:nick" */
+  splitc(ssf, from, ':');
+  rmspace(ssf);
+  splitc(ss, to, ':');
+  rmspace(ss);
+  if (!ss[0])
+    sock = (-1);
+  else
+    sock = atoi(ss);
+  /* Don't process if there's a note binding for it */
+  if (idx != (-2)) {		/* Notes from bots don't trigger it */
+    if (check_bind_note(from, to, msg)) {
+      if ((idx >= 0) && (echo))
+	dprintf(idx, "-> %s: %s\n", to, msg);
+      return NOTE_TCL;
+    }
+  }
+  if (!(u = get_user_by_handle(userlist, to))) {
+    if (idx >= 0)
+      dprintf(idx, _("I dont know anyone by that name.\n"));
+    return NOTE_ERROR;
+  }
+  if (is_bot(u)) {
+    if (idx >= 0)
+      dprintf(idx, _("Thats a bot.  You cant leave notes for a bot.\n"));
+    return NOTE_ERROR;
+  }
+  if (match_noterej(u, from)) {
+    if (idx >= 0)
+       dprintf(idx, "%s %s\n", u->handle, "rejected your note.");
+    return NOTE_REJECT;
+  }
+  status = NOTE_STORED;
+  iaway = 0;
+  /* Online right now? */
+  for (i = 0; i < dcc_total; i++) {
+    if (dcc[i].type && (dcc[i].type->flags & DCT_GETNOTES) &&
+	((sock == (-1)) || (sock == dcc[i].sock)) &&
+	(!strcasecmp(dcc[i].nick, to))) {
+      int aok = 1;
+
+      if (dcc[i].type == &DCC_CHAT)
+	if ((dcc[i].u.chat->away != NULL) &&
+	    (idx != (-2))) {
+	  /* Only check away if it's not from a bot */
+	  aok = 0;
+	  if (idx >= 0)
+	    dprintf(idx, "%s %s: %s\n", dcc[i].nick, _("is away"),
+		    dcc[i].u.chat->away);
+	  if (!iaway)
+	    iaway = i;
+	  status = NOTE_AWAY;
+	}
+      if (aok) {
+	char *p, *fr = from;
+	int l = 0;
+	char work[1024];
+
+	while ((*msg == '<') || (*msg == '>')) {
+	  p = newsplit(&msg);
+	  if (*p == '<')
+	    l += simple_sprintf(work + l, "via %s, ", p + 1);
+	  else if (*from == '@')
+	    fr = p + 1;
+	}
+	if (idx == -2 || (!strcasecmp(from, botnetnick)))
+	  dprintf(i, "*** [%s] %s%s\n", fr, l ? work : "", msg);
+	else
+	  dprintf(i, "%cNote [%s]: %s%s\n", 7, fr, l ? work : "", msg);
+	if ((idx >= 0) && (echo))
+	  dprintf(idx, "-> %s: %s\n", to, msg);
+	return NOTE_OK;
+      }
+    }
+  }
+  if (idx == (-2))
+    return NOTE_OK;		/* Error msg from a tandembot: don't store */
+  status = storenote(from, to, msg, idx, NULL, 0);
+  if (status < 0) status = NOTE_ERROR;
+  else if (status == NOTE_AWAY) {
+      /* User is away in all sessions -- just notify the user that a
+       * message arrived and was stored. (only oldest session is notified.)
+       */
+      dprintf(iaway, "*** %s.\n", _("Note arrived for you"));
+  }
+  return(status);
 }
Index: eggdrop1.7/src/dccutil.h
diff -u eggdrop1.7/src/dccutil.h:1.2 eggdrop1.7/src/dccutil.h:1.3
--- eggdrop1.7/src/dccutil.h:1.2	Sun May  5 11:40:38 2002
+++ eggdrop1.7/src/dccutil.h	Fri Sep 20 16:41:49 2002
@@ -19,7 +19,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 /*
- * $Id: dccutil.h,v 1.2 2002/05/05 16:40:38 tothwolf Exp $
+ * $Id: dccutil.h,v 1.3 2002/09/20 21:41:49 stdarg Exp $
  */
 
 #ifndef _EGG_DCCUTIL_H
@@ -57,5 +57,8 @@
 void changeover_dcc(int, struct dcc_table *, int);
 void do_boot(int, char *, char *);
 int detect_dcc_flood(time_t *, struct chat_info *, int);
+
+/* Moved there since there is no botnet */
+int add_note(char *to, char *from, char *msg, int idx, int echo);
 
 #endif				/* !_EGG_DCCUTIL_H */
Index: eggdrop1.7/src/main.c
diff -u eggdrop1.7/src/main.c:1.121 eggdrop1.7/src/main.c:1.122
--- eggdrop1.7/src/main.c:1.121	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/src/main.c	Fri Sep 20 16:41:49 2002
@@ -30,7 +30,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: main.c,v 1.121 2002/09/20 02:06:25 stdarg Exp $";
+static const char rcsid[] = "$Id: main.c,v 1.122 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"
@@ -41,7 +41,6 @@
 #include <netdb.h>
 #include <setjmp.h>
 #include "users.h"			/* check_expired_ignores, 
-					   autolink_cycle,
 					   get_user_by_handle		*/
 #include "chanprog.h"			/* tell_verbose_status, 
 					   chanprog, rehash		*/
@@ -60,7 +59,6 @@
 
 #include "chan.h"
 #include "modules.h"
-#include "tandem.h"
 #include "bg.h"
 #include "core_binds.h"
 #include "logfile.h"
@@ -387,7 +385,6 @@
     lastmin = (lastmin + 1) % 60;
     call_hook(HOOK_MINUTELY);
     check_expired_ignores();
-    autolink_cycle(NULL);	/* Attempt autolinks */
     /* In case for some reason more than 1 min has passed: */
     while (nowtm.tm_min != lastmin) {
       /* Timer drift, dammit */
@@ -452,11 +449,9 @@
 
 void kill_tcl();
 extern module_entry *module_list;
-void restart_chons();
 
 int init_userent(), init_net(),
  init_tcl(int, char **);
-void botnet_init();
 void dns_init();
 void binds_init();
 void dcc_init();
@@ -589,7 +584,6 @@
   dcc_init();
   user_init();
   init_userent();
-  botnet_init();
   init_net();
   traffic_init();
 
@@ -704,7 +698,6 @@
   }
 
   online_since = now;
-  autolink_cycle(NULL);		/* Hurry and connect to tandem bots */
   add_help_reference("cmds1.help");
   add_help_reference("cmds2.help");
   add_help_reference("core.help");
@@ -868,7 +861,6 @@
 	 */
 	x(NULL);
 	rehash();
-	restart_chons();
 	call_hook(HOOK_LOADED);
       }
       do_restart = 0;
Index: eggdrop1.7/src/misc.c
diff -u eggdrop1.7/src/misc.c:1.68 eggdrop1.7/src/misc.c:1.69
--- eggdrop1.7/src/misc.c:1.68	Tue Jun 18 01:12:32 2002
+++ eggdrop1.7/src/misc.c	Fri Sep 20 16:41:49 2002
@@ -27,7 +27,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: misc.c,v 1.68 2002/06/18 06:12:32 guppy Exp $";
+static const char rcsid[] = "$Id: misc.c,v 1.69 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"
@@ -35,7 +35,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include "chan.h"
-#include "tandem.h"
 #include "modules.h"
 #include "logfile.h"
 #include "dccutil.h"		/* dprintf_eggdrop, chatout		*/
@@ -978,8 +977,6 @@
 {
   call_hook(HOOK_DIE);
   chatout("*** %s\n", s1);
-  botnet_send_chat(-1, botnetnick, s1);
-  botnet_send_bye();
   write_userfile(-1);
   fatal(s2, 0);
 }
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.118 eggdrop1.7/src/modules.c:1.119
--- eggdrop1.7/src/modules.c:1.118	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/src/modules.c	Fri Sep 20 16:41:49 2002
@@ -25,12 +25,11 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: modules.c,v 1.118 2002/09/20 02:06:25 stdarg Exp $";
+static const char rcsid[] = "$Id: modules.c,v 1.119 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"		/* NOTE: when removing this, include config.h */
 #include "modules.h"
-#include "tandem.h"
 #include "core_binds.h"
 #include "logfile.h"
 #include "misc.h"
@@ -38,9 +37,6 @@
 #include "cmdt.h"		/* cmd_t				*/
 #include "tclhash.h"
 #include "core_binds.h"
-#include "botnet.h"		/* updatebot, nextbot, zapfbot,
-				   in_chain				*/
-#include "botmsg.h"		/* add_note				*/
 #include "chanprog.h"		/* clear_chanlist, reaffirm_owners, 
 				   logmodes, masktype, isowner, 
 				   clear_chanlist_member		*/
@@ -87,12 +83,10 @@
 extern time_t now, online_since;
 extern egg_timeval_t egg_timeval_now;
 extern struct chanset_t *chanset;
-extern tand_t *tandbot;
-extern party_t *party;
 extern sock_list        *socklist;
 
 #ifndef MAKING_MODS
-extern struct dcc_table DCC_CHAT_PASS, DCC_BOT, DCC_LOST, DCC_DNSWAIT,
+extern struct dcc_table DCC_CHAT_PASS, DCC_LOST, DCC_DNSWAIT,
 			DCC_CHAT; 
 #endif /* MAKING_MODS   */
 
@@ -203,22 +197,22 @@
   0,
   0,
   /* 24 - 27 */
-  (Function) botnet_send_zapf,
-  (Function) botnet_send_zapf_broad,
-  (Function) botnet_send_unlinked,
-  (Function) botnet_send_bye,
+  (Function) 0, /* botnet_send_zapf, */
+  (Function) 0, /* botnet_send_zapf_broad, */
+  (Function) 0, /* botnet_send_unlinked, */
+  (Function) 0, /* botnet_send_bye, */
   /* 28 - 31 */
-  (Function) botnet_send_chat,
-  (Function) botnet_send_filereject,
-  (Function) botnet_send_filesend,
-  (Function) botnet_send_filereq,
+  (Function) 0, /* botnet_send_chat, */
+  (Function) 0, /* botnet_send_filereject, */
+  (Function) 0, /* botnet_send_filesend, */
+  (Function) 0, /* botnet_send_filereq, */
   /* 32 - 35 */
-  (Function) botnet_send_join_idx,
-  (Function) botnet_send_part_idx,
-  (Function) updatebot,
-  (Function) nextbot,
+  (Function) 0, /* botnet_send_join_idx, */
+  (Function) 0, /* botnet_send_part_idx, */
+  (Function) 0, /* updatebot, */
+  (Function) 0, /* nextbot, */
   /* 36 - 39 */
-  (Function) zapfbot,
+  (Function) 0, /* zapfbot, */
   (Function) 0,
   (Function) u_pass_match,
   (Function) 0,
@@ -258,7 +252,7 @@
   (Function) flagrec_eq,
   (Function) flagrec_ok,
   /* 68 - 71 */
-  (Function) & shareout,
+  (Function) 0, /* & shareout, */
   (Function) dprintf,
   (Function) chatout,
   (Function) chanout_but,
@@ -329,7 +323,7 @@
   (Function) botnetnick,	 /* char *				*/
   /* 124 - 127 */
   (Function) & DCC_CHAT_PASS,	 /* struct dcc_table *			*/
-  (Function) & DCC_BOT,		 /* struct dcc_table *			*/
+  (Function) 0, /* & DCC_BOT,		 / struct dcc_table *			*/
   (Function) & DCC_LOST,	 /* struct dcc_table *			*/
   (Function) & DCC_CHAT,	 /* struct dcc_table *			*/
   /* 128 - 131 */
@@ -376,7 +370,7 @@
   (Function) touch_laston,
   (Function) & add_mode,	/* Function *				*/
   (Function) 0,
-  (Function) in_chain,
+  (Function) 0, /* in_chain, */
   /* 164 - 167 */
   (Function) add_note,
   (Function) 0,
@@ -420,7 +414,7 @@
   /* 196 - 199 */
   (Function) & USERENTRY_LASTON,	/* struct user_entry_type *	*/
   (Function) putlog,
-  (Function) botnet_send_chan,
+  (Function) 0, /* botnet_send_chan, */
   (Function) list_type_kill,
   /* 200 - 203 */
   (Function) logmodes,
@@ -484,8 +478,8 @@
   (Function) & userfile_perm,	 /* int					*/
   /* 248 - 251 */
   (Function) sock_has_data,
-  (Function) bots_in_subtree,
-  (Function) users_in_subtree,
+  (Function) 0, /* bots_in_subtree, */
+  (Function) 0, /* users_in_subtree, */
   (Function) 0,			/* inet_aton				*/
   /* 252 - 255 */
   (Function) 0,			/* snprintf				*/
@@ -496,9 +490,9 @@
   (Function) fixfrom,
   (Function) 0,
   (Function) 0,
-  (Function) & tandbot,		/* tand_t *				*/
+  (Function) 0, /* & tandbot,		/ tand_t *				*/
   /* 260 - 263 */
-  (Function) & party,		/* party_t *				*/
+  (Function) 0, /* & party,		/ party_t *				*/
   (Function) open_address_listen,
   (Function) 0,
   (Function) 0,
@@ -778,12 +772,6 @@
     case HOOK_DECRYPT_STRING:
       decrypt_string = (char *(*)(char *, char *)) func;
       break; 
-    case HOOK_SHAREOUT:
-      shareout = (void (*)()) func;
-      break;
-    case HOOK_SHAREIN:
-      sharein = (void (*)(int, char *)) func;
-      break;
     case HOOK_QSERV:
       if (qserver == (void (*)(int, char *, int)) null_func)
 	qserver = (void (*)(int, char *, int)) func;
Index: eggdrop1.7/src/tcl.c
diff -u eggdrop1.7/src/tcl.c:1.83 eggdrop1.7/src/tcl.c:1.84
--- eggdrop1.7/src/tcl.c:1.83	Mon Jun 17 11:39:38 2002
+++ eggdrop1.7/src/tcl.c	Fri Sep 20 16:41:49 2002
@@ -25,7 +25,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: tcl.c,v 1.83 2002/06/17 16:39:38 guppy Exp $";
+static const char rcsid[] = "$Id: tcl.c,v 1.84 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include <stdlib.h>		/* getenv()				*/
@@ -63,7 +63,7 @@
 		bannerfile[], egg_version[], natip[], configfile[],
 		textdir[], myip6[], pid_file[];
 extern int	die_on_sighup, die_on_sigterm, dcc_total, debug_output,
-		identtimeout, egg_numver, share_unlinks, tands,
+		identtimeout, egg_numver,
 		userfile_perm, default_uflags, strict_host;
 extern struct dcc_t	*dcc;
 
@@ -89,16 +89,10 @@
 {
   if (strcasecmp(botnetnick, new)) {
     /* Trying to change bot's nickname */
-    if (tands > 0) {
-      putlog(LOG_MISC, "*", "* Tried to change my botnet nick, but I'm still linked to a botnet.");
-      putlog(LOG_MISC, "*", "* (Unlink and try again.)");
-      return;
-    } else {
       if (botnetnick[0])
 	putlog(LOG_MISC, "*", "* IDENTITY CHANGE: %s -> %s", botnetnick, new);
       strcpy(botnetnick, new);
     }
-  }
 }
 
 
@@ -310,7 +304,6 @@
   {"die_on_sigterm",		&die_on_sigterm,	1},
   {"remote_boots",		&remote_boots,		1},
   {"debug_output",		&debug_output,		1},
-  {"share_unlinks",		&share_unlinks,		0},
   {"allow_dk_cmds",		&allow_dk_cmds,		0},
   {"use_exempts",		&use_exempts,		0},			/* Jason/drummer */
   {"use_invites",		&use_invites,		0},			/* Jason/drummer */
Index: eggdrop1.7/src/tcldcc.c
diff -u eggdrop1.7/src/tcldcc.c:1.66 eggdrop1.7/src/tcldcc.c:1.67
--- eggdrop1.7/src/tcldcc.c:1.66	Tue Jun 18 01:12:32 2002
+++ eggdrop1.7/src/tcldcc.c	Fri Sep 20 16:41:49 2002
@@ -23,18 +23,16 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: tcldcc.c,v 1.66 2002/06/18 06:12:32 guppy Exp $";
+static const char rcsid[] = "$Id: tcldcc.c,v 1.67 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"
-#include "tandem.h"
 #include "modules.h"
 #include "logfile.h"
 #include "misc.h"
 #include "cmdt.h"		/* cmd_t				*/
 #include "core_binds.h"		/* check_bind_chpt, check_bind_chjn,
 				   check_bind_bcst, check_bind_chof	*/
-#include "botnet.h"		/* nextbot, botlink, botunlink, lastbot	*/
 #include "chanprog.h"		/* masktype, logmodes			*/
 #include "dccutil.h"		/* chatout, chanout_but, lostdcc
 				   not_away, set_away, new_dcc		*/
@@ -48,8 +46,6 @@
 extern int		 dcc_total, backgrd, parties, make_userfile,
 			 do_restart, remote_boots, max_dcc;
 extern char		 botnetnick[];
-extern party_t		*party;
-extern tand_t		*tandbot;
 extern time_t		 now;
 
 /* Traffic stuff. */
@@ -113,7 +109,6 @@
 static int script_dccbroadcast(char *msg)
 {
   chatout("*** %s\n", msg);
-  botnet_send_chat(-1, botnetnick, msg);
   return(0);
 }
 
@@ -130,57 +125,6 @@
   return(-1);
 }
 
-static int script_getchan(int idx)
-{
-  if (idx < 0 || !(dcc[idx].type) ||
-      (dcc[idx].type != &DCC_CHAT && dcc[idx].type != &DCC_SCRIPT)) {
-    return(-2);
-  }
-  if (dcc[idx].type == &DCC_SCRIPT)
-    return(dcc[idx].u.script->u.chat->channel);
-  else
-    return(dcc[idx].u.chat->channel);
-}
-
-static int script_setchan(int idx, int chan)
-{
-  int oldchan;
-
-  if (idx < 0 || !(dcc[idx].type) ||
-      (dcc[idx].type != &DCC_CHAT && dcc[idx].type != &DCC_SCRIPT)) {
-    return(1);
-  }
-
-  if ((chan < -1) || (chan > 199999)) {
-    return(1);
-  }
-  if (dcc[idx].type == &DCC_SCRIPT) {
-    dcc[idx].u.script->u.chat->channel = chan;
-    return(0);
-  }
-
-  oldchan = dcc[idx].u.chat->channel;
-
-  if (oldchan >= 0) {
-    if ((chan >= GLOBAL_CHANS) && (oldchan < GLOBAL_CHANS)) botnet_send_part_idx(idx, "*script*");
-    check_bind_chpt(botnetnick, dcc[idx].nick, idx, oldchan);
-  }
-  dcc[idx].u.chat->channel = chan;
-  if (chan < GLOBAL_CHANS) botnet_send_join_idx(idx, oldchan);
-  check_bind_chjn(botnetnick, dcc[idx].nick, chan, geticon(dcc[idx].user),
-	   idx, dcc[idx].host);
-  return(0);
-}
-
-static int script_dccputchan(int chan, char *msg)
-{
-  if ((chan < 0) || (chan > 199999)) return(1);
-  chanout_but(-1, chan, "*** %s\n", msg);
-  botnet_send_chan(-1, botnetnick, NULL, chan, msg);
-  check_bind_bcst(botnetnick, chan, msg);
-  return(0);
-}
-
 static int script_console(script_var_t *retval, int nargs, int idx, char *what)
 {
 	static char *view[2];
@@ -271,7 +215,6 @@
 		  dcc[idx].nick);
       check_bind_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
 		     dcc[idx].u.chat->channel);
-      botnet_send_part_idx(idx, "gone");
     }
     check_bind_chof(dcc[idx].nick, dcc[idx].sock);
   }
@@ -324,10 +267,6 @@
     chanout_but(idx, dcc[idx].u.chat->channel, "*** %s has left the %s%s%s\n",
 		dcc[idx].nick, dcc[idx].u.chat ? "channel" : "partyline",
 		reason ? ": " : "", reason ? reason : "");
-    botnet_send_part_idx(idx, reason ? reason : "");
-    if ((dcc[idx].u.chat->channel >= 0) && (dcc[idx].u.chat->channel < GLOBAL_CHANS)) {
-      check_bind_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
-    }
     check_bind_chof(dcc[idx].nick, dcc[idx].sock);
     /* Notice is sent to the party line, the script can add a reason. */
   }
@@ -336,73 +275,12 @@
   return TCL_OK;
 }
 
-static int script_putbot(char *target, char *text)
-{
-  int i;
-
-  i = nextbot(target);
-  if (i < 0) return(1);
-  botnet_send_zapf(i, botnetnick, target, text);
-  return(0);
-}
-
-static int script_putallbots(char *text)
-{
-	botnet_send_zapf_broad(-1, botnetnick, NULL, text);
-	return(0);
-}
-
 static char *script_idx2hand(int idx)
 {
 	if (idx < 0 || idx >= dcc_total || !(dcc[idx].type) || !(dcc[idx].nick)) return("");
 	return(dcc[idx].nick);
 }
 
-static int script_islinked(char *bot)
-{
-	return nextbot(bot);
-}
-
-static int script_bots(script_var_t *retval)
-{
-	char **botlist = NULL;
-	int nbots = 0;
-	tand_t *bot;
-
-	for (bot = tandbot; bot; bot = bot->next) {
-		nbots++;
-		botlist = (char **)realloc(botlist, sizeof(char *) * nbots);
-		botlist[nbots-1] = strdup(bot->bot);
-	}
-	retval->type = SCRIPT_ARRAY | SCRIPT_FREE | SCRIPT_STRING;
-	retval->value = (void *)botlist;
-	retval->len = nbots;
-	return(0);
-}
-
-static int script_botlist(script_var_t *retval)
-{
-	tand_t *bot;
-	script_var_t *sublist, *nick, *uplink, *version, *share;
-	char sharestr[2];
-
-	retval->type = SCRIPT_ARRAY | SCRIPT_FREE | SCRIPT_VAR;
-	retval->len = 0;
-	retval->value = NULL;
-	sharestr[1] = 0;
-	for (bot = tandbot; bot; bot = bot->next) {
-		nick = script_string(bot->bot, -1);
-		uplink = script_string((bot->uplink == (tand_t *)1) ? botnetnick : bot->uplink->bot, -1);
-		version = script_int(bot->ver);
-		sharestr[0] = bot->share;
-		share = script_copy_string(sharestr, -1);
-
-		sublist = script_list(4, nick, uplink, version, share);
-		script_list_append(retval, sublist);
-	}
-	return(0);
-}
-
 /* list of { idx nick host type {other}  timestamp}
  */
 static int script_dcclist(script_var_t *retval, char *match)
@@ -434,53 +312,6 @@
 	return(0);
 }
 
-static void whom_entry(script_var_t *retval, char *nick, char *bot, char *host ,char icon, int idletime, char *away, int chan)
-{
-	script_var_t *sublist, *vnick, *vbot, *vhost, *vflag, *vidle, *vaway, *vchan;
-	char flag[2];
-
-	vnick = script_string(nick, -1);
-	vbot = script_string(bot, -1);
-	vhost = script_string(host, -1);
-
-	flag[0] = icon;
-	flag[1] = 0;
-	vflag = script_copy_string(flag, 1);
-
-	vidle = script_int((now - idletime) / 60);
-	vaway = script_string(away ? away : "", -1);
-	vchan = script_int(chan);
-
-	sublist = script_list(7, vnick, vbot, vhost, vflag, vidle, vaway, vchan);
-	script_list_append(retval, sublist);
-}
-
-/* list of {nick bot host flag idletime awaymsg channel}
- */
-static int script_whom(script_var_t *retval, int nargs, int which_chan)
-{
-	int i;
-
-	retval->type = SCRIPT_ARRAY | SCRIPT_FREE | SCRIPT_VAR;
-	retval->len = 0;
-	retval->value = NULL;
-
-	if (nargs == 0) which_chan = -1;
-
-	for (i = 0; i < dcc_total; i++) {
-		if (dcc[i].type != &DCC_CHAT) continue;
-		if (which_chan != -1 && dcc[i].u.chat->channel != which_chan) continue;
-		whom_entry(retval, dcc[i].nick, botnetnick, dcc[i].host,
-		geticon(dcc[i].user), dcc[i].timeval, dcc[i].u.chat->away,
-		dcc[i].u.chat->channel);
-	}
-	for (i = 0; i < parties; i++) {
-		if (which_chan != -1 && party[i].chan != which_chan) continue;
-		whom_entry(retval, party[i].nick, party[i].bot, party[i].from, party[i].flag, party[i].timer, party[i].status & PLSTAT_AWAY ? party[i].away : "", party[i].chan);
-	}
-	return(0);
-}
-
 static int script_dccused()
 {
 	return(dcc_total);
@@ -510,34 +341,6 @@
 	return(0);
 }
 
-static int script_link(char *via, char *target)
-{
-	int x, i;
-
-	if (!via) x = botlink("", -2, target);
-	else {
-		x = 1;
-		i = nextbot(via);
-		if (i < 0) x = 0;
-		else botnet_send_link(i, botnetnick, via, target);
-	}
-	return(x);
-}
-
-static int script_unlink(char *bot, char *comment)
-{
-	int i, x;
-
-	i = nextbot(bot);
-	if (i < 0) return(0);
-	if (!strcasecmp(bot, dcc[i].nick)) x = botunlink(-2, bot, comment);
-	else {
-		x = 1;
-		botnet_send_unlink(i, botnetnick, lastbot(bot), bot, comment);
-	}
-	return(x);
-}
-
 static int script_connect(char *hostname, int port)
 {
   int i, z, sock;
@@ -679,12 +482,8 @@
     whonick[HANDLEN] = 0;
     if (!strcasecmp(who, botnetnick))
        strlcpy(who, whonick, sizeof who);
-    else if (remote_boots > 0) {
-      i = nextbot(who);
-      if (i < 0) return(0);
-      botnet_send_reject(i, botnetnick, NULL, whonick, who, reason ? reason : "");
-    }
-    else return(0);
+    else
+        return(0);
   }
   for (i = 0; i < dcc_total; i++)
     if ((dcc[i].type) && (dcc[i].type->flags & DCT_CANBOOT) &&
@@ -736,14 +535,14 @@
 		script_int(traffic.out_today.irc),
 		script_int(traffic.out_today.irc + traffic.out_total.irc));
 	script_list_append(retval, sublist);
-
+/*
 	sublist = script_list(5, script_string("botnet", -1),
 		script_int(traffic.in_today.bn),
 		script_int(traffic.in_today.bn + traffic.in_total.bn),
 		script_int(traffic.out_today.bn),
 		script_int(traffic.out_today.bn + traffic.out_total.bn));
 	script_list_append(retval, sublist);
-
+*/
 	sublist = script_list(5, script_string("dcc", -1),
 		script_int(traffic.in_today.dcc),
 		script_int(traffic.in_today.dcc + traffic.in_total.dcc),
@@ -797,30 +596,19 @@
 	{"", "dccsimul", script_dccsimul, NULL, 2, "is", "idx command", SCRIPT_INTEGER, 0},
 	{"", "dccbroadcast", script_dccbroadcast, NULL, 1, "s", "text", SCRIPT_INTEGER, 0},
 	{"", "hand2idx", script_hand2idx, NULL, 1, "s", "handle", SCRIPT_INTEGER, 0},
-	{"", "getchan", script_getchan, NULL, 2, "i", "idx", SCRIPT_INTEGER, 0},
-	{"", "setchan", script_setchan, NULL, 2, "ii", "idx chan", SCRIPT_INTEGER, 0},
-	{"", "dccputchan", script_dccputchan, NULL, 2, "is", "chan text", SCRIPT_INTEGER, 0},
 	{"", "valididx", script_valididx, NULL, 1, "i", "idx", SCRIPT_INTEGER, 0},
-	{"", "putbot", script_putbot, NULL, 2, "ss", "bot text", SCRIPT_INTEGER, 0},
-	{"", "putallbots", script_putallbots, NULL, 1, "s", "text", SCRIPT_INTEGER, 0},
 	{"", "idx2hand", script_idx2hand, NULL, 1, "i", "idx", SCRIPT_INTEGER, 0},
-	{"", "islinked", script_islinked, NULL, 1, "s", "bot", SCRIPT_INTEGER, 0},
 	{"", "dccused", script_dccused, NULL, 0, "", "", SCRIPT_INTEGER, 0},
 	{"", "getdccidle", script_getdccidle, NULL, 1, "i", "idx", SCRIPT_INTEGER, 0},
 	{"", "getdccaway", script_getdccaway, NULL, 1, "i", "idx", SCRIPT_STRING, 0},
 	{"", "setdccaway", script_setdccaway, NULL, 2, "is", "idx msg", SCRIPT_INTEGER, 0},
-	{"", "unlink", script_unlink, NULL, 2, "ss", "bot comment", SCRIPT_INTEGER, 0},
 	{"", "boot", script_boot, NULL, 2,"ss", "user at bot reason", SCRIPT_INTEGER, 0},
 	{"", "rehash", script_rehash, NULL, 0,"", "", SCRIPT_INTEGER, 0},
 	{"", "restart", script_restart, NULL, 0, "", "", SCRIPT_INTEGER, 0},
 	{"", "console", script_console, NULL, 1, "is", "idx ?changes?", 0, SCRIPT_PASS_RETVAL|SCRIPT_PASS_COUNT|SCRIPT_VAR_ARGS},
 	{"", "echo", script_echo, NULL, 1, "ii", "idx ?status?", SCRIPT_INTEGER, SCRIPT_PASS_COUNT|SCRIPT_VAR_ARGS},
 	{"", "page", script_page, NULL, 1, "ii", "idx ?status?", SCRIPT_INTEGER, SCRIPT_PASS_COUNT|SCRIPT_VAR_ARGS},
-	{"", "bots", script_bots, NULL, 0, "", "", 0, SCRIPT_PASS_RETVAL},
-	{"", "botlist", script_botlist, NULL, 0, "", "", 0, SCRIPT_PASS_RETVAL},
 	{"", "dcclist", script_dcclist, NULL, 0, "s", "?match?", 0, SCRIPT_PASS_RETVAL|SCRIPT_VAR_ARGS},
-	{"", "link", script_link, NULL, 1, "ss", "?via-bot? target-bot", 0, SCRIPT_VAR_ARGS | SCRIPT_VAR_FRONT},
-	{"", "whom", script_whom, NULL, 0, "i", "?channel?", 0, SCRIPT_PASS_RETVAL|SCRIPT_PASS_COUNT|SCRIPT_VAR_ARGS},
 	{"", "control", script_control, NULL, 1, "ic", "idx ?callback?", SCRIPT_INTEGER, SCRIPT_VAR_ARGS},
 	{"", "killdcc", script_killdcc, NULL, 1, "i", "idx", SCRIPT_INTEGER, 0},
 	{"", "connect", script_connect, NULL, 2, "si", "host port", SCRIPT_INTEGER, 0},
Index: eggdrop1.7/src/tclmisc.c
diff -u eggdrop1.7/src/tclmisc.c:1.55 eggdrop1.7/src/tclmisc.c:1.56
--- eggdrop1.7/src/tclmisc.c:1.55	Sun May 12 00:59:52 2002
+++ eggdrop1.7/src/tclmisc.c	Fri Sep 20 16:41:49 2002
@@ -23,18 +23,18 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: tclmisc.c,v 1.55 2002/05/12 05:59:52 stdarg Exp $";
+static const char rcsid[] = "$Id: tclmisc.c,v 1.56 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include <sys/stat.h>
 #include "main.h"
 #include "modules.h"
 #include "core_binds.h"
-#include "tandem.h"
+//#include "tandem.h"
 #include "md5.h"
 #include "logfile.h"
 #include "misc.h"
-#include "botmsg.h"		/* add_note				*/
+#include "dccutil.h"		/* add_note				*/
 #include "net.h"		/* getmyip				*/
 #include "users.h"		/* get_user_by_nick, get_user_by_handle	*/
 #ifdef HAVE_UNAME
Index: eggdrop1.7/src/tcluser.c
diff -u eggdrop1.7/src/tcluser.c:1.42 eggdrop1.7/src/tcluser.c:1.43
--- eggdrop1.7/src/tcluser.c:1.42	Sun May  5 11:40:39 2002
+++ eggdrop1.7/src/tcluser.c	Fri Sep 20 16:41:49 2002
@@ -23,15 +23,13 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: tcluser.c,v 1.42 2002/05/05 16:40:39 tothwolf Exp $";
+static const char rcsid[] = "$Id: tcluser.c,v 1.43 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"
 #include "users.h"
 #include "chan.h"
-#include "tandem.h"
 #include "flags.h"		/* FR_*, FLAGS_*, flags_*, :-P		*/
-#include "botnet.h"		/* nextbot				*/
 #include "chanprog.h"		/* reload				*/
 #include "userrec.h"		/* count_users, u_pass_match, deluser,
 				   delhost_by_handle, write_userfile,
@@ -292,25 +290,13 @@
     if (strchr(BADHANDCHARS, newhand[0]) != NULL) return(0);
     if (strlen(newhand) < 1) return(0);
     if (get_user_by_handle(userlist, newhand)) return(0);
-    if (!strcasecmp(botnetnick, newhand) &&
-             (!(u->flags & USER_BOT) || nextbot(desired_handle) != -1)) return(0);
+    if (!strcasecmp(botnetnick, newhand) && (!(u->flags & USER_BOT)))
+      return(0);
     if (newhand[0] == '*') return(0);
 
 	return change_handle(u, newhand);
 }
 
-static int script_getting_users()
-{
-  int i;
-
-  for (i = 0; i < dcc_total; i++) {
-    if (dcc[i].type == &DCC_BOT && dcc[i].status & STAT_GETTING) {
-	return(1);
-    }
-  }
-  return(0);
-}
-
 static int script_isignore(char *nick_user_host)
 {
   return match_ignore(nick_user_host);
@@ -443,7 +429,6 @@
 	{"", "save", (Function) script_save, NULL, 0, "", "", SCRIPT_INTEGER, 0},
 	{"", "reload", (Function) script_reload, NULL, 0, "", "", SCRIPT_INTEGER, 0},
 	{"", "chhandle", (Function) script_chhandle, NULL, 2, "Us", "handle new-handle", SCRIPT_INTEGER, 0},
-	{"", "getting_users", (Function) script_getting_users, NULL, 0, "", "", SCRIPT_INTEGER, 0},
 	{"", "isignore", (Function) script_isignore, NULL, 1, "s", "nick!user at host", SCRIPT_INTEGER, 0},
 	{"", "newignore", (Function) script_newignore, NULL, 3, "sssi", "hostmask creator comment ?minutes?", SCRIPT_INTEGER, SCRIPT_PASS_COUNT | SCRIPT_VAR_ARGS},
 	{"", "killignore", (Function) script_killignore, NULL, 1, "s", "hostmask", SCRIPT_INTEGER, 0},
Index: eggdrop1.7/src/userrec.c
diff -u eggdrop1.7/src/userrec.c:1.51 eggdrop1.7/src/userrec.c:1.52
--- eggdrop1.7/src/userrec.c:1.51	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/src/userrec.c	Fri Sep 20 16:41:49 2002
@@ -25,7 +25,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: userrec.c,v 1.51 2002/09/20 02:06:25 stdarg Exp $";
+static const char rcsid[] = "$Id: userrec.c,v 1.52 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include <sys/stat.h>
@@ -33,7 +33,6 @@
 #include "users.h"
 #include "chan.h"
 #include "modules.h"
-#include "tandem.h"
 #include "logfile.h"
 #include "modules.h"		/* encrypt_pass				*/
 #include "cmdt.h"		/* cmd_t				*/
@@ -53,7 +52,7 @@
 extern time_t		 now;
 
 #ifndef MAKING_MODS
-extern struct dcc_table DCC_CHAT, DCC_BOT;
+extern struct dcc_table DCC_CHAT;
 #endif /* MAKING_MODS   */
 
 int		 noshare = 1;		/* don't send out to sharebots	    */
@@ -409,13 +408,11 @@
   strlcpy(s, u->handle, sizeof s);
   strlcpy(u->handle, newh, sizeof u->handle);
   for (i = 0; i < dcc_total; i++)
-    if (dcc[i].type && dcc[i].type != &DCC_BOT && !strcasecmp(dcc[i].nick, s)) {
+    if (!strcasecmp(dcc[i].nick, s)) {
       strlcpy(dcc[i].nick, newh, sizeof dcc[i].nick);
       if (dcc[i].type == &DCC_CHAT && dcc[i].u.chat->channel >= 0) {
 	chanout_but(-1, dcc[i].u.chat->channel,
 		    "*** Handle change: %s -> %s\n", s, newh);
-	if (dcc[i].u.chat->channel < 100000)
-	  botnet_send_nkch(i, s);
       }
     }
   return 1;
Index: eggdrop1.7/src/users.c
diff -u eggdrop1.7/src/users.c:1.41 eggdrop1.7/src/users.c:1.42
--- eggdrop1.7/src/users.c:1.41	Sun May 12 00:59:52 2002
+++ eggdrop1.7/src/users.c	Fri Sep 20 16:41:49 2002
@@ -31,17 +31,15 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: users.c,v 1.41 2002/05/12 05:59:52 stdarg Exp $";
+static const char rcsid[] = "$Id: users.c,v 1.42 2002/09/20 21:41:49 stdarg Exp $";
 #endif
 
 #include "main.h"
 #include "users.h"
 #include "chan.h"
 #include "modules.h"
-#include "tandem.h"
 #include "logfile.h"
 #include "misc.h"
-#include "botnet.h"		/* in_chain, nextbot, rembot, botlink	*/
 #include "chanprog.h"		/* clear_chanlist			*/
 #include "dccutil.h"		/* shareout, dprintf_eggdrop, chatout,
 				   lostdcc				*/
@@ -989,123 +987,4 @@
   noshare = noxtra = 0;
   /* process the user data *now* */
   return 1;
-}
-
-/* New methodology - cycle through list 3 times
- * 1st time scan for +sh bots and link if none connected
- * 2nd time scan for +h bots
- * 3rd time scan for +a/+h bots */
-void autolink_cycle(char *start)
-{
-  struct userrec *u = userlist, *autc = NULL;
-  static int cycle = 0;
-  int got_hub = 0, got_alt = 0, got_shared = 0, linked, ready = 0, i,
-   bfl;
-
-  /* don't start a new cycle if some links are still pending */
-  if (!start) {
-    for (i = 0; i < dcc_total; i++) {
-      if (dcc[i].type == &DCC_BOT_NEW)
-	return;
-      if (dcc[i].type == &DCC_FORK_BOT)
-	return;
-      if ((dcc[i].type == &DCC_DNSWAIT) &&
-	  (dcc[i].u.dns && (dcc[i].u.dns->type == &DCC_FORK_BOT)))
-	return;
-    }
-  }
-  if (!start) {
-    ready = 1;
-    cycle = 0;
-  }				/* new run through the user list */
-  while (u && !autc) {
-    while (u && !autc) {
-      if (u->flags & USER_BOT) {
-	bfl = bot_flags(u);
-	if (bfl & (BOT_HUB | BOT_ALT)) {
-	  linked = 0;
-	  for (i = 0; i < dcc_total; i++) {
-	    if (dcc[i].user == u) {
-	      if (dcc[i].type == &DCC_BOT)
-		linked = 1;
-	      if (dcc[i].type == &DCC_BOT_NEW)
-		linked = 1;
-	      if (dcc[i].type == &DCC_FORK_BOT)
-		linked = 1;
-	    }
-	  }
-	  if ((bfl & BOT_HUB) && (bfl & BOT_SHARE)) {
-	    if (linked)
-	      got_shared = 1;
-	    else if (!cycle && ready && !autc)
-	      autc = u;
-	  } else if ((bfl & BOT_HUB) && cycle > 0) {
-	    if (linked)
-	      got_hub = 1;
-	    else if ((cycle == 1) && ready && !autc)
-	      autc = u;
-	  } else if ((bfl & BOT_ALT) && (cycle == 2)) {
-	    if (linked)
-	      got_alt = 1;
-	    else if (!in_chain(u->handle) && ready && !autc)
-	      autc = u;
-	  }
-	  /* did we make it where we're supposed to start?  yay! */
-	  if (!ready)
-	    if (!strcasecmp(u->handle, start)) {
-	      ready = 1;
-	      autc = NULL;
-	      /* if starting point is a +h bot, must be in 2nd cycle */
-	      if ((bfl & BOT_HUB) && !(bfl & BOT_SHARE)) {
-		cycle = 1;
-	      }
-	      /* if starting point is a +a bot, must be in 3rd cycle */
-	      if (bfl & BOT_ALT) {
-		cycle = 2;
-	      }
-	    }
-	}
-	if (!cycle && (bfl & BOT_REJECT) && in_chain(u->handle)) {
-	  /* get rid of nasty reject bot */
-	  int i;
-
-	  i = nextbot(u->handle);
-	  if ((i >= 0) && !strcasecmp(dcc[i].nick, u->handle)) {
-	    char *p = _("rejected");
-
-	    /* we're directly connected to the offending bot?! (shudder!) */
-	    putlog(LOG_BOTS, "*", "%s %s", _("Rejecting bot"), dcc[i].nick);
-	    chatout("*** %s bot %s\n", p, dcc[i].nick);
-	    botnet_send_unlinked(i, dcc[i].nick, p);
-	    dprintf(i, "bye %s\n", _("Rejecting bot"));
-	    killsock(dcc[i].sock);
-	    lostdcc(i);
-	  } else if ((i < 0) && strcasecmp(botnetnick, u->handle)) {
-	    /* The bot is not connected, but listed in our tandem list! */
-	    putlog(LOG_BOTS, "*", "(!) BUG: rejecting not connected bot %s!",
-		   u->handle);
-	    rembot(u->handle);
-	  }
-	}
-      }
-      u = u->next;
-    }
-    if (!autc) {
-      if (!cycle && !got_shared) {
-	cycle++;
-	u = userlist;
-      } else if ((cycle == 1) && !(got_shared || got_hub)) {
-	cycle++;
-	u = userlist;
-      }
-    }
-  }
-  if (got_shared && !cycle)
-    autc = NULL;
-  else if ((got_shared || got_hub) && (cycle == 1))
-    autc = NULL;
-  else if ((got_shared || got_hub || got_alt) && (cycle == 2))
-    autc = NULL;
-  if (autc)
-    botlink("", -3, autc->handle);	/* try autoconnect */
 }
Index: eggdrop1.7/src/users.h
diff -u eggdrop1.7/src/users.h:1.14 eggdrop1.7/src/users.h:1.15
--- eggdrop1.7/src/users.h:1.14	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/src/users.h	Fri Sep 20 16:41:49 2002
@@ -22,7 +22,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 /*
- * $Id: users.h,v 1.14 2002/09/20 02:06:25 stdarg Exp $
+ * $Id: users.h,v 1.15 2002/09/20 21:41:49 stdarg Exp $
  */
 
 #ifndef _EGG_USERS_H
@@ -125,7 +125,6 @@
 void tell_ignores(int, char *);
 int match_ignore(char *);
 void check_expired_ignores();
-void autolink_cycle(char *);
 void tell_file_stats(int, char *);
 void tell_user_ident(int, char *, int);
 void tell_users_match(int, char *, int, int, int, char *);
----------------------- End of diff -----------------------



More information about the Changes mailing list