Beispiel #1
0
void SV_InitBanlist(){

    Com_Memset(svse.ipBans,0,sizeof(svse.ipBans));
    banlist = Cvar_RegisterString("banlistfile", "banlist.dat", CVAR_INIT, "Name of the file which holds the banlist");
    current_banlist_size = BANLIST_DEFAULT_SIZE;
    current_banindex = 0;
    svse.banList = realloc(NULL, current_banlist_size);//Test for NULL ?
    if(svse.banList){
        SV_LoadBanlist();
    }else{
        Com_PrintError("Failed to allocate memory for the banlist. Banlist is disabled\n");
    }
}
void SV_InitBanlist(){

    Com_Memset(ipBans,0,sizeof(ipBans));
    banlistfile = Cvar_RegisterString("banlist_filename", "banlist.dat", CVAR_INIT, "Name of the file which holds the banlist");
    ipbantime = Cvar_RegisterInt("banlist_maxipbantime", MAX_DEFAULT_IPBAN_MINUTES, 0, 20160, 0, "Limit of minutes to keep a ban against an ip-address up");
    current_banlist_size = BANLIST_DEFAULT_SIZE;
    current_banindex = 0;
    banlist = realloc(NULL, current_banlist_size);//Test for NULL ?
    if(banlist){
        SV_LoadBanlist();
    }else{
        Com_PrintError("Failed to allocate memory for the banlist. Banlist is disabled\n");
    }
}
Beispiel #3
0
int SV_InitBanlist(){

    banlistfile = Plugin_Cvar_RegisterString("banlist_filename", "banlist_v2.dat", CVAR_INIT, "Name of the file which holds the banlist");
    current_banlist_size = BANLIST_DEFAULT_SIZE;
    current_banindex = 0;
    banlist = realloc(NULL, current_banlist_size);//Test for NULL ?
    if(banlist){
        SV_LoadBanlist();
    }else{
        Plugin_PrintError("Failed to allocate memory for the banlist. Banlist is disabled\n");
        return -1;
    }
    Plugin_AddCommand("dumpbanlist", SV_DumpBanlist_f, 30);
    return 0;
}
qboolean  SV_ReloadBanlist(){

    banList_t *this;

    this = banlist;
    if(!this)
        return qfalse;

    Com_Memset(this, 0, current_banlist_size);
    current_banindex = 0; //Reset the index!

    SV_LoadBanlist();

    this = banlist;
    if(!this)
        return qfalse;

    else
        return qtrue;
}