Permalink
Browse files

Move certain global partyline output to existing and new console log …

…modes. Closes #8

Output mainly dealing with botlinking is now put under the 'b' console log mode and output dealing with messages coming from linked bots are now put under the new 'l' console mode.Many of these messages were only meant for (bot)masters but could be seen by anyone.

* Show botlinking messages only to console mode b for (bot)masters.
* Add new console log mode 'l' for linked bot messages.
* Update doc regarding dccbroadcast
* Refine wording of dccbroadcast documentation
  • Loading branch information...
Cizzle authored and vanosg committed Sep 26, 2017
1 parent c693748 commit b4852147737245e6d3b3c4732fa5cd29469dafff
@@ -154,6 +154,8 @@ logfile <logflags> <channel> "logs/logfile"
+---+------------------------------------------------------+
| k | kicks, bans, and mode changes on the channel |
+---+------------------------------------------------------+
| l | linked bot messages |
+---+------------------------------------------------------+
| m | private msgs, notices and ctcps to the bot |
+---+------------------------------------------------------+
| o | misc info, errors, etc (IMPORTANT STUFF) |
@@ -231,7 +233,7 @@ logfile <logflags> <channel> "logs/logfile"
Console Settings
----------------
set console "mkcobxs"
set console "mkcoblxs"
This is the default console mode. It uses the same event flags as the
log files do. The console channel is automatically set to your "primary"
channel, which is set in the modules section of the config file. Masters
@@ -1305,7 +1305,7 @@ putdcc <idx> <text> [-raw]
dccbroadcast <message>
^^^^^^^^^^^^^^^^^^^^^^
Description: sends a message to everyone on the party line across the botnet, in the form of "\*\*\* <message>" for local users and "\*\*\* (Bot) <message>" for users on other bots
Description: sends a message to everyone on the party line across the botnet, in the form of "\*\*\* <message>" for local users, "\*\*\* (Bot) <message>" for users on other bots with version below 1.8.3, and "(Bot) <message>" for users on other bots with version 1.8.3+ and console log mode 'l' enabled
Returns: nothing
@@ -2002,6 +2002,8 @@ logfile [<modes> <channel> <filename>]
+-----+---------------------------------------------------------------------+
| k | kicks, bans, and mode changes on the channel |
+-----+---------------------------------------------------------------------+
| l | linked bot messages |
+-----+---------------------------------------------------------------------+
| m | private msgs, notices and ctcps to the bot |
+-----+---------------------------------------------------------------------+
| o | misc info, errors, etc (IMPORTANT STUFF) |
View
@@ -127,6 +127,7 @@ set prefer-ipv6 0
# h - raw incoming share traffic
# j - joins, parts, quits, topic changes, and netsplits on the channel
# k - kicks, bans, and mode changes on the channel
# l - linked bot messages
# m - private msgs, notices and ctcps to the bot
# o - misc info, errors, etc (IMPORTANT STUFF)
# p - public text on the channel
@@ -226,7 +227,7 @@ set quiet-save 0
# which is set in the modules section of the config file. Masters can change
# their console channel and modes with the '.console' command.
set console "mkcobxs"
set console "mkcoblxs"
##### FILES AND DIRECTORIES #####
View
@@ -242,6 +242,7 @@ See also: chhandle
%{+m}
Masters only:
%bb%b information about bot linking and userfile sharing
%bl%b messages from linked bots
%bd%b misc debug information
%bc%b commands
%bo%b misc info, errors, etc (IMPORTANT STUFF)
View
@@ -171,7 +171,7 @@ static void bot_chat(int idx, char *par)
fake_alert(idx, "direction", from);
return;
}
chatout("*** (%s) %s\n", from, par);
putlog(LOG_BOTMSG, "*", "(%s) %s", from, par);
botnet_send_chat(idx, from, par);
check_tcl_bcst(from, -1, par);
}
@@ -299,8 +299,7 @@ static void bot_bye(int idx, char *par)
BOT_DISCONNECTED, dcc[idx].nick, par[0] ?
par : "No reason", bots, (bots != 1) ?
"s" : "", users, (users != 1) ? "s" : "");
putlog(LOG_BOTS, "*", "%s", s);
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(idx, dcc[idx].nick, s);
dprintf(idx, "*bye\n");
killsock(dcc[idx].sock);
@@ -697,7 +696,7 @@ static void bot_nlinked(int idx, char *par)
dprintf(idx, "error %s\n", BOT_YOUREALEAF);
}
if (s[0]) {
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(idx, dcc[idx].nick, s);
dprintf(idx, "bye %s\n", BOT_ILLEGALLINK);
killsock(dcc[idx].sock);
@@ -717,7 +716,7 @@ static void bot_nlinked(int idx, char *par)
i = base64_to_int(par);
botnet_send_nlinked(idx, newbot, next, x, i);
if (x == '!') {
chatout("*** (%s) %s %s.\n", next, NET_LINKEDTO, newbot);
putlog(LOG_BOTMSG, "*", "(%s) %s %s.", next, NET_LINKEDTO, newbot);
x = '-';
}
addbot(newbot, dcc[idx].nick, next, x, i);
@@ -742,7 +741,7 @@ static void bot_linked(int idx, char *par)
simple_sprintf(s, "%s %s (%s) (lost %d bot%s and %d user%s",
MISC_DISCONNECTED, dcc[idx].nick, MISC_OUTDATED,
bots, (bots != 1) ? "s" : "", users, (users != 1) ? "s" : "");
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(idx, dcc[idx].nick, s);
killsock(dcc[idx].sock);
lostdcc(idx);
@@ -761,7 +760,7 @@ static void bot_unlinked(int idx, char *par)
fake_alert(idx, "direction", bot);
else if (i >= 0) { /* Valid bot downstream of idx */
if (par[0])
chatout("*** (%s) %s\n", lastbot(bot), par);
putlog(LOG_BOTMSG, "*", "(%s) %s", lastbot(bot), par);
botnet_send_unlinked(idx, bot, par);
unvia(idx, findbot(bot));
rembot(bot);
@@ -876,12 +875,11 @@ static void bot_reject(int idx, char *par)
char s[1024];
/* I'm the connection to the rejected bot */
putlog(LOG_BOTS, "*", "%s %s %s", from, MISC_REJECTED, dcc[i].nick);
dprintf(i, "bye %s\n", par[0] ? par : MISC_REJECTED);
simple_sprintf(s, "%s %s (%s: %s)",
MISC_DISCONNECTED, dcc[i].nick, from,
par[0] ? par : MISC_REJECTED);
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(i, dcc[i].nick, s);
killsock(dcc[i].sock);
lostdcc(i);
@@ -941,7 +939,7 @@ static void bot_thisbot(int idx, char *par)
dprintf(idx, "bye %s\n", MISC_IMPOSTER);
simple_sprintf(s, "%s %s (%s)", MISC_DISCONNECTED, dcc[idx].nick,
MISC_IMPOSTER);
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(idx, dcc[idx].nick, s);
unvia(idx, findbot(dcc[idx].nick));
killsock(dcc[idx].sock);
View
@@ -926,7 +926,8 @@ int botunlink(int idx, char *nick, char *reason, char *from)
(users != 1) ? "s" : "");
dprintf(i, "bye No reason\n");
}
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
dprintf(idx, "%s.\n", s);
botnet_send_unlinked(i, dcc[i].nick, s);
killsock(dcc[i].sock);
lostdcc(i);
@@ -1656,14 +1657,13 @@ void check_botnet_pings()
if (dcc[i].status & STAT_PINGED) {
char s[1024];
putlog(LOG_BOTS, "*", "%s: %s", BOT_PINGTIMEOUT, dcc[i].nick);
bot = findbot(dcc[i].nick);
bots = bots_in_subtree(bot);
users = users_in_subtree(bot);
simple_sprintf(s, "%s: %s (lost %d bot%s and %d user%s)",
BOT_PINGTIMEOUT, dcc[i].nick, bots,
(bots != 1) ? "s" : "", users, (users != 1) ? "s" : "");
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(i, dcc[i].nick, s);
killsock(dcc[i].sock);
lostdcc(i);
@@ -1683,8 +1683,6 @@ void check_botnet_pings()
if (dcc[i].status & STAT_WARNED) {
char s[1024];
putlog(LOG_BOTS, "*", "%s %s (%s).", BOT_DISCONNECTED,
dcc[i].nick, BOT_BOTNOTLEAFLIKE);
dprintf(i, "bye %s\n", BOT_BOTNOTLEAFLIKE);
bot = findbot(dcc[i].nick);
bots = bots_in_subtree(bot);
@@ -1693,7 +1691,7 @@ void check_botnet_pings()
BOT_DISCONNECTED, dcc[i].nick, BOT_BOTNOTLEAFLIKE,
bots, (bots != 1) ? "s" : "", users, (users != 1) ?
"s" : "");
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(i, dcc[i].nick, s);
killsock(dcc[i].sock);
lostdcc(i);
@@ -1719,7 +1717,7 @@ void zapfbot(int idx)
simple_sprintf(s, "%s: %s (lost %d bot%s and %d user%s)", BOT_BOTDROPPED,
dcc[idx].nick, bots, (bots != 1) ? "s" : "", users,
(users != 1) ? "s" : "");
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
botnet_send_unlinked(idx, dcc[idx].nick, s);
killsock(dcc[idx].sock);
lostdcc(idx);
View
@@ -238,7 +238,6 @@ static void bot_version(int idx, char *par)
#endif
strncpyz(dcc[idx].u.bot->version, par, 120);
putlog(LOG_BOTS, "*", DCC_LINKED, dcc[idx].nick);
chatout("*** Linked to %s\n", dcc[idx].nick);
botnet_send_nlinked(idx, dcc[idx].nick, botnetnick, '!',
dcc[idx].u.bot->numver);
touch_laston(dcc[idx].user, "linked", now);
@@ -303,7 +302,7 @@ static void cont_link(int idx, char *buf, int i)
"Unlinked %s (restructure) (lost %d bot%s and %d user%s)",
dcc[i].nick, bots, (bots != 1) ? "s" : "",
users, (users != 1) ? "s" : "");
chatout("*** %s\n", x);
putlog(LOG_BOTS, "*", "%s.", x);
botnet_send_unlinked(i, dcc[i].nick, x);
dprintf(i, "bye %s\n", "restructure");
killsock(dcc[i].sock);
@@ -533,7 +532,6 @@ static void eof_dcc_bot(int idx)
dcc[idx].nick, bots, (bots != 1) ? "s" : "", users,
(users != 1) ? "s" : "");
putlog(LOG_BOTS, "*", "%s.", x);
chatout("*** %s\n", x);
botnet_send_unlinked(idx, dcc[idx].nick, x);
killsock(dcc[idx].sock);
lostdcc(idx);
View
@@ -626,7 +626,8 @@ typedef struct {
#define LOG_BOTSHRIN 0x400000 /* h incoming share traffic */
#define LOG_BOTNETOUT 0x800000 /* u outgoing botnet traffic */
#define LOG_BOTSHROUT 0x1000000 /* g outgoing share traffic */
#define LOG_ALL 0x1ffffff /* (dump to all logfiles) */
#define LOG_BOTMSG 0x2000000 /* l linked bot messages */
#define LOG_ALL 0x3ffffff /* (dump to all logfiles) */
/* Internal logfile flags
*/
View
@@ -63,6 +63,10 @@ int logmodes(char *s)
case 'B':
res |= LOG_BOTS;
break;
case 'l':
case 'L':
res |= LOG_BOTMSG;
break;
case 'r':
case 'R':
res |= raw_log ? LOG_RAW : 0;
@@ -136,7 +140,7 @@ int logmodes(char *s)
char *masktype(int x)
{
static char s[26]; /* Change this if you change the levels */
static char s[27]; /* Change this if you change the levels */
char *p = s;
if (x & LOG_MSGS)
@@ -153,6 +157,8 @@ char *masktype(int x)
*p++ = 'o';
if (x & LOG_BOTS)
*p++ = 'b';
if (x & LOG_BOTMSG)
*p++ = 'l';
if ((x & LOG_RAW) && raw_log)
*p++ = 'r';
if (x & LOG_FILES)
@@ -197,60 +203,62 @@ char *masktype(int x)
char *maskname(int x)
{
static char s[248]; /* Change this if you change the levels */
int i = 0;
static char s[280]; /* Change this if you change the levels */
int i = 0; /* 6+8+7+13+6+6+6+17+5+7+8+7+9+15+19+20+24+24+(8*9)+1 */
s[0] = 0;
if (x & LOG_MSGS)
i += my_strcpy(s, "msgs, ");
i += my_strcpy(s, "msgs, "); /* 6 */
if (x & LOG_PUBLIC)
i += my_strcpy(s + i, "public, ");
i += my_strcpy(s + i, "public, "); /* 8 */
if (x & LOG_JOIN)
i += my_strcpy(s + i, "joins, ");
i += my_strcpy(s + i, "joins, "); /* 7 */
if (x & LOG_MODES)
i += my_strcpy(s + i, "kicks/modes, ");
i += my_strcpy(s + i, "kicks/modes, "); /* 13 */
if (x & LOG_CMDS)
i += my_strcpy(s + i, "cmds, ");
i += my_strcpy(s + i, "cmds, "); /* 6 */
if (x & LOG_MISC)
i += my_strcpy(s + i, "misc, ");
i += my_strcpy(s + i, "misc, "); /* 6 */
if (x & LOG_BOTS)
i += my_strcpy(s + i, "bots, ");
i += my_strcpy(s + i, "bots, "); /* 6 */
if (x & LOG_BOTMSG)
i += my_strcpy(s + i, "linked bot msgs, "); /* 17 */
if ((x & LOG_RAW) && raw_log)
i += my_strcpy(s + i, "raw, ");
i += my_strcpy(s + i, "raw, "); /* 5 */
if (x & LOG_FILES)
i += my_strcpy(s + i, "files, ");
i += my_strcpy(s + i, "files, "); /* 7 */
if (x & LOG_SERV)
i += my_strcpy(s + i, "server, ");
i += my_strcpy(s + i, "server, "); /* 8 */
if (x & LOG_DEBUG)
i += my_strcpy(s + i, "debug, ");
i += my_strcpy(s + i, "debug, "); /* 7 */
if (x & LOG_WALL)
i += my_strcpy(s + i, "wallops, ");
i += my_strcpy(s + i, "wallops, "); /* 9 */
if ((x & LOG_SRVOUT) && raw_log)
i += my_strcpy(s + i, "server output, ");
i += my_strcpy(s + i, "server output, "); /* 15 */
if ((x & LOG_BOTNETIN) && raw_log)
i += my_strcpy(s + i, "botnet traffic in, ");
i += my_strcpy(s + i, "botnet traffic in, "); /* 19 */
if ((x & LOG_BOTNETOUT) && raw_log)
i += my_strcpy(s + i, "botnet traffic out, ");
i += my_strcpy(s + i, "botnet traffic out, "); /* 20 */
if ((x & LOG_BOTSHRIN) && raw_log)
i += my_strcpy(s + i, "incoming share traffic, ");
i += my_strcpy(s + i, "incoming share traffic, "); /* 24 */
if ((x & LOG_BOTSHROUT) && raw_log)
i += my_strcpy(s + i, "outgoing share traffic, ");
i += my_strcpy(s + i, "outgoing share traffic, "); /* 24 */
if (x & LOG_LEV1)
i += my_strcpy(s + i, "level 1, ");
i += my_strcpy(s + i, "level 1, "); /* 9 */
if (x & LOG_LEV2)
i += my_strcpy(s + i, "level 2, ");
i += my_strcpy(s + i, "level 2, "); /* 9 */
if (x & LOG_LEV3)
i += my_strcpy(s + i, "level 3, ");
i += my_strcpy(s + i, "level 3, "); /* 9 */
if (x & LOG_LEV4)
i += my_strcpy(s + i, "level 4, ");
i += my_strcpy(s + i, "level 4, "); /* 9 */
if (x & LOG_LEV5)
i += my_strcpy(s + i, "level 5, ");
i += my_strcpy(s + i, "level 5, "); /* 9 */
if (x & LOG_LEV6)
i += my_strcpy(s + i, "level 6, ");
i += my_strcpy(s + i, "level 6, "); /* 9 */
if (x & LOG_LEV7)
i += my_strcpy(s + i, "level 7, ");
i += my_strcpy(s + i, "level 7, "); /* 9 */
if (x & LOG_LEV8)
i += my_strcpy(s + i, "level 8, ");
i += my_strcpy(s + i, "level 8, "); /* 9 */
if (i)
s[i - 2] = 0;
else
@@ -357,7 +357,7 @@ static void eof_dcc_send(int idx)
dprintf(y, "bye\n");
egg_snprintf(s, sizeof s, TRANSFER_USERFILE_DISCON, dcc[y].nick);
botnet_send_unlinked(y, dcc[y].nick, s);
chatout("*** %s\n", dcc[y].nick, s);
putlog(LOG_BOTS, "*", "%s.", s);
if (y != idx) {
killsock(dcc[y].sock);
lostdcc(y);
@@ -576,7 +576,7 @@ static void eof_dcc_get(int idx)
dprintf(-dcc[y].sock, "bye\n");
egg_snprintf(s, sizeof s, TRANSFER_USERFILE_DISCON, dcc[y].nick);
botnet_send_unlinked(y, dcc[y].nick, s);
chatout("*** %s\n", s);
putlog(LOG_BOTS, "*", "%s.", s);
if (y != idx) {
killsock(dcc[y].sock);
lostdcc(y);
@@ -651,7 +651,7 @@ static void transfer_get_timeout(int i)
dprintf(y, "bye\n");
egg_snprintf(xx, sizeof xx, TRANSFER_DICONNECT_TIMEOUT, dcc[y].nick);
botnet_send_unlinked(y, dcc[y].nick, xx);
chatout("*** %s\n", xx);
putlog(LOG_BOTS, "*", "%s.", xx);
if (y < i) {
int t = y;
View
@@ -932,6 +932,6 @@ int check_conflags(struct flag_record *fr, int md)
md &= ~(LOG_MISC | LOG_CMDS);
}
if (!glob_botmast(*fr))
md &= ~LOG_BOTS;
md &= ~(LOG_BOTS | LOG_BOTMSG);
return md;
}
View
@@ -1071,8 +1071,7 @@ void autolink_cycle(char *start)
char *p = MISC_REJECTED;
/* we're directly connected to the offending bot?! (shudder!) */
putlog(LOG_BOTS, "*", "%s %s", BOT_REJECTING, dcc[i].nick);
chatout("*** %s bot %s\n", p, dcc[i].nick);
putlog(LOG_BOTS, "*", "%s bot %s.", p, dcc[i].nick);
botnet_send_unlinked(i, dcc[i].nick, p);
dprintf(i, "bye %s\n", BOT_REJECTING);
killsock(dcc[i].sock);

0 comments on commit b485214

Please sign in to comment.