From: Ian Jackson Date: Sun, 2 Aug 2020 22:53:45 +0000 (+0100) Subject: wip load games X-Git-Tag: otter-0.2.0~1193 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a8fb1c7c332afe4e36f63ab50fc38d4f516eac22;p=otter.git wip load games --- diff --git a/src/global.rs b/src/global.rs index 445b76f5..b2d04f2b 100644 --- a/src/global.rs +++ b/src/global.rs @@ -661,6 +661,32 @@ impl InstanceGuard<'_> { } } +#[throws(ServerFailure)] +pub fn load_games() { +/* + /// xxx take a lock + enum A_State { Found, Used }; + let mut a_leaves = HashMap::new(); + for de in fs::read_dir(SAVE_DIRECTORY)? { + let leaf = de.file_name().as_bytes(); + if leaf.starts_with("a-") { + a_leaves.entry(leaf.to_owned()).or_insert(A_State::Found); + } else if leaf.starts_with("g-") { + + a_leaves.insert(leaf.to_owned(),A_State::Used); + + } + + match { + &[b"g-"..] => { + } + _ => { + } + } + } +*/ +} + // ---------- Tokens / TokenTable / AccessId ---------- pub type TokenTable = HashMap>;