Crates.io | lolrofl |
lib.rs | lolrofl |
version | 0.2.0 |
source | src |
created_at | 2022-06-23 13:37:46.207314 |
updated_at | 2022-06-26 10:26:16.716143 |
description | Library and tool to parse and inspect ROFL replay files generated from League of Legends games. |
homepage | |
repository | https://github.com/Ayowel/lolrofl-rs |
max_upload_size | |
id | 611884 |
size | 77,630 |
Rust library and tool to parse and inspect ROFL replay files generated from League of Legends games.
The end goal is to provide the ability to extract all data contained in a replay file in a meaningfull way based on the definitions available at https://github.com/loldevs/leaguespec/wiki after updating them to match current-day replay formats.
Backward-compatibility for replay files is NOT to be expected as of now.
:warning: This project uses semantic-versioning with v0 exception. As such, the API may be changed with every minor update while the major version is 0. Only patch versions should be presumed as forward-compatible.
Add lolrofl
to your project's cargo.toml
.
[dependencies.lolrofl]
version = "^0.1.0"
Use lolrofl
to parse a loaded file's content :
// Load a file in memory
let content = std::fs::read(source_file).unwrap();
// Build a selector for data loading
let data_selector = lolrofl::consts::LOAD_HEAD | lolrofl::consts::LOAD_METADATA;
// Load the data with the Rofl object
let data = lolrofl::Rofl::from_slice(&content[..], data_selector).unwrap();
// Print the file's signature
println!("{:?}", data.head().signature());
// Print the file's metadata
println!("{:?}", data.meta().unwrap());