Bläddra i källkod

* Bots will now relink if they get a corrupt userfile.

svn: 551
Bryan Drewery 22 år sedan
förälder
incheckning
a70fb50cbb
2 ändrade filer med 12 tillägg och 1 borttagningar
  1. 1 0
      doc/UPDATES
  2. 11 1
      src/mod/share.mod/share.c

+ 1 - 0
doc/UPDATES

@@ -7,6 +7,7 @@ This is a summary of ChangeLog basically.
 4.Fixed a segfault in cmd_botcmd.
 5.msg_op now shows OP before STATS log.
 6.Fixed a cosmetic error in cmd_secpass.
+7.Bots will now relink if they get a corrupt userfile.
 
 1.0.14
 1.Fixed order of log/info for cmd_whoami.

+ 11 - 1
src/mod/share.mod/share.c

@@ -1800,10 +1800,11 @@ static void finish_share(int idx)
   checkchans(0); /* flag all the channels.. */
 Context;
   if (!readuserfile(dcc[idx].u.xfer->filename, &u)) {
+    char xx[1024];
 Context;
     unlink(dcc[idx].u.xfer->filename); //why the fuck was this not here, stupid eggdev team.
     loading = 0;
-    putlog(LOG_MISC, "@", "%s", USERF_CANTREAD);
+    putlog(LOG_MISC, "*", "%s", USERF_CANTREAD);
     clear_userlist(u);		/* Clear new, obsolete, user list.	*/
     clear_chanlist();		/* Remove all user references from the
 				   channel lists.			*/
@@ -1812,6 +1813,15 @@ Context;
     userlist = ou;		/* Revert to old user list.		*/
     lastuser = NULL;		/* Reset last accessed user ptr.	*/
     checkchans(2); 		/* un-flag the channels, we are keeping them.. */
+
+    dprintf(idx, "bye\n");
+    egg_snprintf(xx, sizeof xx, "Disconnected %s (can't read userfile)", dcc[idx].nick);
+    botnet_send_unlinked(idx, dcc[idx].nick, xx);
+    chatout("*** %s\n", xx);
+
+    killsock(dcc[idx].sock);
+    lostdcc(idx);
+
     return;
   }
   unlink(dcc[idx].u.xfer->filename); //I mean really, shit fills up the quota fast.