Cache Format

From RuneWiki
Jump to navigationJump to search

Cache Format

General Information

The old engine cache is made up two types of files.

Data file

The data file holds all of the files in the cache and is named main_file_cache.dat. It is therefore very big, typically ~10-20 megabytes.

Index file

There are several index files, named main_file_cache.idx and then postfixed with a number. Each index file holds 'pointers' to where a file is located in the main cache. Each index file represents a type of file.

Format

Index file format

The index file is made up of 6 byte blocks which hold information about where a file can be located in the data file. The format of a single block is as follows:

tribyte fileSize
tribyte initialDataBlockId

Data file format

The data file is made up of 520 byte blocks. The format of each of these blocks is as follows:

short nextFileId
short currentFilePartId
tribyte nextDataBlockId
byte nextFileTypeId
byte[512] blockData

Jewish