Exemple #1
0
int AnopeInit(int argc, char **argv)
{
    Command *c;
    EvtHook *evt;
    int status;

    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    moduleSetType(SUPPORTED);

    c = createCommand("REGISTER", my_ns_register, NULL, -1, -1, -1, -1,
                      -1);
    if ((status = moduleAddCommand(NICKSERV, c, MOD_HEAD))) {
        alog("[ns_maxemail] Unable to create REGISTER command: %d",
             status);
        return MOD_STOP;
    }

    c = createCommand("SET", my_ns_set, NULL, -1, -1, -1, -1, -1);
    if ((status = moduleAddCommand(NICKSERV, c, MOD_HEAD))) {
        alog("[ns_maxemail] Unable to create SET command: %d", status);
        return MOD_STOP;
    }

    evt = createEventHook(EVENT_RELOAD, my_event_reload);
    if ((status = moduleAddEventHook(evt))) {
        alog("[ns_maxemail] Unable to hook to EVENT_RELOAD: %d", status);
        return MOD_STOP;
    }

    my_load_config();
    my_add_languages();

    return MOD_CONT;
}
Exemple #2
0
int my_event_reload(int argc, char **argv)
{
    if ((argc > 0) && (stricmp(argv[0], EVENT_START) == 0))
        my_load_config();

    return MOD_CONT;
}
int AnopeInit(int argc, char **argv)
{
    Command *c;
    EvtHook *hook;

    c = createCommand("request", hs_do_request, nick_identified, -1, -1,
                      -1, -1, -1);
    moduleAddHelp(c, hs_help_request);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("activate", hs_do_activate, is_host_setter, -1, -1,
                      -1, -1, -1);
    moduleAddHelp(c, hs_help_activate);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("reject", hs_do_reject, is_host_setter, -1, -1, -1,
                      -1, -1);
    moduleAddHelp(c, hs_help_reject);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("waiting", hs_do_waiting, is_host_setter, -1, -1, -1,
                      -1, -1);
    moduleAddHelp(c, hs_help_waiting);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("list", hs_do_list_out, is_services_oper, -1, -1, -1,
                      -1, -1);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    hook = createEventHook(EVENT_NICK_DROPPED, hsreqevt_nick_dropped);
    moduleAddEventHook(hook);

    hook = createEventHook(EVENT_NICK_EXPIRE, hsreqevt_nick_dropped);
    moduleAddEventHook(hook);

    hook = createEventHook(EVENT_DB_SAVING, hsreqevt_db_saving);
    moduleAddEventHook(hook);

    hook = createEventHook(EVENT_DB_BACKUP, hsreqevt_db_backup);
    moduleAddEventHook(hook);

    moduleSetHostHelp(hs_help);
    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    moduleSetType(SUPPORTED);

    my_load_config();
    my_add_languages();
    hs_request_head = NULL;

    if (debug)
        alog("[hs_request] Loading database...");
    hsreq_load_db();
    alog("hs_request loaded");
    return MOD_CONT;
}