From a8fb1c7c332afe4e36f63ab50fc38d4f516eac22 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 2 Aug 2020 23:53:45 +0100 Subject: [PATCH] wip load games --- src/global.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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>; -- 2.30.2