[eggheads-patches] PATCH: botrecall2.patch

Peter 'Rattacresh' Backes rtc at rhrk.uni-kl.de
Sat Oct 16 11:29:47 CST 1999


botrecall.patch was completely messed up, use this one.

-- Peter 'Rattacresh' Backes, rtc at rhrk.uni-kl.de

-------------- next part --------------
diff -urN eggdrop1.3.29/doc/UPDATES1.3 eggdrop1.3.29+botrecall2/doc/UPDATES1.3
--- eggdrop1.3.29/doc/UPDATES1.3	Sat Oct 16 17:18:17 1999
+++ eggdrop1.3.29+botrecall2/doc/UPDATES1.3	Sat Oct 16 17:17:59 1999
@@ -4,6 +4,9 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          rtc       .chnick can now rename any +b to the bots nick if
+                    currently not connected, fixed .+user to not allow to
+                    create user accounts with the bots name.
           Tothwolf  major configure/Makefile changes
           Cybah	    strncpy() being used on buffers without terminating them.
 Tothwolf  Fabian    stopped userfile parsing funcs from messing with ~ and `
diff -urN eggdrop1.3.29/src/cmds.c eggdrop1.3.29+botrecall2/src/cmds.c
--- eggdrop1.3.29/src/cmds.c	Sat Oct 16 17:18:17 1999
+++ eggdrop1.3.29+botrecall2/src/cmds.c	Sat Oct 16 17:17:19 1999
@@ -810,8 +810,6 @@
   else if (get_user_by_handle(userlist, newhand) &&
           strcasecmp(hand, newhand))
     dprintf(idx, "Somebody is already using %s.\n", newhand);
-  else if (!strcasecmp(newhand, botnetnick))
-    dprintf(idx, "Hey! That's MY name!\n");
   else {
     u2 = get_user_by_handle(userlist, hand);
     atr2 = u2 ? u2->flags : 0;
@@ -825,6 +823,9 @@
       dprintf(idx, "Can't change the bot owner's handle.\n");
     else if (isowner(hand) && strcasecmp(dcc[idx].nick, hand))
       dprintf(idx, "Can't change the permanent bot owner's handle.\n");
+    else if (!strcasecmp(newhand, botnetnick) && (!(atr2 & USER_BOT) ||
+             nextbot(hand) != -1))
+      dprintf(idx, "Hey! That's MY name!\n");
     else if (change_handle(u2, newhand)) {
       putlog(LOG_CMDS, "*", "#%s# chnick %s %s", dcc[idx].nick,
             hand, newhand);
@@ -2278,11 +2279,13 @@
   host = newsplit(&par);
   if (strlen(handle) > HANDLEN)
     handle[HANDLEN] = 0;	/* max len = XX */
-  if (get_user_by_handle(userlist, handle)) {
+  if (get_user_by_handle(userlist, handle))
     dprintf(idx, "Someone already exists by that name.\n");
-  } else if (strchr(BADNICKCHARS, handle[0]) != NULL) {
+  else if (strchr(BADNICKCHARS, handle[0]) != NULL)
     dprintf(idx, "You can't start a nick with '%c'.\n", handle[0]);
-  } else {
+  else if (!strcasecmp(handle, botnetnick))
+    dprintf(idx, "Hey! That's MY name!\n");
+  else {
     putlog(LOG_CMDS, "*", "#%s# +user %s %s", dcc[idx].nick, handle, host);
     userlist = adduser(userlist, handle, host, "-", 0);
     dprintf(idx, "Added %s (%s) with no password or flags.\n", handle, host);
diff -urN eggdrop1.3.29/src/tcluser.c eggdrop1.3.29+botrecall2/src/tcluser.c
--- eggdrop1.3.29/src/tcluser.c	Sat Oct 16 17:18:17 1999
+++ eggdrop1.3.29+botrecall2/src/tcluser.c	Sat Oct 16 17:17:20 1999
@@ -381,7 +381,8 @@
       x = 0;
     else if (get_user_by_handle(userlist, hand))
       x = 0;
-    else if (!strcasecmp(origbotname, hand) || !rfc_casecmp(botnetnick, hand))
+    else if ((!strcasecmp(origbotname, hand) || !rfc_casecmp(botnetnick, hand)) &&
+             (!(u->flags & USER_BOT) || nextbot (argv [1]) != -1))
       x = 0;
     else if (hand[0] == '*')
       x = 0;
diff -urN eggdrop1.3.29/src/users.c eggdrop1.3.29+botrecall2/src/users.c
--- eggdrop1.3.29/src/users.c	Sat Oct 16 17:18:17 1999
+++ eggdrop1.3.29+botrecall2/src/users.c	Sat Oct 16 17:17:20 1999
@@ -986,6 +986,11 @@
   for (u = bu; u; u = u->next) {
     struct user_entry *e;
 
+    if (!(u->flags & USER_BOT) && !strcasecmp (u->handle, botnetnick)) {
+      putlog(LOG_MISC, "*", "(!) I have an user record, but without +b");
+      /* u->flags |= USER_BOT; */
+    }
+    
     for (e = u->entries; e; e = e->next)
       if (e->name) {
 	struct user_entry_type *uet = find_entry_type(e->name);


More information about the Patches mailing list