chiark / gitweb /
otter.git
4 years agohidden: Provide stub PieceOccult
Ian Jackson [Sun, 31 Jan 2021 23:07:21 +0000 (23:07 +0000)]
hidden: Provide stub PieceOccult

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Add some dividers to the file, etc.
Ian Jackson [Sun, 31 Jan 2021 23:35:21 +0000 (23:35 +0000)]
hidden: Add some dividers to the file, etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Document the convention about last face
Ian Jackson [Sun, 31 Jan 2021 23:07:32 +0000 (23:07 +0000)]
hidden: Document the convention about last face

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agomovement: Prevent players moving things that they haven't grasped
Ian Jackson [Sun, 31 Jan 2021 23:06:37 +0000 (23:06 +0000)]
movement: Prevent players moving things that they haven't grasped

Also, a todo.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
squash! movement: Prevent players moving things that they haven't grasped

4 years agohidden: a todo
Ian Jackson [Sun, 31 Jan 2021 23:06:14 +0000 (23:06 +0000)]
hidden: a todo

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: docs: Small note
Ian Jackson [Sun, 31 Jan 2021 23:05:48 +0000 (23:05 +0000)]
hidden: docs: Small note

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agomove our default() into zcoord::misc and use it everywhere
Ian Jackson [Sun, 31 Jan 2021 23:47:41 +0000 (23:47 +0000)]
move our default() into zcoord::misc and use it everywhere

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agouse our default() alias everywhere we can
Ian Jackson [Sun, 31 Jan 2021 23:44:49 +0000 (23:44 +0000)]
use our default() alias everywhere we can

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Abolish Lens
Ian Jackson [Sun, 31 Jan 2021 22:43:36 +0000 (22:43 +0000)]
hidden: Abolish Lens

This is never used for anything and can be simply deleted now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Provide and use piece_at_all_occluded in cmdlistener
Ian Jackson [Sun, 31 Jan 2021 22:41:49 +0000 (22:41 +0000)]
hidden: Provide and use piece_at_all_occluded in cmdlistener

We still don't deal with listing (partly) occluded pieces, or taking
them into account for library placement.

In the future this may become more sophisticaed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Abolish longstanding temporary make_angle_visible
Ian Jackson [Sun, 31 Jan 2021 17:14:37 +0000 (17:14 +0000)]
hidden: Abolish longstanding temporary make_angle_visible

This is going to be done directly in hidden, in piece_pri.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Trace missing piece map lookups too
Ian Jackson [Sun, 31 Jan 2021 16:45:37 +0000 (16:45 +0000)]
hidden: Trace missing piece map lookups too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Add trace for piece ID mapping
Ian Jackson [Sun, 31 Jan 2021 15:27:10 +0000 (15:27 +0000)]
hidden: Add trace for piece ID mapping

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Refactor piece_pri very slightly to break ut face
Ian Jackson [Sun, 31 Jan 2021 15:26:39 +0000 (15:26 +0000)]
hidden: Refactor piece_pri very slightly to break ut face

NFC

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Pass PlayerId to new APIs
Ian Jackson [Sun, 31 Jan 2021 15:26:14 +0000 (15:26 +0000)]
hidden: Pass PlayerId to new APIs

We want this for debug logging right now, but we'll surely want it for
actual processing when we implement all this.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Use new PieceRenderInstructions and svg massage APIs
Ian Jackson [Sun, 31 Jan 2021 21:51:03 +0000 (21:51 +0000)]
hidden: Use new PieceRenderInstructions and svg massage APIs

In general terms:
 * When we need a PieceRenderInstructions get it from piece_pri
   (including from gs.occults) rather than from a Lens.
 * Delete the methods from Lens (and the dummy make_pieceid_visible
   function) so we are sure they aren't used.
 * Use the new massage_prep_piecestate function rather than the
   method on Lens.
 * Consequential changes, including providing mutable gpl in one
   placea, and adding/removing _ prefixes for expectedly used/unsued
   variables.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: New PieceRenderInstructions etc. API
