[][src]Crate ck3save

CK3 Save

CK3 Save is a library to ergonomically work with Crusader Kings 3 (CK3) saves (ironman + regular).

use ck3save::{Ck3Extractor, Encoding};
use std::io::Cursor;

let data = std::fs::read("assets/saves/Jarl_Ivar_of_the_Isles_867_01_01.ck3")?;
let reader = Cursor::new(&data[..]);
let (save, encoding) = Ck3Extractor::extract_save(reader)?;
assert_eq!(encoding, Encoding::TextZip);
assert_eq!(save.meta_data.version, String::from("1.0.2"));

Ck3Extractor will deserialize both plaintext (used for mods, multiplayer, non-ironman saves) and binary (ironman) encoded saves into the same structure.

Ironman

By default, ironman saves will not be decoded properly.

To enable support, one must supply an environment variable (CK3_IRONMAN_TOKENS) that points to a newline delimited text file of token descriptions. For instance:

This example is not tested
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

Ck3Date

Struct specialized to parsing, formatting, and manipulating dates in CK3

Ck3Error

An Ck3 Error

Ck3Extractor

Logic container for extracting data from an CK3 save

Ck3ExtractorBuilder

Customize how a save is extracted

Melter

Convert a binary gamestate to plaintext

Enums

Ck3ErrorKind

Specific type of error

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