From 44fba3bf9d8b2b96c6c21855fc7970107a8d8b8b Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:50:52 +0200 Subject: [PATCH] horizon-server: find game files prepared without sounds init and run looked for asset-index.json to recognise a prepared folder, but horizon-prepare writes that file only with the optional sounds (`horizon-prepare sounds`). A server prepared the usual way, without sounds, was never found: init said "no prepared game files" and listed the folder that held them. They are now recognised by horizon-resources.json, the manifest every preparation writes and the one the game itself reads. Found by installing v2026.10.18.15 with install.sh on the Mac mini and preparing from the release folder. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-server/src/engine.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/crates/horizon-server/src/engine.rs b/crates/horizon-server/src/engine.rs index c0043e1d3..b39b5bed9 100644 --- a/crates/horizon-server/src/engine.rs +++ b/crates/horizon-server/src/engine.rs @@ -65,12 +65,13 @@ pub fn resource_candidates(config: &Config, dir: &Path, program: Option<&Path>) out } -/// The prepared game files: a folder holding the asset index `horizon-prepare` writes. +/// The prepared game files: a folder holding the manifest every `horizon-prepare` run writes +/// (`asset-index.json` comes only with the optional sounds, which a server doesn't need). pub fn resources(config: &Config, dir: &Path, program: Option<&Path>) -> Result { let candidates = resource_candidates(config, dir, program); candidates .iter() - .find(|d| d.join("asset-index.json").is_file()) + .find(|d| d.join("horizon-resources.json").is_file()) .cloned() .ok_or_else(|| { let tried: Vec = candidates @@ -179,4 +180,19 @@ mod tests { [PathBuf::from("/data/res")] ); } + + #[test] + fn resources_prepared_without_sounds_are_found() { + let root = std::env::temp_dir().join(format!("horizon-server-res-{}", std::process::id())); + let prepared = root.join(".local/horizon-client/26.3"); + std::fs::create_dir_all(&prepared).unwrap(); + let program = root.join("horizon-client"); + let config = Config::default(); + let server = root.join("server"); + assert!(resources(&config, &server, Some(&program)).is_err()); + // What `horizon-prepare` writes on every run; no asset index without `horizon-prepare sounds`. + std::fs::write(prepared.join("horizon-resources.json"), "{}").unwrap(); + assert_eq!(resources(&config, &server, Some(&program)), Ok(prepared)); + std::fs::remove_dir_all(&root).unwrap(); + } }