Raised This Month: $51 Target: $400
 12% 

nvault to fvault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gasa
Senior Member
Join Date: Sep 2013
Old 06-11-2014 , 06:12   nvault to fvault
Reply With Quote #1

Hi guys, is it possible to convert nvault file to fvault(txt) file, because u have some levels from users in that file! And reason is fvault making txt file easy to edit! Thanks in advance
Gasa is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-11-2014 , 11:16   Re: nvault to fvault
Reply With Quote #2

Nop.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
!Morte
Veteran Member
Join Date: May 2010
Old 06-11-2014 , 11:22   Re: nvault to fvault
Reply With Quote #3

Well, you can use the nVault editor who bugsy upload to edit the .vault file and you will not have to use fvault
https://forums.alliedmods.net/showth...81917?p=581917
__________________
First Zombie Class
[ZP] Zombie Class: Houndeye Zombie
Quote:
Originally Posted by lucas_7_94 View Post
tenes que saber pawn antes de intentar hacer algo digno.
!Morte is offline
Send a message via MSN to !Morte Send a message via Skype™ to !Morte
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-11-2014 , 16:22   Re: nvault to fvault
Reply With Quote #4

Of course you can.

I don't know the official format of the file, but you can definitely find it out by looking at the source of the module.

I just took the file in Bugsy's post and read it in a hex edit plugin for NP++. Here's what I got from that...

Some starting values:
54 4c 56 6e 00 02 (Empty file)
54 4c 56 6e 00 02 05 00 00 00 (Bugsy's file with 5 entries)
Don't know the meaning of the first six bytes. Some sort of header or perhaps version code. The 7th byte is obviously the number of entries. Most likely it's a long value, so the last 4 of those bytes.

51 bf a8 47 07 1d 00
This is the index for the first entry.
Starts of with a long containing the timestamp in UNIX time format.
Then it is most likely a byte that tells you the length of the key string.
After that either a byte or a short telling you the length of the value. To find out which just try storing a string longer than 255 characters. I'm putting my money on short.
This translates into:
47a8bf51: 1*202*241*361 (2008-02-05, 20:56:01 in european format)
07: 7
1d (or 001d): 29

Then the data...
45 6e 74 72 79 20 31 54 68 69 73 20 69 73 20 74 68 65 20 76 61 6c 75 65 20 66 6f 72 20 65 6e 74 72 79 20 31
This translates into:
"Entry1This is the value for entry 1"
"Entry1" contains 7 characters.
"This is the value for entry 1" contains 29 characters.
By using the values from the index you know exactly where to split this string and where to end it.

Then the pattern starts over with a new index.
53 bf a8 47 07 1d 00
and so on...

So basically, you can read it like any file. Interpret these values using some basic code and just save them in the new fvault. 100% doable directly in PAWN if not familiar with other programming languages. And it's not even that hard.

If someone doesn't beat me to it, I'll definitely write a code for you this weekend. (Perhaps it has already been made?)
__________________

Last edited by Black Rose; 06-11-2014 at 17:26.
Black Rose is offline
Gasa
Senior Member
Join Date: Sep 2013
Old 06-11-2014 , 17:54   Re: nvault to fvault
Reply With Quote #5

Quote:
Originally Posted by Black Rose View Post
Of course you can.

I don't know the official format of the file, but you can definitely find it out by looking at the source of the module.

I just took the file in Bugsy's post and read it in a hex edit plugin for NP++. Here's what I got from that...

Some starting values:
54 4c 56 6e 00 02 (Empty file)
54 4c 56 6e 00 02 05 00 00 00 (Bugsy's file with 5 entries)
Don't know the meaning of the first six bytes. Some sort of header or perhaps version code. The 7th byte is obviously the number of entries. Most likely it's a long value, so the last 4 of those bytes.

51 bf a8 47 07 1d 00
This is the index for the first entry.
Starts of with a long containing the timestamp in UNIX time format.
Then it is most likely a byte that tells you the length of the key string.
After that either a byte or a short telling you the length of the value. To find out which just try storing a string longer than 255 characters. I'm putting my money on short.
This translates into:
47a8bf51: 1*202*241*361 (2008-02-05, 20:56:01 in european format)
07: 7
1d (or 001d): 29

Then the data...
45 6e 74 72 79 20 31 54 68 69 73 20 69 73 20 74 68 65 20 76 61 6c 75 65 20 66 6f 72 20 65 6e 74 72 79 20 31
This translates into:
"Entry1This is the value for entry 1"
"Entry1" contains 7 characters.
"This is the value for entry 1" contains 29 characters.
By using the values from the index you know exactly where to split this string and where to end it.

Then the pattern starts over with a new index.
53 bf a8 47 07 1d 00
and so on...

So basically, you can read it like any file. Interpret these values using some basic code and just save them in the new fvault. 100% doable directly in PAWN if not familiar with other programming languages. And it's not even that hard.

If someone doesn't beat me to it, I'll definitely write a code for you this weekend. (Perhaps it has already been made?)
Omg thanks in advance! P.S. I searched all forum and cant find someone maked somthing likethat!
Gasa is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-11-2014 , 20:52   Re: nvault to fvault
Reply With Quote #6

@Black Rose, can't you just use nvault_util and loop through all entries?
SpeeDeeR is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-12-2014 , 00:07   Re: nvault to fvault
Reply With Quote #7

Never used it. Didn't think of it.
Yes you can.
__________________
Black Rose is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-12-2014 , 05:47   Re: nvault to fvault
Reply With Quote #8

Here ya go. It would need some time to convert, so the server will hang for some time depending on your vault size. It's normal.
Code:
#include <amxmodx> #include <nvault_util> #include <fvault> #define PLUGIN "Nvault To Fvault" #define VERSION "1.2" #define AUTHOR "SpeeDeeR@alliedmods" #define NVAULT_PERM_TIMESTAMP    0 #define FVAULT_PERM_TIMESTAMP   -1 new const VaultName[] = "vaultname"; new const FvaultName[] = "vaultname"; public plugin_init() {     new iVault = nvault_util_open(VaultName);         new iData[ 3 ] = { 8 , 18 , 32 };         nvault_util_readall( iVault , "nvault_util_readall_fwd" , iData , sizeof( iData ) );         nvault_util_close( iVault ); } public nvault_util_readall_fwd( iCurrent , iTotal , const szKey[] , const szVal[] , iTimeStamp , const Data[] , iSize ) {     _fvault_set_data(FvaultName, szKey, szVal, iTimeStamp == NVAULT_PERM_TIMESTAMP ? FVAULT_PERM_TIMESTAMP : iTimeStamp); }

Last edited by SpeeDeeR; 06-12-2014 at 16:13. Reason: update
SpeeDeeR is offline
Gasa
Senior Member
Join Date: Sep 2013
Old 06-12-2014 , 06:34   Re: nvault to fvault
Reply With Quote #9

Lol this working perfect thx a lot guys !
Gasa is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-12-2014 , 10:36   Re: nvault to fvault
Reply With Quote #10

Note that this will not transfer the timestamp.
__________________
Black Rose is offline
Reply



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 05:24.


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