Ian Jackson [Sun, 31 Jan 2021 18:48:52 +0000 (18:48 +0000)]
hidden: New PieceRenderInstructions etc. API

This is how things are going to be.  We need to call these everywhere,
and make them do something.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Make pri an argument to piece_update_player
Ian Jackson [Sun, 31 Jan 2021 21:50:36 +0000 (21:50 +0000)]
hidden prep: Make pri an argument to piece_update_player

This is where it's going to want to be in a moment.  NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: api_wrest: Reorganise borrows
Ian Jackson [Sun, 31 Jan 2021 21:18:48 +0000 (21:18 +0000)]
hidden prep: api_wrest: Reorganise borrows

 * Borrow gs.players separately.
 * Borrow gpl mut.
 * Change the order of things.

We'll want this in a moment.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: api_wrest: Move was formatting earlier
Ian Jackson [Sun, 31 Jan 2021 21:11:18 +0000 (21:11 +0000)]
hidden prep: api_wrest: Move was formatting earlier

We want to drop the borrow on gs.players.get(was) because we will want
a mut borrow of gs.players soon.

NFC

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Pass GameOccults to log_did_to_piece
Ian Jackson [Sun, 31 Jan 2021 12:26:15 +0000 (12:26 +0000)]
hidden prep: Pass GameOccults to log_did_to_piece

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Provide GameOccults in GameState
Ian Jackson [Sun, 31 Jan 2021 18:48:43 +0000 (18:48 +0000)]
hidden prep: Provide GameOccults in GameState

This is currently empty and unused.  It's a placeholder which we are
going to plumb through everywhere.

NFC but breaks the savefile format.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Pass &mut GPlayerState to log_did_to_piece
Ian Jackson [Sun, 31 Jan 2021 12:23:12 +0000 (12:23 +0000)]
hidden prep: Pass &mut GPlayerState to log_did_to_piece

Piece id conversion is going to possibly need to update the map in
gpl.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agodaemon: wip: add a todo relating to PieceGone
Ian Jackson [Sat, 30 Jan 2021 23:50:24 +0000 (23:50 +0000)]
daemon: wip: add a todo relating to PieceGone

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: wip a new Lens placeholder
Ian Jackson [Sat, 30 Jan 2021 23:13:41 +0000 (23:13 +0000)]
hidden: wip a new Lens placeholder

