rs-cache
An immutable, high-level API for the RuneScape cache file system.
This crate provides convenient access to the binary file system of the Oldschool RuneScape and RuneScape 3 caches.
The library's API is mainly focused around reading bytes easily. Therefore, it offers a higher level of abstraction then most other libraries. Most cache API's expose a wide variety of internal types to let the user tinker around with the cache in unusual ways. To avoid undefined behavior, most internal types are kept private. The goal of this crate is to provide a simple interface for basic reading of valuable data.
Note that this crate is still evolving; both OSRS & RS3 are not fully supported/implemented and will probably contain bugs or miss vital features. If this is the case for you then consider opening an issue.
Useful links:
Releases
Documentation
Examples
Safety
This crate internally uses memmap and this is safe because: the RuneScape cache is a read-only binary file system which is never modified by any process, and should never be modified. In order to ensure more safety a file handle is preserved internally. This can help avoid accidentally moving the main file while the cache is in use. It is not possible to prevent parallel access to a certain file and prevent modifications. Therefore file-backed mapped memory is inherently unsafe.
Features
The cache's protocol defaults to OSRS. In order to use the RS3 protocol you can enable the rs3 feature flag.
A lot of types derive serde's Serialize and Deserialize. To enable (de)serialization on
most types use the serde-derive feature flag.
Quick Start
use Cache;
The osrs specifications and rs3 specifications documents contain a detailed description of the design of the corresponding cache for educational purposes. Both documents are still a work in progress and are possibly incomplete.
Integration tests are running on Oldschool RuneScape version 180, which you can run at any time because the cache is included in the ./data/osrs_cache directory. RS3 Integration tests are running on version 904. The RS3 cache is too large to include on GitHub.
This crate is experimentald. I will implement Additional features once I need them for my own project. If you require a certain feature feel free to open an issue.
Usage
Add this to your Cargo.toml:
[]
= "0.7"
Examples can be found in the examples directory.
Acknowledgements
The following sources aided with the development of this crate:
OpenRS
RuneLite
OSRS Cache Parsing Blog
RSMod
Librsfs
OSRSBox
Jagex-Store-5
Matrix 876
License
RS-Cache is distributed under the terms of the MIT license.
See LICENSE for details.