Don't know what to do. Tried everything. For some reason KvGotoFirstSubKey always returns "false".
PHP Code:
RemoveOldCache()
{
new currTime = GetTime();
new String:szKey[PLATFORM_MAX_PATH];
KvRewind(g_hKvCache);
if (!KvGotoFirstSubKey(g_hKvCache))
{
PrintToServer("EMPTY WHY??????"); // <- this what it always prints
return;
}
do
{
KvGetSectionName(g_hKvCache, szKey, sizeof(szKey));
PrintToServer("Section Name: %s", szKey);
if ( (currTime - KvGetNum(g_hKvCache, szKey)) > 10)
{
KvDeleteThis(g_hKvCache);
}
} while (KvGotoNextKey(g_hKvCache));
}
Dumped kv structure:
Code:
"WhitelistCache"
{
"materials\sprites\white.vmt" "1268575491"
"materials\vgui\white.vmt" "1268575491"
"materials\effects\flashbang.vmt" "1268575491"
"materials\effects\flashbang_white.vmt" "1268575491"
"materials\particle\particle_smokegrenade1.vmt" "1268575491"
"materials\sprites\scope_arc.vmt" "1268575491"
"models\weapons\w_c4_planted.mdl" "1268575491"
"models\player\ct_urban.mdl" "1268575491"
"models\player\ct_gsg9.mdl" "1268575491"
"models\player\ct_sas.mdl" "1268575491"
"models\player\ct_gign.mdl" "1268575491"
"models\player\t_phoenix.mdl" "1268575491"
"models\player\t_leet.mdl" "1268575491"
"models\player\t_arctic.mdl" "1268575491"
"models\player\t_guerilla.mdl" "1268575491"
"materials\models\player\ct_urban\ct_urban.vmt" "1268575491"
"materials\models\player\ct_urban\ct_urban_glass.vmt" "1268575491"
"materials\models\player\ct_sas\ct_sas.vmt" "1268575491"
"materials\models\player\ct_sas\ct_sas_glass.vmt" "1268575491"
"materials\models\player\ct_gsg9\ct_gsg9.vmt" "1268575491"
"materials\models\player\ct_gign\ct_gign.vmt" "1268575491"
"materials\models\player\ct_gign\ct_gign_glass.vmt" "1268575491"
"materials\models\player\t_phoenix\t_phoenix.vmt" "1268575491"
"materials\models\player\t_guerilla\t_guerilla.vmt" "1268575491"
"materials\models\player\t_leet\t_leet.vmt" "1268575491"
"materials\models\player\t_leet\t_leet_glass.vmt" "1268575491"
"materials\models\player\t_arctic\t_arctic.vmt" "1268575491"
"materials\sprites\dominations\nemesis_red.vmt" "1268575491"
"materials\sprites\dominations\nemesis_red.vtf" "1268575491"
"materials\sprites\dominations\nemesis_blue.vmt" "1268575491"
"materials\sprites\dominations\nemesis_blue.vtf" "1268575491"
"materials\sprites\dominations\nemesis_burst.vmt" "1268575491"
"materials\sprites\dominations\nemesis_burst.vtf" "1268575491"
"sound\dominations\domination.mp3" "1268575491"
"sound\dominations\nemesis.mp3" "1268575491"
"sound\homer\woohoo.wav" "1268575491"
"sound\homer\doh.wav" "1268575491"
}
__________________