rs2-cache

Crates.iors2-cache
lib.rsrs2-cache
version0.3.0
sourcesrc
created_at2023-03-20 14:38:48.58156
updated_at2023-04-10 15:50:23.82617
descriptionA cache library for RS2, based on OpenRS2.
homepage
repositoryhttps://github.com/osrs-rs/rs2-cache
max_upload_size
id815328
size2,741,669
Jakob (Jakobzs)

documentation

https://docs.rs/rs2-cache

README

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.
Commit count: 68

cargo fmt