|
|
@@ -242,7 +242,9 @@ greet_new_bot(int idx)
|
|
|
dcc[idx].status |= STAT_LEAF;
|
|
|
dcc[idx].status |= STAT_LINKING;
|
|
|
|
|
|
- dprintf(idx, "v 1001500 9 Wraith %s <%s> %d %li %s %s\n", egg_version, "-", conf.bot->localhub, (long)buildts, commit, egg_version);
|
|
|
+ dprintf(idx, "v 1001500 9 Wraith %s %d %d %li %s %s\n", egg_version,
|
|
|
+ conf.bot->u->fflags, conf.bot->localhub, (long)buildts, commit,
|
|
|
+ egg_version);
|
|
|
|
|
|
for (int i = 0; i < dcc_total; i++) {
|
|
|
if (dcc[i].type && dcc[i].type == &DCC_FORK_BOT) {
|
|
|
@@ -255,6 +257,8 @@ greet_new_bot(int idx)
|
|
|
static void
|
|
|
bot_version(int idx, char *par)
|
|
|
{
|
|
|
+ char *work;
|
|
|
+
|
|
|
dcc[idx].timeval = now;
|
|
|
if (in_chain(dcc[idx].nick)) {
|
|
|
dprintf(idx, "error Sorry, already connected.\n");
|
|
|
@@ -265,8 +269,6 @@ bot_version(int idx, char *par)
|
|
|
}
|
|
|
|
|
|
if ((par[0] >= '0') && (par[0] <= '9')) {
|
|
|
- char *work = NULL;
|
|
|
-
|
|
|
work = newsplit(&par);
|
|
|
dcc[idx].u.bot->numver = atoi(work);
|
|
|
/* old numver crap */
|
|
|
@@ -293,11 +295,19 @@ bot_version(int idx, char *par)
|
|
|
char x[1024] = "", *vversion = NULL, *vcommit = NULL;
|
|
|
int vlocalhub = -1;
|
|
|
time_t vbuildts = 0;
|
|
|
+ int fflags = -1;
|
|
|
|
|
|
strlcpy(dcc[idx].u.bot->version, par, 120);
|
|
|
newsplit(&par); /* 'ver' */
|
|
|
newsplit(&par); /* handlen */
|
|
|
- newsplit(&par); /* network */
|
|
|
+ /* fflags / (backward compat: network) */
|
|
|
+ if (par[0]) {
|
|
|
+ work = newsplit(&par);
|
|
|
+ /* Must support older bots which sent '<->' here for network. */
|
|
|
+ if (strcmp(work, "<->")) {
|
|
|
+ fflags = atoi(work);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (par[0])
|
|
|
vlocalhub = atoi(newsplit(&par));
|
|
|
if (par[0])
|
|
|
@@ -334,7 +344,7 @@ bot_version(int idx, char *par)
|
|
|
dcc[idx].hub = 1;
|
|
|
}
|
|
|
|
|
|
- botnet_send_nlinked(idx, dcc[idx].nick, conf.bot->nick, '!', vlocalhub, vbuildts, vcommit, vversion);
|
|
|
+ botnet_send_nlinked(idx, dcc[idx].nick, conf.bot->nick, '!', vlocalhub, vbuildts, vcommit, vversion, fflags);
|
|
|
} else {
|
|
|
// This is now done in share_endstartup
|
|
|
//have_linked_to_hub = 1;
|
|
|
@@ -346,7 +356,7 @@ bot_version(int idx, char *par)
|
|
|
|
|
|
touch_laston(dcc[idx].user, "linked", now);
|
|
|
dcc[idx].type = &DCC_BOT;
|
|
|
- addbot(dcc[idx].nick, dcc[idx].nick, conf.bot->nick, '-', vlocalhub, vbuildts, vcommit, vversion);
|
|
|
+ addbot(dcc[idx].nick, dcc[idx].nick, conf.bot->nick, '-', vlocalhub, vbuildts, vcommit, vversion, fflags);
|
|
|
simple_snprintf(x, sizeof x, "v 1001500");
|
|
|
bot_share(idx, x);
|
|
|
dprintf(idx, "el\n");
|