Преглед на файлове

* Fixed an issue with bot respdoning to TCM CTCP VERSIONS too slowly at times on connect. (#128)

svn: 2268
Bryan Drewery преди 21 години
родител
ревизия
f277709408
променени са 5 файла, в които са добавени 19 реда и са изтрити 3 реда
  1. 3 2
      doc/UPDATES
  2. 12 1
      src/mod/ctcp.mod/ctcp.c
  3. 1 0
      src/mod/ctcp.mod/ctcp.h
  4. 1 0
      src/mod/server.mod/server.c
  5. 2 0
      src/mod/server.mod/servmsg.c

+ 3 - 2
doc/UPDATES

@@ -25,8 +25,9 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed localhub attempting to spawn itself during binary rehash and cmd_conf
 * Fixed another fatal bug with cmd_conf, this should fix it for good.
 * Added var 'manop-warn' to allow disabling the new manop NOTICE warnings when msg opping.
-* Added irc.ptptech.com to default servers/servers6
-* Fixed a segfault with mode parsing. (#25)
+* Added irc.ptptech.com/efnet.port80.se to default servers/servers6, added irc.pte.hu, irc.efnet.fr to servers.
+* Fixed a segfault/cpulock with mode parsing. (#25)
+* Fixed an issue with bot respdoning to TCM CTCP VERSIONS too slowly at times on connect. (#128)
 
 1.2.4
 * Fixed cmd_botset not displaying botnick.

+ 12 - 1
src/mod/ctcp.mod/ctcp.c

@@ -400,6 +400,8 @@ static int ctcp_PING(char *nick, char *uhost, struct userrec *u, char *object, c
   return BIND_RET_BREAK;
 }
 
+bool first_ctcp_check = 0;
+
 static int ctcp_VERSION(char *nick, char *uhost, struct userrec *u, char *object, char *keyword, char *text)
 {
   char s[50] = "";
@@ -432,7 +434,16 @@ static int ctcp_VERSION(char *nick, char *uhost, struct userrec *u, char *object
       break;
     }
   }
-  dprintf(DP_HELP, "NOTICE %s :\001%s %s%s\001\n", nick, keyword, ctcpversion, s);
+  
+  int queue = DP_HELP;
+
+  if (!first_ctcp_check) {
+    queue = DP_DUMP;
+    first_ctcp_check = 1;
+  }
+
+  dprintf(queue, "NOTICE %s :\001%s %s%s\001\n", nick, keyword, ctcpversion, s);
+
   if (ctcpversion2[0])
     dprintf(DP_HELP, "NOTICE %s :\001%s %s\001\n", nick, keyword, ctcpversion2);
   return BIND_RET_BREAK;

+ 1 - 0
src/mod/ctcp.mod/ctcp.h

@@ -36,5 +36,6 @@
 void ctcp_init();
 void scriptchanged();
 extern char		kickprefix[], bankickprefix[];
+extern bool		first_ctcp_check;
 
 #endif				/* _EGG_MOD_CTCP_CTCP_H */

+ 1 - 0
src/mod/server.mod/server.c

@@ -24,6 +24,7 @@
 #include "src/socket.h"
 #include "src/egg_timer.h"
 #include "src/mod/channels.mod/channels.h"
+#include "src/mod/ctcp.mod/ctcp.h"
 #include "src/mod/irc.mod/irc.h"
 #include "server.h"
 #include <stdarg.h>

+ 2 - 0
src/mod/server.mod/servmsg.c

@@ -1525,6 +1525,8 @@ static void server_dns_callback(int id, void *client_data, const char *host, cha
     strcpy(botname, origbotname);
     /* Start alternate nicks from the beginning */
     altnick_char = 0;
+    /* reset counter so first ctcp is dumped for tcms */
+    first_ctcp_check = 0;
 
     if (serverpass[0])
       dprintf(DP_MODE, "PASS %s\n", serverpass);