Imperator Save is a library to ergonomically work with Imperator Rome saves (debug + standard).
```rust use imperator_save::{ImperatorFile, Encoding, EnvTokens, models::Save};
let data = std::fs::read("assets/saves/observer1.5.rome")?; let file = ImperatorFile::fromslice(&data[..])?; asserteq!(file.encoding(), Encoding::BinaryZip);
let mut zipsink = Vec::new(); let parsedfile = file.parse(&mut zipsink)?; let save = Save::fromdeserializer(&parsedfile.deserializer(), &EnvTokens)?; asserteq!(save.meta.version, String::from("1.5.3")); assert_eq!(save.meta.version, String::from("1.5.3")); ```
By default, standard saves will not be decoded properly.
To enable support, one must supply an environment variable
(IMPERATOR_TOKENS
) that points to a newline delimited
text file of token descriptions. For instance:
ignore
0xffff my_test_token
0xeeee my_test_token2
In order to comply with legal restrictions, I cannot share the list of tokens. I am also restricted from divulging how the list of tokens can be derived.