#replay #league #legends #data #rofl

rofl-parser

Parse useable data from *.rofl file

9 releases

0.1.26 Apr 18, 2023
0.1.25 Feb 16, 2023

#3 in #legends

Apache-2.0

20KB
490 lines

rofl-parser

Parse useable data from *.rofl file. (League of Legends replay file)

Usage

1. Parse from file

fn parse_rofl() -> Result<(), Box<dyn Error>> {
    let mut rofl = Rofl::new();
    let _ = rofl.parse_rofl_file("*.rofl")?; // rofl file download needed

    let rofl_json = rofl.get_rofl_json(); // get full rofl info

    assert!(rofl_json.is_some());

    Ok(())
}

2. Parse from data

If we have [u8] data, parse from data

fn parse_rofl(data: &[u8]) -> Result<(), Box<dyn Error>> {
    let mut rofl = Rofl::new();
    let _ = rofl.parse_rofl_data(data)?;

    let rofl_json = rofl.get_rofl_json();

    assert!(rofl_json.is_some());

    Ok(())
}

Dependencies

~0.8–1.7MB
~37K SLoC