Ground placed-structure side-buffer seam
This commit is contained in:
parent
ec4919fdbf
commit
a669edcaa8
4 changed files with 82 additions and 8 deletions
|
|
@ -125,7 +125,8 @@ pub use smp::{
|
|||
SmpSaveWorldSelectionRoleAnalysis, SmpSaveWorldSelectionRoleAnalysisEntry,
|
||||
SmpSecondaryVariantProbe, SmpSharedHeader, SmpSpecialConditionEntry, SmpSpecialConditionsProbe,
|
||||
inspect_save_company_and_chairman_analysis_bytes,
|
||||
inspect_save_company_and_chairman_analysis_file, inspect_smp_bytes, inspect_smp_file,
|
||||
inspect_save_company_and_chairman_analysis_file,
|
||||
inspect_save_placed_structure_dynamic_side_buffer_file, inspect_smp_bytes, inspect_smp_file,
|
||||
inspect_unclassified_save_collection_headers_file, load_save_slice_file,
|
||||
load_save_slice_from_report,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3126,6 +3126,35 @@ pub fn inspect_unclassified_save_collection_headers_file(
|
|||
))
|
||||
}
|
||||
|
||||
pub fn inspect_save_placed_structure_dynamic_side_buffer_file(
|
||||
path: &Path,
|
||||
) -> Result<Option<SmpSavePlacedStructureDynamicSideBufferProbe>, Box<dyn std::error::Error>> {
|
||||
let bytes = fs::read(path)?;
|
||||
let file_extension_hint = path
|
||||
.extension()
|
||||
.and_then(|extension| extension.to_str())
|
||||
.map(|extension| extension.to_ascii_lowercase());
|
||||
let shared_header = parse_shared_header(&bytes);
|
||||
let header_variant_probe = shared_header.as_ref().map(classify_header_variant_probe);
|
||||
let first_ascii_run = find_first_ascii_run(&bytes);
|
||||
let early_content_probe = first_ascii_run
|
||||
.as_ref()
|
||||
.and_then(|ascii_run| probe_early_content_layout(&bytes, ascii_run));
|
||||
let secondary_variant_probe = early_content_probe
|
||||
.as_ref()
|
||||
.and_then(classify_secondary_variant_probe);
|
||||
let container_profile = classify_container_profile(
|
||||
file_extension_hint.as_deref(),
|
||||
header_variant_probe.as_ref(),
|
||||
secondary_variant_probe.as_ref(),
|
||||
);
|
||||
Ok(parse_save_placed_structure_dynamic_side_buffer_probe(
|
||||
&bytes,
|
||||
file_extension_hint.as_deref(),
|
||||
container_profile.as_ref(),
|
||||
))
|
||||
}
|
||||
|
||||
pub fn inspect_smp_bytes(bytes: &[u8]) -> SmpInspectionReport {
|
||||
inspect_bundle_bytes(bytes, None)
|
||||
}
|
||||
|
|
@ -3286,6 +3315,8 @@ pub fn load_save_slice_from_report(
|
|||
enabled_visible_labels: probe.enabled_visible_labels.clone(),
|
||||
entries: probe.entries.clone(),
|
||||
});
|
||||
let placed_structure_dynamic_side_buffer_probe =
|
||||
report.save_placed_structure_dynamic_side_buffer_probe.clone();
|
||||
let mut notes = summary.notes.clone();
|
||||
if let Some(probe) = &report.save_world_selection_context_probe {
|
||||
notes.push(format!(
|
||||
|
|
@ -3441,7 +3472,7 @@ pub fn load_save_slice_from_report(
|
|||
probe.entries.first().map(|entry| entry.profile_status_kind.as_str())
|
||||
));
|
||||
}
|
||||
if let Some(probe) = &report.save_placed_structure_dynamic_side_buffer_probe {
|
||||
if let Some(probe) = &placed_structure_dynamic_side_buffer_probe {
|
||||
notes.push(format!(
|
||||
"Raw save also exposes the separate placed-structure dynamic-side-buffer candidate 0x38a5/0x38a6/0x38a7: live_record_count={}, first compact prefix=({},{},{}), first embedded names={:?}/{:?}, embedded 0x55f1 row count={}.",
|
||||
probe.live_record_count,
|
||||
|
|
@ -3517,8 +3548,16 @@ pub fn inspect_save_company_and_chairman_analysis_bytes(
|
|||
let region_record_triplets = report.save_region_record_triplet_probe.clone();
|
||||
let placed_structure_record_triplets =
|
||||
report.save_placed_structure_record_triplet_probe.clone();
|
||||
let placed_structure_dynamic_side_buffer =
|
||||
report.save_placed_structure_dynamic_side_buffer_probe.clone();
|
||||
let placed_structure_dynamic_side_buffer = report
|
||||
.save_placed_structure_dynamic_side_buffer_probe
|
||||
.clone()
|
||||
.or_else(|| {
|
||||
parse_save_placed_structure_dynamic_side_buffer_probe(
|
||||
bytes,
|
||||
report.file_extension_hint.as_deref(),
|
||||
report.container_profile.as_ref(),
|
||||
)
|
||||
});
|
||||
let unclassified_tagged_collection_headers = report
|
||||
.save_unclassified_tagged_collection_header_probes
|
||||
.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue