Exemple #1
0
bool BanIPMgr_Impl::ReadBans( )
{
	CButeMgr banBute;
	banBute.Parse( "BanList.txt" );

	char szBanKey[128] = "";
	char szClientIP[16] = "";
	int nBanIndex = 0;

	// Read in the current set of bans.
	while( 1 )
	{
		// Read the next banned IP.
		sprintf( szBanKey, "Ban%d", nBanIndex );
		banBute.GetString( "Bans", szBanKey, "", szClientIP, ARRAY_LEN( szClientIP ));

		// If we didn't find one, the stop looking.
		if( !banBute.Success( ))
			break;

		// Add the ban.
		AddBan( szClientIP );
		nBanIndex++;
	}	

	return true;
}
Exemple #2
0
LTBOOL SOUNDFILTER::Init(CButeMgr & buteMgr, char* aTagName)
{
    if (!aTagName) return LTFALSE;

	buteMgr.GetString(aTagName, SFM_NAME, szName, ARRAY_LEN(szName));
	buteMgr.GetString(aTagName, SFM_FILTERNAME, szFilterName, ARRAY_LEN(szFilterName));

    int i;
    for (i=0; i < SFM_MAX_VARIABLES; i++)
	{
		sprintf(s_aAttName, "%s%d", SFM_VARIABLE, i);
		buteMgr.GetString(aTagName, s_aAttName, "", szVars[i], ARRAY_LEN(szVars[i]));
		if (buteMgr.Success( ))
		{
			nNumVars++;
		}
	}

	int nNumValues = 0;
	for (i=0; i < SFM_MAX_VARIABLES; i++)
	{
		sprintf(s_aAttName, "%s%d", SFM_VALUE, i);
		fValues[i] = (LTFLOAT) buteMgr.GetDouble(aTagName, s_aAttName, 0.0 );
		if (buteMgr.Success( ))
		{
			nNumValues++;
		}
	}

	if (nNumVars != nNumValues)
	{
		_ASSERT(LTFALSE);
		return LTFALSE;
	}

    return LTTRUE;
}