From: Ian Jackson Date: Sat, 30 Jan 2021 23:06:44 +0000 (+0000) Subject: hidden: Provide per-player id map X-Git-Tag: otter-0.4.0~595 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=133468b43f4aa6f7dcbe3113ee89051584cb5f71;p=otter.git hidden: Provide per-player id map Not used yet... Signed-off-by: Ian Jackson --- diff --git a/daemon/cmdlistener.rs b/daemon/cmdlistener.rs index 2890dd24..21f11857 100644 --- a/daemon/cmdlistener.rs +++ b/daemon/cmdlistener.rs @@ -356,6 +356,7 @@ fn execute_game_insn<'cs, 'igr, 'ig: 'igr>( let gpl = GPlayerState { nick: nick.to_string(), layout: arecord.layout, + idmap: default(), }; let ipl = IPlayerState { acctid, diff --git a/src/gamestate.rs b/src/gamestate.rs index 6c1e941b..28ef8e71 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -68,6 +68,7 @@ pub struct GameState { pub struct GPlayerState { pub nick: String, pub layout: PresentationLayout, + pub idmap: PerPlayerIdMap, } #[derive(Debug,Serialize,Deserialize)] diff --git a/src/hidden.rs b/src/hidden.rs index d5fbf8a5..72f99b20 100644 --- a/src/hidden.rs +++ b/src/hidden.rs @@ -6,6 +6,7 @@ use crate::imports::*; use slotmap::secondary; +#[derive(Default,Debug,Clone,Serialize,Deserialize)] pub struct PerPlayerIdMap { f: SecondarySlotMap, r: DenseSlotMap, diff --git a/src/imports.rs b/src/imports.rs index b79258fd..bbdaeb7d 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -90,6 +90,7 @@ pub use crate::debugreader::DebugReader; pub use crate::error::*; pub use crate::gamestate::*; pub use crate::global::*; +pub use crate::hidden::PerPlayerIdMap; pub use crate::keydata::*; pub use crate::lens::*; pub use crate::mgmtchannel::*; diff --git a/src/lib.rs b/src/lib.rs index 9da9f364..9d208927 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,6 +12,7 @@ pub mod debugreader; pub mod error; pub mod gamestate; pub mod global; +pub mod hidden; pub mod imports; pub mod keydata; pub mod lens;