Raised This Month: $161 Target: $400
 40% 

FVault - A new vault system!


Post New Thread Reply   
 
Thread Tools Display Modes
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-12-2009 , 14:02   Re: FVault - A new vault system!
Reply With Quote #21

Quote:
Originally Posted by Exolent[jNr] View Post
Thanks. It has been fixed.
Thank you for this vault system
__________________
I am out of order!
grimvh2 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-15-2009 , 15:45   Re: FVault - A new vault system!
Reply With Quote #22

sorry, double post.

Question :

PHP Code:
// Save Data's
new String[85];
formatex(String84"%s %s",data1,data2)

fvault_set_data(g_vault_nameauthidString);

// Load Data's
new authid[35];
get_user_authid(plrauthidsizeof(authid) - 1);

new 
data[85];
if( 
fvault_get_data(g_vault_nameauthiddatasizeof(data) - 1) )
{
    
/* How I can get back those 2 strings seperated? */


__________________
I am out of order!
grimvh2 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-15-2009 , 16:51   Re: FVault - A new vault system!
Reply With Quote #23

parse( ) or strbreak( )
By the way, that has nothing to do with FVault.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-15-2009 , 17:07   Re: FVault - A new vault system!
Reply With Quote #24

Quote:
Originally Posted by Exolent[jNr] View Post
parse( ) or strbreak( )
By the way, that has nothing to do with FVault.
True, thanks.
__________________
I am out of order!
grimvh2 is offline
Old 11-03-2009, 01:53
Mlk27
This message has been deleted by Mlk27. Reason: nvm. i figured it out
Mlk27
Veteran Member
Join Date: May 2008
Old 11-03-2009 , 13:19   Re: FVault - A new vault system!
Reply With Quote #25

A minor error in the include file

Code:
include\fvault.inc(379) : warning 203: symbol is never used: "len"
Mlk27 is offline
eXacT
Veteran Member
Join Date: Apr 2009
Location: Buenos Aires
Old 01-17-2010 , 03:14   Re: FVault - A new vault system!
Reply With Quote #26

Quote:
Originally Posted by Mlk27 View Post
A minor error in the include file

Code:
include\fvault.inc(379) : warning 203: symbol is never used: "len"
exolet, you must update ths, is a bit xD
__________________

"There is no knowledge, that is not power"
eXacT is offline
Send a message via MSN to eXacT Send a message via Skype™ to eXacT
matsi
Thinkosaur
Join Date: Sep 2006
Old 01-18-2010 , 11:06   Re: FVault - A new vault system!
Reply With Quote #27

Code:
stock fvault_prune(const vaultname[], const start=-1, const end=-1) {     if( start == -1 && end == -1 )     {         new keys = fvault_size(vaultname);         if( keys )         {             fvault_clear(vaultname);         }                 return keys;     }         new filename[128];     _FormatVaultName(vaultname, filename, sizeof(filename) - 1);         if( !file_exists(filename) )     {         return 0;     }         new file = fopen(_temp_vault, "wt");     new vault = fopen(filename, "rt");         new keys;    
    //new data[512], len, i, _time[32], timestamp;
    //to( len was never used in the code ) ->
        new data[512], i, _time[32], timestamp;     while( !feof(vault) )     {         fgets(vault, data, sizeof(data) - 1);                 if( data[0] )         {             _time[0] = 0;                         for( i = strlen(data) - 1; i >= 0; i-- )             {                 if( data[i] == '"' ) break;                                 if( data[i] == ' ' )                 {                     copy(_time, sizeof(_time) - 1, data[i + 1]);                     break;                 }             }                         timestamp = str_to_num(_time);             if( timestamp != -1 )             {                 if( start == -1 && timestamp <= end                 || end == -1 && timestamp >= start                 || start <= timestamp <= end )                 {                     keys++;                     continue;                 }             }         }                 fputs(file, data);     }         fclose(file);     fclose(vault);         if( keys )     {         delete_file(filename);                 while( !rename_file(_temp_vault, filename, 1) ) { }     }     else     {         delete_file(_temp_vault);     }         return keys; }

matsi is offline
YKH =]
Senior Member
Join Date: Sep 2008
Location: Hong Kong
Old 01-22-2010 , 09:09   Re: FVault - A new vault system!
Reply With Quote #28

when the server crash , we may lose some data..... How can we fix his problem?
__________________
Approved Plugins

[ZP] Effect Plugins :
Damage Effect
Real Death
YKH =] is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 01-22-2010 , 09:32   Re: FVault - A new vault system!
Reply With Quote #29

Quote:
Originally Posted by YKH =] View Post
when the server crash , we may lose some data..... How can we fix his problem?
Just write that data in the file every time its used. What kind of data are you saving btw.. ?
matsi is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-25-2010 , 14:48   Re: FVault - A new vault system!
Reply With Quote #30

Here is a note about some of the functions/examples:

Looping through the vault for each key is VERY BAD!

Here is a better substitution:
Code:
stock fvault_load( const szVaultName[ ], Array:aKeys=Invalid_Array, Array:aData=Invalid_Array, Array:aTimeStamps=Invalid_Array ) {     new szFilename[ 128 ];     _FormatVaultName( szVaultName, szFilename, 127 );         new iFile = fopen( szFilename, "rt" );     if( !iFile ) {         return 0;     }         new iTotal;         new szFileData[ 1024 ];     new szKey[ 64 ], szData[ 512 ], szTimeStamp[ 32 ];     while( !feof( iFile ) ) {         fgets( iFile, szFileData, 1023 );         if( parse( szFileData, szKey, 63, szData, 511, szTimeStamp, 31 ) < 2 ) {             continue;         }                 if( aKeys != Invalid_Array ) {             ArrayPushString( aKeys, szKey );         }         if( aData != Invalid_Array ) {             ArrayPushString( aData, szData );         }         if( aTimeStamps != Invalid_Array ) {             ArrayPushCell( aTimeStamps, str_to_num( szTimeStamp ) );         }                 iTotal++;     }         fclose( iFile );         return iTotal; }
Code:
new Array:aKeys = ArrayCreate( 64 ); // MUST BE 64 OR GREATER new Array:aData = ArrayCreate( 512 ); // MUST BE 512 OR GREATER new iTotal = fvault_load( "myvault", aKeys, aData ); new szKey[ 64 ], szData[ 512 ]; for( new i = 0; i < iTotal; i++ ) {     ArrayGetString( aKeys, i, szKey, 63 );     ArrayGetString( aData, i, szData, 511 );         // szData for szKey }
To add timestamps:
Code:
new Array:aKeys = ArrayCreate( 64 ); // MUST BE 64 OR GREATER new Array:aData = ArrayCreate( 512 ); // MUST BE 512 OR GREATER new Array:aTimeStamps = ArrayCreate( 1 ); // MUST BE 1 new iTotal = fvault_load( "myvault", aKeys, aData, aTimeStamps ); new szKey[ 64 ], szData[ 512 ], iTimeStamp; for( new i = 0; i < iTotal; i++ ) {     ArrayGetString( aKeys, i, szKey, 63 );     ArrayGetString( aData, i, szData, 511 );     iTimeStamp = ArrayGetCell( aTimeStamps, i );         // szData for szKey last updated at iTimeStamp }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:09.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode