Exemplo n.º 1
0
/*
[Dec 30 16:03:09.300934 2005] Source inspircd.nomadirc.net
[Dec 30 16:03:09.300990 2005] av[0] = Q
[Dec 30 16:03:09.301046 2005] av[1] = ChanServ
[Dec 30 16:03:09.301102 2005] av[2] = <Config>
[Dec 30 16:03:09.301158 2005] av[3] = 1135968312
[Dec 30 16:03:09.301214 2005] av[4] = 0
[Dec 30 16:03:09.301270 2005] av[5] = Reserved For Services

*/
int denora_event_addline(char *source, int ac, char **av)
{
    char *user, *host;
    int checkdur, timeset;
    char buf[BUFSIZE];
    checkdur = atoi(av[4]);
    timeset = atoi(av[3]);

    if (checkdur != 0) {
        ircsnprintf(buf, BUFSIZE, "%ld", (long int) (checkdur + timeset));
    } else {
        ircsnprintf(buf, BUFSIZE, "%ld", (long int) checkdur);
    }

    if (!stricmp(av[0], "G") || !stricmp(av[0], "E")) {
        user = myStrGetToken(av[1], '@', 0);
        host = myStrGetToken(av[1], '@', 1);
        sql_do_server_bans_add(av[0], user, host, av[2], av[3], buf,
                               av[5]);
        if (user)
            free(user);
        if (host)
            free(host);
    } else if (!stricmp(av[0], "Q")) {
        sql_do_server_bans_add(av[0], (char *) "*", av[1], av[2], av[3],
                               buf, av[5]);
    } else {
        sql_do_server_bans_add(av[0], (char *) "", av[1], av[2], av[3],
                               buf, av[5]);
    }
    return MOD_CONT;
}
Exemplo n.º 2
0
int denora_event_eline(char *source, int ac, char **av)
{
    char *user, *host;
    int checkdur;
    char buf[BUFSIZE];
    char buf2[BUFSIZE];

    user = myStrGetToken(av[0], '@', 0);
    host = myStrGetToken(av[0], '@', 1);

    if (ac >= 3) {
        ircsnprintf(buf, BUFSIZE, "%ld", (long int) time(NULL));
        checkdur = atoi(av[1]);
        if (checkdur != 0) {
            ircsnprintf(buf2, BUFSIZE, "%ld",
                        (long int) checkdur + time(NULL));
        } else {
            ircsnprintf(buf2, BUFSIZE, "%ld", (long int) checkdur);
        }
        sql_do_server_bans_add((char *) "E", user, host, source, buf, buf2,
                               av[2]);
    } else {
        sql_do_server_bans_remove((char *) "E", user, host);
    }
    if (user)
        free(user);
    if (host)
        free(host);
    return MOD_CONT;
}
Exemplo n.º 3
0
int denora_event_akill(char *source, int ac, char **av)
{
	if (denora->protocoldebug)
	{
		protocol_debug(source, ac, av);
	}
	sql_do_server_bans_add(NULL, av[1], av[0], av[3], av[4], av[2], av[5]);
	return MOD_CONT;
}
Exemplo n.º 4
0
int denora_event_kline(char *source, int ac, char **av)
{
    char buf[BUFSIZE];
    *buf = '\0';

    if (denora->protocoldebug) {
        protocol_debug(source, ac, av);
    }
    ircsnprintf(buf, BUFSIZE, "%ld", (long int) time(NULL));
    sql_do_server_bans_add(NULL, av[2], av[3], source, buf, av[1], av[4]);
    return MOD_CONT;
}
Exemplo n.º 5
0
int denora_event_qline(char *source, int ac, char **av)
{
    int checkdur;
    char buf[BUFSIZE];
    char buf2[BUFSIZE];

    if (ac >= 3) {
        ircsnprintf(buf, BUFSIZE, "%ld", (long int) time(NULL));
        checkdur = atoi(av[1]);
        if (checkdur != 0) {
            ircsnprintf(buf2, BUFSIZE, "%ld",
                        (long int) checkdur + time(NULL));
        } else {
            ircsnprintf(buf2, BUFSIZE, "%ld", (long int) checkdur);
        }
        sql_do_server_bans_add((char *) "Q", (char *) "*", av[0], source,
                               buf, buf2, av[2]);
    } else {
        sql_do_server_bans_remove((char *) "Q", (char *) "*", av[0]);
    }
    return MOD_CONT;
}