Difference between revisions of "NVault"
(Created nVault page, detailed file format.) |
m (→Entries: Fixed typo) |
||
(One intermediate revision by the same user not shown) | |||
Line 22: | Line 22: | ||
The two-byte, int16 value length indicates how many bytes the value length is. | The two-byte, int16 value length indicates how many bytes the value length is. | ||
− | When reading each entry, read in the timestamp, the key length and the value length, as they are of known length. Then, read in the key as per the length specified in the key length, and the value | + | When reading each entry, read in the timestamp, the key length and the value length, as they are of known length. Then, read in the key as per the length specified in the key length, and the value as per the length specified in the value length. |
+ | |||
+ | =Editing nVault Files= | ||
+ | Should you need to make manual edits to an nVault file, there are a few tools available for doing so. | ||
+ | |||
+ | {| class="wikitable" style="width: 50%; text-align: left;" | ||
+ | |- | ||
+ | ! Name | ||
+ | ! Maintainer | ||
+ | ! Release Date | ||
+ | |- | ||
+ | | nVault Reader [http://forums.alliedmods.net/showthread.php?t=49676] | ||
+ | | [http://forums.alliedmods.net/member.php?u=9691 P34nut] | ||
+ | | January 10th, 2007 | ||
+ | |- | ||
+ | | nVault Editor [http://forums.alliedmods.net/showthread.php?t=66657] | ||
+ | | [http://forums.alliedmods.net/member.php?u=4234 Bugsy] | ||
+ | | February 5th, 2008 | ||
+ | |} |
Latest revision as of 21:35, 21 August 2010
nVault is the standard flatfile database format for AMXX, used to store all sorts of data. nVault functions essentially as a key->value store, with an additional timestamp for each entry.
nVault Format Specification
nVault is a non-delimited binary key->value store which is dependent upon the endianness of the system by which it is generated.
File Header
Beginning each nVault file is a 4-byte, int32 "magic value" which indicates the endianness of the file. This "magic value" represents the string "nVLT" in ASCII, or 0x6E564C54 in hex, when unpacked using the proper endian.
Following is a two-byte, int16 format version specification. The version specification as of the writing of this article decodes as the integer 2, or 0x0200 in hex, when unpacked using the proper endian.
Next is a four-byte, int32 entries enumeration, indicating how many entries the file contains.
Entries
Each entry in the file takes the format: <int32 timestamp><int8 key length><int16 value length><key><value>
The file should be read in using an iteration statement, up to the number of entries specified in the entries enumeration in the header.
The four-byte, int32 timestamp indicates when the entry was written to the file. The one-byte, int8 key length indicates how many bytes the key length is. The two-byte, int16 value length indicates how many bytes the value length is.
When reading each entry, read in the timestamp, the key length and the value length, as they are of known length. Then, read in the key as per the length specified in the key length, and the value as per the length specified in the value length.
Editing nVault Files
Should you need to make manual edits to an nVault file, there are a few tools available for doing so.
Name | Maintainer | Release Date |
---|---|---|
nVault Reader [1] | P34nut | January 10th, 2007 |
nVault Editor [2] | Bugsy | February 5th, 2008 |