From 1c268f3603f4444ee36752414b8c5281f298f5f3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 23 Nov 2020 00:08:29 +0000 Subject: [PATCH] delete obsolete code Signed-off-by: Ian Jackson --- src/bin/otter.rs | 66 ------------------------------------------------ 1 file changed, 66 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index d8b41ddd..57ce6c1e 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -642,72 +642,6 @@ fn setup_table(_ma: &MainOpts, spec: &TableSpec) -> Vec { insns } - - -/* - - let (_, nick2id) = chan.get_info()?; - - #[derive(Default)] - struct St { id: PlayerId, old: bool, new: bool }; - - let mut nick2st : HashMap<_,_> = {nick2id} - .drain() - .map(|(nick,id)| (nick, St { id, old: true, new: false })) - .collect(); - - for pspec in &spec.players { - let nick = pspec.nick.unwrap_or_else(|| pspec.account.default_nick()); - let st = nick2st.entry(nick.clone()).or_default(); - if st.new { - Err(anyhow!("duplicate player nick {:?} in spec", &nick))?; - } - st.new = true; - let timezone = pspec.timezone.as_ref().or( - spec.timezone.as_ref() - ).cloned(); - // ^ todo use client program timezone? - if !st.old { - insns.push(MgmtGameInstruction::AddPlayer { - account: pspec.account.clone(), - details: MgmtPlayerDetails { - nick: Some(nick), - timezone, - }, - }); - } - } - - for (nick, st) in nick2st { - if st.new { continue } - if !st.old { continue } - if ma.verbose >= 1 { - eprintln!("removing old player {:?}", &nick); - } - insns.push(MGI::RemovePlayer { player: st.id }); - } - - let mut added_players = vec![]; - chan.alter_game(insns, Some(&mut |response| { - match response { - &Resp::AddPlayer { info, player, token } => { - added_players.push((info.clone(), token.clone())); - }, - _ => { }, - }; - Ok(()) - }))?; - - // report any new access tokens - for (info, token) in added_players { - - access.deliver_tokens(&pspec, &ptokens) - .with_context(||format!("deliver tokens for nick={:?}", - &pspec.nick))?; - } - } -*/ - trait SomeSpec { const WHAT : &'static str; const FNCOMP : &'static str; -- 2.30.2