| View previous topic :: View next topic |
| Author |
Message |
exezic Voice
Joined: 31 Jan 2007 Posts: 3 Location: Norway
|
Posted: Wed Jan 31, 2007 8:17 am Post subject: Detecting dynamic bans expiry [not yet solved] |
|
|
| Code: | | [13:06] No longer banning *!*@exezic.users.quakenet.org on #dota.no (expired) |
Is there any way to detect when this happens?
My intension is to make a web-based banlist, and I therefore need it to be updated whenever a dynamic ban expires.
I am aware of the possibility of using a timer to check a list up against the current banlist. But I would prefer to just update the list whenever it is changed, instead of having a timer running in the background all the time.
I appreciate all and any responses. |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Wed Jan 31, 2007 5:32 pm Post subject: Re: Detecting dynamic bans expiry [not yet solved] |
|
|
| exezic wrote: | | Is there any way to detect when this happens? |
No. (you'd have to keep a copy of the list and compare it to the internal one to do that...but then you might as well create the html all over again) _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Jan 31, 2007 6:09 pm Post subject: |
|
|
If you have a botnet, you can bind to the botnet message.
Oh, and if you can compile your bot yourself, you can also consider to call something in src/mod/irc.mod/irc.c function check_expired_chanstuff() which seems to handle ban expires. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
exezic Voice
Joined: 31 Jan 2007 Posts: 3 Location: Norway
|
Posted: Fri Feb 02, 2007 9:46 am Post subject: |
|
|
| Ok, thanks, I might try your advice De Kus. |
|
| Back to top |
|
 |
exezic Voice
Joined: 31 Jan 2007 Posts: 3 Location: Norway
|
Posted: Mon Feb 05, 2007 1:07 pm Post subject: |
|
|
I cant seem to figure out what to bind to, I tried using:
| Code: | BOT
bind bot <flags> <command> <proc>
proc-name <from-bot> <command> <text>
Description: triggered by a message coming from another bot in the botnet. The first word is the command and the rest becomes the text argument; flags are ignored.
Module: core |
But the bot didnt return anything with this code:
| Code: | bind bot - * randomprocname
proc randomprocname { from cmd text } {
putlog "FROM: $from CMD: $cmd TEXT: $text"
} |
| Code: | | [17:14] BotA: cancel ban *!*@exezic.users.quakenet.org on #dota.no |
which I received on another bot in the botnet (BotB), which was running the script...
Any ideas?
Maybe it's something about the bind I'm missing, considering it's not stackable... Maybe it should be bound to something. But I'm not sure what the <command> is...
On a sidenote; I have access to compiling the bot myself. So if you could point out what I would need to do to make the bot detect whenever a ban expire, that would do aswell
Ok, so I figured out it wasn't actually in src/mod/irc.mod/irc.c function. It was actually in src/mod/channels.mod/userchan.c
I also found my way to the code:
| Code: | /* Check for expired timed-bans.
*/
static void check_expired_bans(void)
{
maskrec *u, *u2;
struct chanset_t *chan;
masklist *b;
for (u = global_bans; u; u = u2) {
u2 = u->next;
if (!(u->flags & MASKREC_PERM) && (now >= u->expire)) {
putlog(LOG_MISC, "*", "%s %s (%s)", BANS_NOLONGER, u->mask, MISC_EXPIRED);
for (chan = chanset; chan; chan = chan->next)
for (b = chan->channel.ban; b->mask[0]; b = b->next)
if (!rfc_casecmp(b->mask, u->mask) &&
expired_mask(chan, b->who) && b->timer != now) {
add_mode(chan, '-', 'b', u->mask);
b->timer = now;
}
u_delban(NULL, u->mask, 1);
}
}
/* Check for specific channel-domain bans expiring */
for (chan = chanset; chan; chan = chan->next) {
for (u = chan->bans; u; u = u2) {
u2 = u->next;
if (!(u->flags & MASKREC_PERM) && (now >= u->expire)) {
putlog(LOG_MISC, "*", "%s %s %s %s (%s)", BANS_NOLONGER,
u->mask, MISC_ONLOCALE, chan->dname, MISC_EXPIRED);
for (b = chan->channel.ban; b->mask[0]; b = b->next)
if (!rfc_casecmp(b->mask, u->mask) &&
expired_mask(chan, b->who) && b->timer != now) {
add_mode(chan, '-', 'b', u->mask);
b->timer = now;
}
u_delban(chan, u->mask, 1);
}
}
}
} |
I hope someone here can speak in c
Basically, I think I need some sort of bind which will react whenever a function is run. For instance, if I had put a function named event_expireban underneath
| Code: | putlog(LOG_MISC, "*", "%s %s %s %s (%s)", BANS_NOLONGER,
u->mask, MISC_ONLOCALE, chan->dname, MISC_EXPIRED); |
like so:
| Code: |
/* Check for specific channel-domain bans expiring */
for (chan = chanset; chan; chan = chan->next) {
for (u = chan->bans; u; u = u2) {
u2 = u->next;
if (!(u->flags & MASKREC_PERM) && (now >= u->expire)) {
putlog(LOG_MISC, "*", "%s %s %s %s (%s)", BANS_NOLONGER,
u->mask, MISC_ONLOCALE, chan->dname, MISC_EXPIRED);
-->event_expireban();<--
for (b = chan->channel.ban; b->mask[0]; b = b->next)
if (!rfc_casecmp(b->mask, u->mask) &&
expired_mask(chan, b->who) && b->timer != now) {
add_mode(chan, '-', 'b', u->mask);
b->timer = now;
}
u_delban(chan, u->mask, 1);
}
} |
and if the event_expireban() function would somehow be detected by
| Code: | | bind evnt - expireban procedurename |
in the same way rehash is detected by
| Code: | | bind evnt - rehash procedurename |
Then that would solve my problem, only problem is... I don't know how to do this :\
Any help will be greatly appreciated! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|