Ejemplo n.º 1
0
static void botnet_send_assoc(int idx, int chan, char *nick, char *buf)
{
  char x[1024];
  int idx2;

  simple_sprintf(x, "assoc %D %s %s", chan, nick, buf);
  for (idx2 = 0; idx2 < dcc_total; idx2++)
    if ((dcc[idx2].type == &DCC_BOT) && (idx2 != idx) &&
        (b_numver(idx2) >= NEAT_BOTNET) &&
        !(bot_flags(dcc[idx2].user) & BOT_ISOLATE))
      botnet_send_zapf(idx2, botnetnick, dcc[idx2].nick, x);
}
Ejemplo n.º 2
0
/* dump list of links to a new bot */
void dump_links(int z)
{
  register int i, l;
  char x[1024];
  tand_t *bot;

  Context;
  for (bot = tandbot; bot; bot = bot->next) {
    char *p;

    if (bot->uplink == (tand_t *) 1)
      p = botnetnick;
    else
      p = bot->uplink->bot;
#ifndef NO_OLD_BOTNET
    if (b_numver(z) < NEAT_BOTNET)
      l = simple_sprintf(x, "nlinked %s %s %c%d\n", bot->bot,
			 p, bot->share, bot->ver);
    else
#endif
      l = simple_sprintf(x, "n %s %s %c%D\n", bot->bot, p,
			 bot->share, bot->ver);
    tputs(dcc[z].sock, x, l);
  }
  Context;
  if (!(bot_flags(dcc[z].user) & BOT_ISOLATE)) {
    /* dump party line members */
    for (i = 0; i < dcc_total; i++) {
      if (dcc[i].type == &DCC_CHAT) {
	if ((dcc[i].u.chat->channel >= 0) &&
	    (dcc[i].u.chat->channel < 100000)) {
#ifndef NO_OLD_BOTNET
	  if (b_numver(z) < NEAT_BOTNET)
	    l = simple_sprintf(x, "join %s %s %d %c%d %s\n",
			       botnetnick, dcc[i].nick,
			       dcc[i].u.chat->channel, geticon(i),
			       dcc[i].sock, dcc[i].host);
	  else
#endif
	    l = simple_sprintf(x, "j !%s %s %D %c%D %s\n",
			       botnetnick, dcc[i].nick,
			       dcc[i].u.chat->channel, geticon(i),
			       dcc[i].sock, dcc[i].host);
	  tputs(dcc[z].sock, x, l);
#ifndef NO_OLD_BOTNET
	  if (b_numver(z) < NEAT_BOTNET) {
	    if (dcc[i].u.chat->away) {
	      l = simple_sprintf(x, "away %s %d %s\n", botnetnick,
				 dcc[i].sock, dcc[i].u.chat->away);
	      tputs(dcc[z].sock, x, l);
	    }
	    l = simple_sprintf(x, "idle %s %d %d\n", botnetnick,
			       dcc[i].sock, now - dcc[i].timeval);
	  } else
#endif
	    l = simple_sprintf(x, "i %s %D %D %s\n", botnetnick,
			       dcc[i].sock, now - dcc[i].timeval,
			 dcc[i].u.chat->away ? dcc[i].u.chat->away : "");
	  tputs(dcc[z].sock, x, l);
	}
      }
    }
    Context;
    for (i = 0; i < parties; i++) {
#ifndef NO_OLD_BOTNET
      if (b_numver(z) < NEAT_BOTNET)
	l = simple_sprintf(x, "join %s %s %d %c%d %s\n",
			   party[i].bot, party[i].nick,
			   party[i].chan, party[i].flag,
			   party[i].sock, party[i].from);
      else
#endif
	l = simple_sprintf(x, "j %s %s %D %c%D %s\n",
			   party[i].bot, party[i].nick,
			   party[i].chan, party[i].flag,
			   party[i].sock, party[i].from);
      tputs(dcc[z].sock, x, l);
      if ((party[i].status & PLSTAT_AWAY) || (party[i].timer != 0)) {
#ifndef NO_OLD_BOTNET
	if (b_numver(z) < NEAT_BOTNET) {
	  if (party[i].status & PLSTAT_AWAY) {
	    l = simple_sprintf(x, "away %s %d %s\n", party[i].bot,
			       party[i].sock, party[i].away);
	    tputs(dcc[z].sock, x, l);
	  }
	  l = simple_sprintf(x, "idle %s %d %d\n", party[i].bot,
			     party[i].sock, now - party[i].timer);
	} else
#endif
	  l = simple_sprintf(x, "i %s %D %D %s\n", party[i].bot,
			     party[i].sock, now - party[i].timer,
			     party[i].away ? party[i].away : "");
	tputs(dcc[z].sock, x, l);
      }
    }
  }
  Context;
}