Part of #92, for `benilla-ui`, `benilla-world` and `benilla-formats`. - 88 string literals drop private record and bug numbers, the dates of private incidents, and the workspace's name for the maintainer. They are assert and panic texts, log and printout lines, the `--` comments of the Lua prelude and of test fixtures, and one Lua assert. Each keeps its fact in its own words. - Two test names lose their numbers: `burning_steppes_lava_builds_a_magma_surface_at_the_reported_pin` and `join_channel_by_name_answers_the_row_custom_and_nil_legs`. - A test-only event, `B271_PROBE`, is now `ERROR_PROBE` in the two crates that register and fire it. A fixture's error text in `benilla-app`'s `ui_script` tests drops its bug number, together with the assertion that reads it. - Doc comments that named a client function by a disassembler's label (`FUN_0068a830`) now give its address, in `benilla-formats`, `benilla-assets` and one `benilla-app` file. - Every literal change keeps each literal's line count, proven with comments stripped and every literal masked. The two renamed tests differ only in their names. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
43 lines
1.4 KiB
Rust
43 lines
1.4 KiB
Rust
//! Extraction helper, not shipped: `mpqx <data-dir> <virtual-path> <out>`, read through the
|
|
//! runtime's patch chain ([`benilla_formats::Chain`]). It exits 2 on a path the top archive
|
|
//! delete-marks, which the client does not load.
|
|
|
|
use std::path::Path;
|
|
|
|
use benilla_formats::Chain;
|
|
|
|
fn main() {
|
|
let mut args = std::env::args().skip(1);
|
|
let (data, vpath, out) = (
|
|
args.next().expect("data dir"),
|
|
args.next().expect("virtual path"),
|
|
args.next().expect("out path"),
|
|
);
|
|
let chain = Chain::open(Path::new(&data)).expect("open patch chain");
|
|
match chain.read(&vpath) {
|
|
Ok(bytes) => {
|
|
std::fs::write(&out, &bytes).expect("write");
|
|
let from = chain
|
|
.find_file_archive(&vpath)
|
|
.map(|p| p.display().to_string())
|
|
.unwrap_or_default();
|
|
println!(
|
|
"{} -> {} ({} bytes, from {})",
|
|
vpath,
|
|
out,
|
|
bytes.len(),
|
|
from
|
|
);
|
|
}
|
|
// `Chain::read` names a delete-marked path in its error message.
|
|
Err(e) if e.to_string().contains("deleted from patch chain") => {
|
|
eprintln!("{e} — the client does not load this path");
|
|
std::process::exit(2);
|
|
}
|
|
Err(e) => {
|
|
eprintln!("{e}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|
|
}
|