Page 1 of 1
vault.ini gets too big
Posted: Sat Jun 03, 2006 4:10 am
by mannisch
Hi all,
first of all, i am running amxx 1.71, metamod-p and WC3FT2.3 and it runs perfekt. It seem to be a little faster instead of the old installation.
My Problem now is, that i cannot use SQL, so i save the XP in the vault.ini.
When this file is getting too big, the server needs on mapchange a lot of time to handle this file, and this causes that all clients runs in timeout.
Is there any way to clean the vault.ini from outdatet clients ?
Thx. in advance.
Posted: Sat Jun 03, 2006 11:52 am
by Geesu
turn on pruning... or wait for the next release (it uses nvault)
Posted: Sat Jun 03, 2006 7:44 pm
by mannisch
So this means that my vault.ini is getting bigger and bigger because too many people visit the server within a 31 days period.....
I thought that the option "pruning" is only avaiable for sql.
So pruning is also good for vault.ini and "daysbeforedelete" is also valid for this.
Nice.
Geesu you are the best.
Regards.
Posted: Sat Jun 03, 2006 11:04 pm
by Geesu
with 2.3.2 vault pruning is possible...
Posted: Mon Jun 05, 2006 7:07 am
by Fruchtzwerg
No, its not possible, check the XP_Prune() function and the vault section, there are only some server_prints, but the pruning command is missing.
Posted: Mon Jun 05, 2006 7:20 am
by Geesu
do me a favor.... don't tell me how MY code is...
try checking version 2.3.2
Posted: Mon Jun 05, 2006 7:27 am
by Fruchtzwerg
This is from 2.3.2 pre configured cs/cz:
Code: Select all
// Prune the database of old records
public XP_Prune()
{
#if ADVANCED_DEBUG
writeDebugInfo("XP_Prune", 0);
#endif
if ( iCvar[FT_AUTO_PRUNING] )
{
// Vault pruning (only works with vaults created with version 2.2.8)
if ( !iCvar[SV_SQL] )
{
new szVault[] = "addons/amxmodx/data/vault.ini";
// Make sure the vault exists
if ( file_exists( szVault ) )
{
new len, line, szText[256];
new iCurrentTime = get_systime();
// 86400 = 24 hours * 60 minutes * 60 seconds
new iExpiredTime = iCurrentTime - (iCvar[SV_DAYSBEFOREDELETE] * 86400);
// Check every line in the vault
while ( (line = read_file(szVault, line, szText, 255, len)) != 0 )
{
// The first 2 lines are not actual data, so lets skip them
if ( line > 2 )
{
new szID[32], szAuthID[32], szXP[8], szRace[2], szSkill1[2], szSkill2[2], szSkill3[2], szSkill4[2], szIP[32], szTimestamp[32];
parse(szText, szID, 31, szAuthID, 31, szXP, 7, szRace, 1, szSkill1, 1, szSkill2, 1, szSkill3, 1, szSkill4, 1, szIP, 31, szTimestamp, 31);
// Verify its the new vault timestamp
if ( strlen(szTimestamp) > 2 )
{
new iUserTimestamp = str_to_num( szTimestamp );
server_print( "[VAULT] Checking %d < %d", iUserTimestamp, iExpiredTime );
if ( iUserTimestamp < iExpiredTime )
{
server_print( "[VAULT] Expired removing %s", szID );
}
}
}
}
}
}
// MySQL/SQLLite pruning
else
{
new query[256];
if ( iSQLtype == SQL_MYSQL )
{
// Timestamp format: 20030912122142
// Y = 2003 M = 09 D = 12 H = 12 M = 21 S = 42
format( query, 255, "DELETE FROM `%s` WHERE DATE_SUB(CURDATE(),INTERVAL %d DAY) > time;", g_DBTableName, iCvar[SV_DAYSBEFOREDELETE] );
}
else if ( iSQLtype == SQL_SQLITE )
{
// Timestamp format: 2003-09-12 12:21:42
// Y = 2003 M = 09 D = 12 H = 12 M = 21 S = 42
format( query, 255, "DELETE FROM `%s` WHERE ((julianday(`time`) + %d) < julianday('now'))", g_DBTableName, iCvar[SV_DAYSBEFOREDELETE] );
}
dbi_query(sql, query);
// Vacuum the SQL LITE DB Table
if (iSQLtype == SQL_SQLITE)
{
format( query, 255, "VACUUM `%s`", g_DBTableName );
dbi_query( sql, query );
}
}
log_amx("Database pruning successful, data older than %d days was removed", iCvar[SV_DAYSBEFOREDELETE]);
}
}
Is suppose it should be something like that:
Code: Select all
...
server_print( "[VAULT] Checking %d < %d", iUserTimestamp, iExpiredTime );
if ( iUserTimestamp < iExpiredTime )
{
server_print( "[VAULT] Expired removing %s", szID );
vault_remove(id);
}
...
Otherwise, nothing will be removed, like now.
Posted: Mon Jun 05, 2006 11:01 am
by Geesu
do you notice the: vault_remove(id);
Posted: Mon Jun 05, 2006 11:47 am
by Fruchtzwerg
This is my code, and it is wrong! Please correct your code.
Posted: Mon Jun 05, 2006 12:50 pm
by YamiKaitou
He is right Gessu. I just downloaded v2.3.2 and checked it myself. This is what is at the server_print
[small]
if ( strlen(szTimestamp) > 2 )
{
new iUserTimestamp = str_to_num( szTimestamp );
server_print( "[VAULT] Checking %d < %d", iUserTimestamp, iExpiredTime );
if ( iUserTimestamp < iExpiredTime )
{
server_print( "[VAULT] Expired removing %s", szID );
}
}[/small]
Posted: Mon Jun 05, 2006 12:55 pm
by Geesu
interesting... well nonetheless, ignore it...
The next release will use nvault, not vault... so it's irrelevant :/
Posted: Mon Jun 05, 2006 4:06 pm
by Fruchtzwerg
If you have a big vault.ini it will increase dramatically the CPU load during mapchange. A mapchange can take up to 5 minutes or more, with the result that players get disconnected.
Posted: Mon Jun 05, 2006 7:36 pm
by Geesu
Yea this has always been an issue, thats why nvault will be used on the next release
Posted: Fri Jun 09, 2006 4:33 pm
by mannisch
pls tell us what command is missing for cleaning the vault.ini, otherwise i will get big problems with our gamers, because i have to delete the vault.ini.
thx.
Posted: Sun Jul 02, 2006 9:41 am
by Fruchtzwerg
remove_vaultdata(szID);
right after:
server_print( "[VAULT] Expired removing %s", szID );
Posted: Sun Jul 02, 2006 10:52 am
by Fruchtzwerg
But forget it, this version is completly broken: say commands don't work, nightelf has 1000 HP.
Posted: Sun Jul 02, 2006 4:33 pm
by Krazy
It works perfectly fine. Say commands work, NE does not do the thing you just said, and vault does prune if you set it to do so. You did something wrong.
Posted: Mon Jul 03, 2006 9:58 am
by Fruchtzwerg
vault prune cannot work, there was code missing.
Posted: Mon Jul 03, 2006 12:05 pm
by Geesu
LOL this version is broken? LOL
NE is supposed to have 1K health when they're about to evade shot...
Say commands? define "say commands", thats pretty vague
Posted: Mon Jul 03, 2006 12:20 pm
by Fruchtzwerg
You can enter commands in the console and in the chat, the chat commands don't work.
Posted: Mon Jul 03, 2006 3:18 pm
by Geesu
OMFG< WHAT COMMANDS...
goddamn, "they don't work"... thats still vague...
Every command? what command?
Clearly it must work since 386 other people aren't having the same problem...
http://www.game-monitor.com/search.php? ... e=variable
Posted: Thu Jul 06, 2006 5:17 am
by mannisch
Fruchtzwerg, i had the same problems...
Something was messed up, i had to reinstall amxx and wc3 then it was OK.
use the same amxx and metamod as i wrote on top, it works fine and fast.
My only problem is the vault.ini ist going to explode....
Does the command remove_vaultdata(szID); really work?
I will try on the coming weekend.
can you send me the recompiled version with this command inside?
[email protected]
Thx in advance.
Visit mannisch.de WC3FT 80.190.72.196:27015
Posted: Mon Jul 10, 2006 5:49 am
by nightscream
now I see people are really lazy
they always blame someone else.
But if they just do a little more they can fix it by themself