Ejemplo n.º 1
0
void save_os_rdb_dbase(void)
{
#ifdef USE_RDB
    if (!rdb_open())
        return;

    if (rdb_tag_table("xanadu_os_akills") == 0) {
        alog("Unable to tag table 'xanadu_os_akills' - OperServ RDB save failed.");
        return;
    }
    if (rdb_tag_table("xanadu_os_sglines") == 0) {
        alog("Unable to tag table 'xanadu_os_sglines' - OperServ RDB save failed.");
        return;
    }
    if (rdb_tag_table("xanadu_os_sqlines") == 0) {
        alog("Unable to tag table 'xanadu_os_sqlines' - OperServ RDB save failed.");
        return;
    }
    if (rdb_tag_table("xanadu_os_szlines") == 0) {
        alog("Unable to tag table 'xanadu_os_szlines' - OperServ RDB save failed.");
        return;
    }
    /* We empty xanadu_os_core as required */
    if (rdb_empty_table("xanadu_os_core") == 0) {
        alog("Unable to empty table 'xanadu_os_core' - OperServ RDB save failed");
        return;
    }

    if (rdb_save_os_db
        (maxusercnt, maxusertime, &akills, &sglines, &sqlines,
         &szlines) == 0) {
        alog("Unable to save OperServ data - OperServ RDB save failed");
        return;
    }

    if (rdb_clean_table("xanadu_os_akills") == 0) {
        alog("Unable to clean table 'xanadu_os_akills' - OperServ RDB save failed.");
        return;
    }
    if (rdb_clean_table("xanadu_os_sglines") == 0) {
        alog("Unable to clean table 'xanadu_os_sglines' - OperServ RDB save failed.");
        return;
    }
    if (rdb_clean_table("xanadu_os_sqlines") == 0) {
        alog("Unable to clean table 'xanadu_os_sqlines' - OperServ RDB save failed.");
        return;
    }
    if (rdb_clean_table("xanadu_os_szlines") == 0) {
        alog("Unable to clean table 'xanadu_os_szlines' - OperServ RDB save failed.");
        return;
    }

    rdb_close();
#endif
}
Ejemplo n.º 2
0
void save_rdb_exceptions()
{
#ifdef USE_RDB
    int i;
    Exception *e;

    if (!rdb_open())
        return;
    if (rdb_tag_table("anope_os_exceptions") == 0) {
        alog("Unable to tag table 'anope_os_exceptions' - Exception RDB save failed.");
        return;
    }
    for (i = 0; i < nexceptions; i++) {
        e = &exceptions[i];
        if (rdb_save_exceptions(e) == 0) {
            alog("Unable to save Exception '%s' - Exception RDB save failed.", e->mask);
            return;
        }
    }
    if (rdb_clean_table("anope_os_exceptions") == 0) {
        alog("Unable to clean table 'anope_os_exceptions' - Exception RDB save failed.");
        return;
    }
    rdb_close();
#endif
}