chiark / gitweb /
uos in session start
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 27 Sep 2020 23:42:13 +0000 (00:42 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 27 Sep 2020 23:42:13 +0000 (00:42 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/session.rs

index 5200bcf1a91766c51bdc8db9178ce99c2f94b61b..cb2203a6bf9d1941c244cc44e62ed5f7b94adc49 100644 (file)
@@ -21,7 +21,7 @@ struct SessionRenderContext {
 struct SessionPieceContext {
   id: VisiblePieceId,
   pos: Pos,
-  info: String,
+  info: String, // SessionPieceLoadJson as JSON
 }
 
 #[derive(Serialize,Debug)]
@@ -29,6 +29,7 @@ struct SessionPieceLoadJson<'r> {
   held : &'r Option<PlayerId>,
   z : ZCoord,
   zg : Generation,
+  uos: &'r [UoDescription],
 }
 
 #[derive(Serialize,Debug)]
@@ -104,6 +105,7 @@ fn session(form : Json<SessionForm>) -> Result<Template,OE> {
         held : &pr.held,
         z  : pr.zlevel.z,
         zg : pr.zlevel.zg,
+        uos : &p.ui_operations()?,
       };
 
       let for_piece = SessionPieceContext {