From d9bc5ced63c2934f5c1fb807f5bc8e15f83eb602 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 3 Apr 2021 18:03:21 +0100 Subject: [PATCH] api: Provide Client and ClientSequence to api ops 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 --- daemon/api.rs | 3 ++- src/gamestate.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/api.rs b/daemon/api.rs index f7b78ecd..e72991f1 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -141,7 +141,8 @@ fn api_piece_op(form: Json>) 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, })?; diff --git a/src/gamestate.rs b/src/gamestate.rs index f58c83ff..4baf9b30 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -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)] -- 2.30.2