Crate imperator_save[][src]

Expand description

Imperator Save

Imperator Save is a library to ergonomically work with Imperator Rome saves (debug + standard).

use imperator_save::{ImperatorExtractor, Encoding};
use std::io::Cursor;

let data = std::fs::read("assets/saves/observer1.5.rome")?;
let reader = Cursor::new(&data[..]);
let (save, encoding) = ImperatorExtractor::extract_save(reader)?;
assert_eq!(encoding, Encoding::Standard);
assert_eq!(save.header.version, String::from("1.5.3"));

ImperatorExtractor will deserialize standard Imperator saves as well as those saved saved with -debug_mode (plaintext).

Ironman

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:

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.

Modules

models

Structs

ImperatorError

An Imperator Error

ImperatorExtractor

Logic container for extracting data from an Imperator save

ImperatorExtractorBuilder

Customize how a save is extracted

Melter

Convert a binary gamestate to plaintext

Enums

Encoding

Describes the format of the save before decoding

Extraction

The memory allocation strategy for handling zip files

FailedResolveStrategy

Customize how the deserializer reacts when a token can’t be resolved

ImperatorErrorKind

Specific type of error

Type Definitions

ImperatorDate