(Actually, we changed our mind about this and it was never used.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Declare new status of Lens
Ian Jackson [Sat, 30 Jan 2021 23:04:51 +0000 (23:04 +0000)]
hidden: Declare new status of Lens

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agocargo: Update to our slotmap MR git branch
Ian Jackson [Sat, 30 Jan 2021 01:58:03 +0000 (01:58 +0000)]
cargo: Update to our slotmap MR git branch

This does not seem to show up in the lockfile.  Odd.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: Provide per-player id map
Ian Jackson [Sat, 30 Jan 2021 23:06:44 +0000 (23:06 +0000)]
hidden: Provide per-player id map

Not used yet...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: wip per-player id map
Ian Jackson [Sat, 30 Jan 2021 22:36:41 +0000 (22:36 +0000)]
hidden: wip per-player id map

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoUse local slotmap for VacantEntry::remove_stale_entry
Ian Jackson [Sat, 16 Jan 2021 12:10:57 +0000 (12:10 +0000)]
Use local slotmap for VacantEntry::remove_stale_entry

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Do not make PieceUpdateOps Clone
Ian Jackson [Sat, 30 Jan 2021 22:09:24 +0000 (22:09 +0000)]
hidden prep: Do not make PieceUpdateOps Clone

Tbis is not a good idea and not needed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Allow api updates to be per-player
Ian Jackson [Sat, 30 Jan 2021 22:08:59 +0000 (22:08 +0000)]
hidden prep: Allow api updates to be per-player

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Allow prepared updates to be per-player
Ian Jackson [Sat, 30 Jan 2021 21:58:01 +0000 (21:58 +0000)]
hidden prep: Allow prepared updates to be per-player

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Add a few missing Clone/Copy
Ian Jackson [Sat, 30 Jan 2021 21:55:18 +0000 (21:55 +0000)]
hidden prep: Add a few missing Clone/Copy

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Per-player TransmitUpdateEntry can be None
Ian Jackson [Sat, 30 Jan 2021 21:20:13 +0000 (21:20 +0000)]
hidden prep: Per-player TransmitUpdateEntry can be None

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Pass PlayerId through TransmitUpdateEntry generation
Ian Jackson [Sat, 30 Jan 2021 21:13:08 +0000 (21:13 +0000)]
hidden prep: Pass PlayerId through TransmitUpdateEntry generation

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Pass PUO to piece_update_fallible
Ian Jackson [Sat, 30 Jan 2021 15:03:53 +0000 (15:03 +0000)]
hidden prep: Pass PUO to piece_update_fallible

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Reorganise PieceUpdateFromOp
Ian Jackson [Sat, 30 Jan 2021 12:11:33 +0000 (12:11 +0000)]
hidden prep: Reorganise PieceUpdateFromOp

We are going to want to allow an op to give different answers to
different clients.  The representation from an op is going to be
either basically what we have now, or a version where the
PieceUpdateOp is different for each player.

Prepare for this with some struct and type shuffling.  We laave a
convenience Into impl to allow ops to easily handle the simple case.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden prep: Pass player to json_len() methods
Ian Jackson [Sat, 30 Jan 2021 11:12:55 +0000 (11:12 +0000)]
hidden prep: Pass player to json_len() methods

NFC right now.  We are going to want this later.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: wip notes/plans, found
Ian Jackson [Sun, 31 Jan 2021 11:29:53 +0000 (11:29 +0000)]
hidden: wip notes/plans, found

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: wip notes/plans
Ian Jackson [Tue, 19 Jan 2021 20:05:53 +0000 (20:05 +0000)]
hidden: wip notes/plans

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agohidden: wip notes/plans, found
Ian Jackson [Sun, 17 Jan 2021 22:01:52 +0000 (22:01 +0000)]
hidden: wip notes/plans, found

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoconfig: Allow OTTER_LOG to partially override config
Ian Jackson [Sun, 31 Jan 2021 16:47:57 +0000 (16:47 +0000)]
config: Allow OTTER_LOG to partially override config

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoutils: Provide toml_merge
Ian Jackson [Sun, 31 Jan 2021 16:45:43 +0000 (16:45 +0000)]
utils: Provide toml_merge

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoconfig: Allow OTTER_LOG to (completely) override config
Ian Jackson [Sun, 31 Jan 2021 16:45:06 +0000 (16:45 +0000)]
config: Allow OTTER_LOG to (completely) override config

If the env var is supplied and results in a nonempty log spec, we
replace the log config completely.

This is quite a lot of faff because no-one likes to give us the right
interfaces.  In particular flexi_logger wants to give and receive
(byte) strings.

This is not the final state; we want to merge them, really.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agotoml-de: Provide from_slice
Ian Jackson [Sun, 31 Jan 2021 16:45:26 +0000 (16:45 +0000)]
toml-de: Provide from_slice

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoconfig: Refactor log setup into own block
Ian Jackson [Sun, 31 Jan 2021 15:57:31 +0000 (15:57 +0000)]
config: Refactor log setup into own block

We'll add stuff in a moment that modifies log while it's still a
`Table` rather than a `Value`.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agodaemon: api route macros: tolerate attrs on structs
Ian Jackson [Sun, 31 Jan 2021 00:48:35 +0000 (00:48 +0000)]
daemon: api route macros: tolerate attrs on structs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agodaemon: use macro for all api routes
Ian Jackson [Sun, 31 Jan 2021 00:37:38 +0000 (00:37 +0000)]
daemon: use macro for all api routes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agodaemon: wip macro for api routes
Ian Jackson [Sun, 31 Jan 2021 00:11:10 +0000 (00:11 +0000)]
daemon: wip macro for api routes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agodaemon: Fix many errors (OER rather than OE)
Ian Jackson [Sat, 30 Jan 2021 23:46:14 +0000 (23:46 +0000)]
daemon: Fix many errors (OER rather than OE)

Firstly, all these functions shuuld throw OER which is the thing which
implements the Rocket Responder trait, so that the error actually goes
back to the client.

Secondly, they all need ?.  Without that, these functions all always
succeed and always return Result::Ok(some Result<, OE[R]>).
Surprisingly this is accepted, because Result<> impl Responder
and apparently Result<Result<..>> does too!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoRemove a space
Ian Jackson [Sat, 30 Jan 2021 14:58:15 +0000 (14:58 +0000)]
Remove a space

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agocargo: Update to lazy_init 0.5
Ian Jackson [Sat, 30 Jan 2021 14:43:19 +0000 (14:43 +0000)]
cargo: Update to lazy_init 0.5

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agodaemon Cargo.toml: Fix dependency versions
Ian Jackson [Sat, 30 Jan 2021 14:11:24 +0000 (14:11 +0000)]
daemon Cargo.toml: Fix dependency versions

We fixed this for src/ but daemon's Cargo.toml was resurrected from an
earlier state so missed it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoMakefile: pass cargo --workspace, (nearly) always
Ian Jackson [Sat, 30 Jan 2021 14:33:39 +0000 (14:33 +0000)]
Makefile: pass cargo --workspace, (nearly) always

This seems to work around
  https://github.com/rust-lang/cargo/issues/9114
  https://github.com/rust-lang/cargo/issues/9114

The WASM call doesn't have it because (i) we want that to be minimal
(ii) there's only the one call to cargo for that architecture.

Build times:

  touch src/updates.rs; (time make -j12 wdt) 2>&1 |ts -s %.s
    before 26s    after 19s

  touch src/updates.rs; (time make -j12) 2>&1 |ts -s %.s
    before 33s    after 27s

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoDrop thirtyfour_sync from Cargo.nail, our MR was merged
Ian Jackson [Sat, 30 Jan 2021 01:56:36 +0000 (01:56 +0000)]
Drop thirtyfour_sync from Cargo.nail, our MR was merged

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agocargo update
Ian Jackson [Sat, 30 Jan 2021 01:49:54 +0000 (01:49 +0000)]
cargo update

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Apply test! to wdt-altergame
Ian Jackson [Sat, 30 Jan 2021 01:31:23 +0000 (01:31 +0000)]
wdt: Apply test! to wdt-altergame

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Provide ActionChainExt::move_pc for convenience
Ian Jackson [Sat, 30 Jan 2021 01:25:32 +0000 (01:25 +0000)]
wdt: Provide ActionChainExt::move_pc for convenience

And use it in one place.  NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt-simple: conflict: establish our preconditions
Ian Jackson [Sat, 30 Jan 2021 01:18:33 +0000 (01:18 +0000)]
wdt-simple: conflict: establish our preconditions

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Tidy up test selection etc.
Ian Jackson [Sat, 30 Jan 2021 01:13:18 +0000 (01:13 +0000)]
wdt: Tidy up test selection etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Allow test name argument
Ian Jackson [Sat, 30 Jan 2021 01:09:55 +0000 (01:09 +0000)]
wdt: Allow test name argument

Currently only for wdt-simple, and not complete yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: conflict test actually tests, and passes, yay!
Ian Jackson [Fri, 29 Jan 2021 23:22:00 +0000 (23:22 +0000)]
wdt: conflict test actually tests, and passes, yay!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoutils: Improve ensure_eq! so it always takes references
Ian Jackson [Fri, 29 Jan 2021 23:21:12 +0000 (23:21 +0000)]
utils: Improve ensure_eq! so it always takes references

That saves some minorly annoying & typing

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: wdt-simple: get client into gots
Ian Jackson [Fri, 29 Jan 2021 22:55:32 +0000 (22:55 +0000)]
wdt: wdt-simple: get client into gots

Not used yet

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Provide WindowGuard::client()
Ian Jackson [Fri, 29 Jan 2021 22:55:16 +0000 (22:55 +0000)]
wdt: Provide WindowGuard::client()

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: wdt-simple: Remove an unused variable
Ian Jackson [Fri, 29 Jan 2021 22:54:55 +0000 (22:54 +0000)]
wdt: wdt-simple: Remove an unused variable

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: remove some silly lifetime annotations nfc
Ian Jackson [Fri, 29 Jan 2021 22:54:35 +0000 (22:54 +0000)]
wdt: remove some silly lifetime annotations nfc

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: import OnceCell into scope nfc
Ian Jackson [Fri, 29 Jan 2021 22:53:43 +0000 (22:53 +0000)]
wdt: import OnceCell into scope nfc

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates: Clean up an obsolete type alias
Ian Jackson [Fri, 29 Jan 2021 22:31:34 +0000 (22:31 +0000)]
updates: Clean up an obsolete type alias

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: clean up conflict check
Ian Jackson [Fri, 29 Jan 2021 21:15:08 +0000 (21:15 +0000)]
wdt: clean up conflict check

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates, errors: Completely revamp error handling
Ian Jackson [Sat, 30 Jan 2021 00:36:53 +0000 (00:36 +0000)]
updates, errors: Completely revamp error handling

There were multiple bugs here.  We weren't coherent about what to send
to whom, and whether to update the piece generation, if there was an
error (including a conflict or a partially processed API op).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates: Formatting fix (nfc)
Ian Jackson [Sat, 30 Jan 2021 00:36:40 +0000 (00:36 +0000)]
updates: Formatting fix (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates: Break out some sub-functiosn
Ian Jackson [Sat, 30 Jan 2021 00:22:47 +0000 (00:22 +0000)]
updates: Break out some sub-functiosn

We're going to want to reuse this.

Broken out of a portmanteau commit.  NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates, errors: Add some missing Clone impls (nfc)
Ian Jackson [Sat, 30 Jan 2021 00:07:58 +0000 (00:07 +0000)]
updates, errors: Add some missing Clone impls (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates, errors: Break out PUE_Piece::json_len (nfc)
Ian Jackson [Sat, 30 Jan 2021 00:05:54 +0000 (00:05 +0000)]
updates, errors: Break out PUE_Piece::json_len (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates, errors: Reformat IsResponseToClientOp (nfc)
Ian Jackson [Sat, 30 Jan 2021 00:04:53 +0000 (00:04 +0000)]
updates, errors: Reformat IsResponseToClientOp (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoupdates, errors: Add a doc comment
Ian Jackson [Sat, 30 Jan 2021 00:04:00 +0000 (00:04 +0000)]
updates, errors: Add a doc comment

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Use w.piece_held()
Ian Jackson [Fri, 29 Jan 2021 18:21:37 +0000 (18:21 +0000)]
wdt: Use w.piece_held()

Rather than the clone-and-hack copy.  Tidying up, NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: conflict test, further wip
Ian Jackson [Thu, 28 Jan 2021 18:09:09 +0000 (18:09 +0000)]
wdt: conflict test, further wip

Not a complete test yet.

There are bugs to fix here.  In particular, right now, it seems that
both clients get a conflict ?

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: conflict test, further wip
Ian Jackson [Wed, 27 Jan 2021 01:52:24 +0000 (01:52 +0000)]
wdt: conflict test, further wip

Not a complete test yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: wip test selection
Ian Jackson [Fri, 29 Jan 2021 19:09:22 +0000 (19:09 +0000)]
wdt: wip test selection

This is very incomplete but it doesn't cause any *trouble* per se.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoscript: Add a log message for error piece update
Ian Jackson [Fri, 29 Jan 2021 19:45:13 +0000 (19:45 +0000)]
script: Add a log message for error piece update

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: drag off: synch before chk
Ian Jackson [Fri, 29 Jan 2021 19:36:11 +0000 (19:36 +0000)]
wdt: drag off: synch before chk

Otherwise we can see the client's uncorrected view of things.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoapi: Add some extra debug for api op processing
Ian Jackson [Fri, 29 Jan 2021 18:21:47 +0000 (18:21 +0000)]
api: Add some extra debug for api op processing

This helps debug the conflict protocol (PROTOCOL.md).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agoutils: Improve display_as_debug! so it can pass generic params
Ian Jackson [Mon, 25 Jan 2021 19:26:53 +0000 (19:26 +0000)]
utils: Improve display_as_debug! so it can pass generic params

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agointroduce TransmitUpdateEntry_Piece (nfc)
Ian Jackson [Mon, 25 Jan 2021 18:44:21 +0000 (18:44 +0000)]
introduce TransmitUpdateEntry_Piece (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agointroduce PreparedUpdateEntry_Piece (nfc)
Ian Jackson [Sun, 24 Jan 2021 11:47:43 +0000 (11:47 +0000)]
introduce PreparedUpdateEntry_Piece (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Break out w.piece_held()
Ian Jackson [Thu, 28 Jan 2021 17:45:25 +0000 (17:45 +0000)]
wdt: Break out w.piece_held()

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Fix unselect test to actually work
Ian Jackson [Thu, 28 Jan 2021 17:39:34 +0000 (17:39 +0000)]
wdt: Fix unselect test to actually work

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Tidy up new facilities
Ian Jackson [Thu, 28 Jan 2021 17:37:32 +0000 (17:37 +0000)]
wdt: Tidy up new facilities

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Use new facilities
Ian Jackson [Thu, 28 Jan 2021 17:10:47 +0000 (17:10 +0000)]
wdt: Use new facilities

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: new move_pos extension method
Ian Jackson [Thu, 28 Jan 2021 17:05:06 +0000 (17:05 +0000)]
wdt: new move_pos extension method

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: Use new w_move extension method
Ian Jackson [Thu, 28 Jan 2021 16:54:44 +0000 (16:54 +0000)]
wdt: Use new w_move extension method

This necessitates using our branch of thirtyfour_sync until
  Make action_chain module pub
  https://github.com/stevepryde/thirtyfour_sync/pull/4

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: wip new pos handling trait
Ian Jackson [Thu, 28 Jan 2021 16:12:16 +0000 (16:12 +0000)]
wdt: wip new pos handling trait

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: wip new pos handling trait
Ian Jackson [Thu, 28 Jan 2021 16:08:38 +0000 (16:08 +0000)]
wdt: wip new pos handling trait

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: wip conflict test
Ian Jackson [Wed, 27 Jan 2021 01:12:05 +0000 (01:12 +0000)]
wdt: wip conflict test

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: replace an assert with an ensure
Ian Jackson [Wed, 27 Jan 2021 00:55:07 +0000 (00:55 +0000)]
wdt: replace an assert with an ensure

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: plumb server child through to Setup
Ian Jackson [Wed, 27 Jan 2021 00:04:01 +0000 (00:04 +0000)]
wdt: plumb server child through to Setup

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 years agowdt: drag_end test, works
Ian Jackson [Tue, 26 Jan 2021 23:58:16 +0000 (23:58 +0000)]
wdt: drag_end test, works

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>