vault.ini gets too big
Moderator: Forum Moderator
vault.ini gets too big
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.
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.
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.
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.
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
This is from 2.3.2 pre configured cs/cz:
Is suppose it should be something like that:
Otherwise, nothing will be removed, like now.
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]);
}
}
Code: Select all
...
server_print( "[VAULT] Checking %d < %d", iUserTimestamp, iExpiredTime );
if ( iUserTimestamp < iExpiredTime )
{
server_print( "[VAULT] Expired removing %s", szID );
vault_remove(id);
}
...
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
- YamiKaitou
- Forum Moderator
- Posts: 1925
- Joined: Wed Feb 01, 2006 4:33 pm
- Contact:
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]
[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]
No support via PM or Email
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
- Krazy
- Forum Administrator
- Posts: 282
- Joined: Wed Jul 06, 2005 9:40 am
- Location: Dayton, Ohio
- Contact:
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.
Website: www.djpsych.com
Need help anything to do with Warcraft 3 Mod, installing other plugins, setting up mySQL, installing PsychoStats, or anything else just PM/email me!
Need help anything to do with Warcraft 3 Mod, installing other plugins, setting up mySQL, installing PsychoStats, or anything else just PM/email me!
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
-
- Peon
- Posts: 11
- Joined: Fri Feb 10, 2006 7:45 am
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
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
No Support via PM
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
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
- nightscream
- Sorceress
- Posts: 319
- Joined: Wed Jul 06, 2005 12:54 pm
- Location: Belguim, Hallaar
- Contact: