vault.ini gets too big

Read log files for errors! If this fails, come here for help

Moderator: Forum Moderator

Locked
User avatar
mannisch
Peon
Posts: 24
Joined: Sat Jun 03, 2006 4:05 am
Location: Germany
Contact:

vault.ini gets too big

Post by mannisch » Sat Jun 03, 2006 4:10 am

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. :roll:

Is there any way to clean the vault.ini from outdatet clients ?

Thx. in advance.

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Sat Jun 03, 2006 11:52 am

turn on pruning... or wait for the next release (it uses nvault)
No Support via PM

User avatar
mannisch
Peon
Posts: 24
Joined: Sat Jun 03, 2006 4:05 am
Location: Germany
Contact:

Post by mannisch » Sat Jun 03, 2006 7:44 pm

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.

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Sat Jun 03, 2006 11:04 pm

with 2.3.2 vault pruning is possible...
No Support via PM

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Mon Jun 05, 2006 7:07 am

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.

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Jun 05, 2006 7:20 am

do me a favor.... don't tell me how MY code is...

try checking version 2.3.2
No Support via PM

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Mon Jun 05, 2006 7:27 am

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.

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Jun 05, 2006 11:01 am

do you notice the: vault_remove(id);
No Support via PM

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Mon Jun 05, 2006 11:47 am

This is my code, and it is wrong! Please correct your code.

User avatar
YamiKaitou
Forum Moderator
Forum Moderator
Posts: 1925
Joined: Wed Feb 01, 2006 4:33 pm
Contact:

Post by YamiKaitou » Mon Jun 05, 2006 12:50 pm

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]
Image

No support via PM or Email

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Jun 05, 2006 12:55 pm

interesting... well nonetheless, ignore it...

The next release will use nvault, not vault... so it's irrelevant :/
No Support via PM

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Mon Jun 05, 2006 4:06 pm

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.

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Jun 05, 2006 7:36 pm

Yea this has always been an issue, thats why nvault will be used on the next release
No Support via PM

User avatar
mannisch
Peon
Posts: 24
Joined: Sat Jun 03, 2006 4:05 am
Location: Germany
Contact:

Post by mannisch » Fri Jun 09, 2006 4:33 pm

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.

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Sun Jul 02, 2006 9:41 am

remove_vaultdata(szID);

right after:
server_print( "[VAULT] Expired removing %s", szID );

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Sun Jul 02, 2006 10:52 am

But forget it, this version is completly broken: say commands don't work, nightelf has 1000 HP.

User avatar
Krazy
Forum Administrator
Posts: 282
Joined: Wed Jul 06, 2005 9:40 am
Location: Dayton, Ohio
Contact:

Post by Krazy » Sun Jul 02, 2006 4:33 pm

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
Image

Need help anything to do with Warcraft 3 Mod, installing other plugins, setting up mySQL, installing PsychoStats, or anything else just PM/email me!

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Mon Jul 03, 2006 9:58 am

vault prune cannot work, there was code missing.

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Jul 03, 2006 12:05 pm

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
No Support via PM

Fruchtzwerg
Peon
Posts: 11
Joined: Fri Feb 10, 2006 7:45 am

Post by Fruchtzwerg » Mon Jul 03, 2006 12:20 pm

You can enter commands in the console and in the chat, the chat commands don't work.

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Jul 03, 2006 3:18 pm

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
No Support via PM

User avatar
mannisch
Peon
Posts: 24
Joined: Sat Jun 03, 2006 4:05 am
Location: Germany
Contact:

Post by mannisch » Thu Jul 06, 2006 5:17 am

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

User avatar
nightscream
Sorceress
Posts: 319
Joined: Wed Jul 06, 2005 12:54 pm
Location: Belguim, Hallaar
Contact:

Post by nightscream » Mon Jul 10, 2006 5:49 am

now I see people are really lazy :D
they always blame someone else.
But if they just do a little more they can fix it by themself
want help pm me
Image

Locked