#runescape #osrs #rs2

rs2-cache

A cache library for RS2, based on OpenRS2

4 releases (breaking)

0.3.0 Apr 10, 2023
0.2.0 Apr 10, 2023
0.1.0 Apr 2, 2023
0.0.0 Mar 20, 2023

#963 in Filesystem

42 downloads per month

MIT license

78KB
2K SLoC

Contains (Zip file, 2KB) cache.zip, (Zip file, 2KB) cache.zip

rs2-cache

Build API Crate Discord

A RS2 cache library written in Rust, based on the OpenRS2 implementation.

It should be noted: RS2 also includes Old School Runescape.

Installation

Add the following to your Cargo.toml file:

[dependencies]
rs2-cache = "0.3.0"

Example

use rs2cache::Cache;

fn main() -> Result<(), rs2cache::cache::CacheError> {
    let cache = Cache::open("./cache")?;

    let index_id = 2; // Config index
    let archive_id = 10; // Item definitions archive
    let file_id = 1042; // Blue Partyhat file

    let buffer = cache.read(index_id, archive_id, file_id)?;

    Ok(())
}

Contributing

If you have new features you would like to have implemented, feel free to open a pull request. Do be advised that this repository aims to follow OpenRS2, so any edits should not deviate too far from it (if at all). For bigger features it is advised to open an issue in order to discuss it beforehand.

Credits

  • Graham: For his work on OpenRS2. If you are using Kotlin and working on a RS2 rev server, it is highly recommended to utilise it for any cache related tasks.
  • JayArrowz: Created the implementation that allows C# to use rs2-cache.

Dependencies

~2.8–4MB
~68K SLoC