Prechádzať zdrojové kódy

* Fixed a bot with bot_buildts not being called
* putlog() oopses fixed


svn: 421

Bryan Drewery 22 rokov pred
rodič
commit
8ff2a788ff
2 zmenil súbory, kde vykonal 5 pridanie a 4 odobranie
  1. 3 3
      src/botcmd.c
  2. 2 1
      src/mod/update.mod/update.c

+ 3 - 3
src/botcmd.c

@@ -864,13 +864,13 @@ static void bot_traced(int idx, char *par)
   }
 }
 
-void bot_buildts(int idx, char *par)
+static void bot_buildts(int idx, char *par)
 {
   if (par && par[0])
     dcc[idx].u.bot->bts = atoi(par);
 }
 
-void bot_timesync(int idx, char *par)
+static void bot_timesync(int idx, char *par)
 {
   putlog(LOG_DEBUG, "@", "Got timesync from %s: %s\n", dcc[idx].nick, par);
   timesync = atoi(par) - now;
@@ -1320,6 +1320,7 @@ botcmd_t C_bot[] =
   {"a",			(Function) bot_actchan},
   {"aw",		(Function) bot_away},
   {"away",		(Function) bot_away},
+  {"bts",		(Function) bot_buildts},
   {"bye",		(Function) bot_bye},
   {"c",			(Function) bot_chan2},
   {"cg",                (Function) bot_config},
@@ -1348,7 +1349,6 @@ botcmd_t C_bot[] =
   {"t",			(Function) bot_trace},
   {"tb",		(Function) bot_thisbot},
   {"td",		(Function) bot_traced},
-  {"bts",		(Function) bot_buildts},
   {"ts", 		(Function) bot_timesync},
   {"u",			(Function) bot_update},
   {"ul",		(Function) bot_unlink},

+ 2 - 1
src/mod/update.mod/update.c

@@ -135,7 +135,7 @@ return;
 
   dcc[idx].status &= ~(STAT_GETTINGU | STAT_SENDINGU | STAT_OFFEREDU);
   if ((dcc[idx].u.bot->bts < buildts) && (isupdatehub())) {
-    putlog(LOG_DEBUG, "?", "Asking %s to accept update from me", dcc[idx].nick);
+    putlog(LOG_DEBUG, "@", "Asking %s to accept update from me", dcc[idx].nick);
     dprintf(idx, "sb u?\n");
     dcc[idx].status |= STAT_OFFEREDU;
   }
@@ -424,6 +424,7 @@ static void check_updates()
                        STAT_OFFEREDU);
 
       if ((dcc[i].u.bot->bts < buildts) && (isupdatehub())) {
+        putlog(LOG_DEBUG, "@", "Bot: %s has build %lu, offering them %lu", dcc[i].nick, dcc[i].u.bot->bts, buildts);
         dprintf(i, "sb u?\n");
         dcc[i].status |= STAT_OFFEREDU;
       }