Exemplo n.º 1
0
static void bot_unlinked(int idx, char *par)
{
  int i;
  char *bot = NULL;

  bot = newsplit(&par);
  i = nextbot(bot);
  if ((i >= 0) && (i != idx))	/* Bot is NOT downstream along idx, so
				 * BOGUS! */
    fake_alert(idx, "direction", bot, "unlinked");
  else if (i >= 0) {		/* Valid bot downstream of idx */
    if (par[0])
/* #ifdef HUB */
      chatout("*** (%s) %s\n", lastbot(bot), par);
/*
#else
      chatout("*** %s unlinked from botnet.\n", par);
#endif 
*/
    botnet_send_unlinked(idx, bot, par);
    unvia(idx, findbot(bot));
    rembot(bot);
  }
  /* Otherwise it's not even a valid bot, so just ignore! */
}
Exemplo n.º 2
0
static int tcl_unlink(ClientData cd, Tcl_Interp *irp,
                      int argc, char *argv[])
{
  int i, x;
  char bot[HANDLEN + 1];

  BADARGS(2, 3, " bot ?comment?");

  strncpyz(bot, argv[1], sizeof bot);
  i = nextbot(bot);
  if (i < 0)
    x = 0;
  else {
    x = 1;
    if (!egg_strcasecmp(bot, dcc[i].nick))
      x = botunlink(-2, bot, argv[2], botnetnick);
    else
      botnet_send_unlink(i, botnetnick, lastbot(bot), bot, argv[2]);
  }
  egg_snprintf(bot, sizeof bot, "%d", x);

  Tcl_AppendResult(irp, bot, NULL);
  return TCL_OK;
}