From: Ian Jackson Date: Sat, 4 Jul 2020 15:57:06 +0000 (+0100) Subject: debugging X-Git-Tag: otter-0.2.0~1469 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=985e64c75d1e93630d1603e43a6a1a88f906bef1;p=otter.git debugging --- diff --git a/src/global.rs b/src/global.rs index 38d1b42d..1601067b 100644 --- a/src/global.rs +++ b/src/global.rs @@ -13,6 +13,7 @@ impl Borrow for RawToken { fn borrow(&self) -> &str { &self.0 } } +#[derive(Debug)] pub struct Client { pub player : PlayerId, } @@ -23,6 +24,7 @@ impl Client { } } +#[derive(Debug)] pub struct PreparedUpdate { pub gen : Generation, pub client : ClientId, @@ -31,24 +33,26 @@ pub struct PreparedUpdate { pub json : String, } +#[derive(Debug)] pub struct PlayerUpdates { pub log : StableIndexVecDeque,sse::UpdateId>, pub cv : Arc, } +#[derive(Debug)] pub struct Instance { pub gs : GameState, pub clients : DenseSlotMap, pub updates : SecondarySlotMap, } -#[derive(Clone)] +#[derive(Clone,Debug)] pub struct InstanceAccessDetails { pub g : Arc>, pub ident : Id, } -#[derive(Clone)] +#[derive(Clone,Debug)] pub struct InstanceAccess<'i, Id> { pub raw_token : &'i str, pub i : InstanceAccessDetails, diff --git a/src/sse.rs b/src/sse.rs index 228157bf..4075fdef 100644 --- a/src/sse.rs +++ b/src/sse.rs @@ -179,6 +179,8 @@ pub fn content(iad : InstanceAccessDetails, gen: Generation) let _g = &mut ig.gs; let cl = ig.clients.byid(client)?; let player = cl.player; +eprintln!("updates content iad={:?} player={:?} cl={:?} updates={:?}", + &iad, &player, &cl, &ig.updates); let ami = iad.g.clone(); let log = &ig.updates.byid(player)?.log;