Add multiplayer events

Continue with the Go module, generated SDK, and checkers.db from Crown a king. Rosie has a red piece on 15 and a red king on 27. Bob has a black piece on 24 and the next turn. A query subscription tells both players where the pieces are. The events plugin also lets them share a cursor, ask the rules worker for legal landings, and submit a whole jump path.

Extend the saved rules

In definitions/checkers/boards.dust, insert the king jump definitions before the final export. The query finds an opponent on an adjacent diagonal and an empty square beyond it. The mutation checks both jumps and removes both captured pieces in one transaction. Replace the export with this line:

text53 B
(export setup board move jump king-jumps double-jump)

Play through the exchanges

Save the Go test as game/checkers_test.go in your existing module. Regenerate the SDK and run the test from the module directory:

sh40 B
go run ./seed
go test -count=1 -v ./game

Run the test once on the position left by the crown lesson. It plays nine ordinary moves using the existing move mutation. Bob reaches 2 and the crown reactor makes his piece a king. Rosie’s king is now on 10 and her other piece is still on 15. The following lessons show the exchanges from that test in play order.