fn borrow(&self) -> &str { &self.0 }
}
+#[derive(Debug)]
pub struct Client {
pub player : PlayerId,
}
}
}
+#[derive(Debug)]
pub struct PreparedUpdate {
pub gen : Generation,
pub client : ClientId,
pub json : String,
}
+#[derive(Debug)]
pub struct PlayerUpdates {
pub log : StableIndexVecDeque<Arc<PreparedUpdate>,sse::UpdateId>,
pub cv : Arc<Condvar>,
}
+#[derive(Debug)]
pub struct Instance {
pub gs : GameState,
pub clients : DenseSlotMap<ClientId,Client>,
pub updates : SecondarySlotMap<PlayerId, PlayerUpdates>,
}
-#[derive(Clone)]
+#[derive(Clone,Debug)]
pub struct InstanceAccessDetails<Id> {
pub g : Arc<Mutex<Instance>>,
pub ident : Id,
}
-#[derive(Clone)]
+#[derive(Clone,Debug)]
pub struct InstanceAccess<'i, Id> {
pub raw_token : &'i str,
pub i : InstanceAccessDetails<Id>,
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;