chiark / gitweb /
api: Provide Client and ClientSequence to api ops
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 3 Apr 2021 17:03:21 +0000 (18:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Apr 2021 19:07:53 +0000 (20:07 +0100)
Some that want to do sophisticated things might want it.  I thought
"organise" did but in fact that needs to be done a different way.
Keep this change though; it may come in handy.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/api.rs
src/gamestate.rs

index f7b78ecd73f6cb04c0af6f053bbd873a59cd41e6..e72991f1e00431aee527e9f0810c283870d7f1ab 100644 (file)
@@ -141,7 +141,8 @@ fn api_piece_op<O: op::Complex>(form: Json<ApiPiece<O>>)
     form.op.check_held(gpc,player)?;
     let update =
       form.op.op_complex(ApiPieceOpArgs {
-        ioccults, gs, player, piece, ipieces, ipc,
+        ioccults, gs, player, piece, ipieces, ipc, client,
+        cseq: form.cseq,
         ig: &iad.gref,
         to_recalculate: &mut to_recalculate,
       })?;
index f58c83ff1e3cfb5c0f8e602e56910588e372b9bd..4baf9b30e79ac74f92b40fdfd669c1ed12eee588 100644 (file)
@@ -231,6 +231,8 @@ pub struct ApiPieceOpArgs<'a> {
   pub player: PlayerId,
   pub piece: PieceId,
   pub ipc: &'a IPiece,
+  pub cseq: ClientSequence,
+  pub client: ClientId,
 }
 
 #[derive(Debug)]