chiark / gitweb /
proposed protocol?
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Jun 2020 22:33:55 +0000 (23:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Jun 2020 22:33:55 +0000 (23:33 +0100)
NOTES [new file with mode: 0644]

diff --git a/NOTES b/NOTES
new file mode 100644 (file)
index 0000000..8bacd56
--- /dev/null
+++ b/NOTES
@@ -0,0 +1,62 @@
+protocol
+
+
+all in context of a piece
+
+
+ client                                server
+
+        <-------------------
+       some update
+               piece
+               gen
+               your doing ?
+
+at start of op
+ note picee.gen = gen
+
+ grab, or move, or something:
+       ------------------->
+       grab/move/ungrab
+               piece
+               piece.gen
+                                       if piece.gen == msg.piece.gen
+                                       then set piece.last_client
+
+                                       if piece.last_client == client
+                                       then ok
+
+                                       otherwise bad
+                                       send nothing!  a message
+                                       must be in the queue already!
+
+        <-------------------
+       soem update
+               piece
+               gen
+               your doing ?
+
+if "your doing"
+ignore the message, we are up to date,
+but set the piece's gen
+
+otherwise
+cancel any drag for the piece
+reset the piece state to that specified
+
+
+--------------------------------------------------
+
+client maintains
+       for each piece
+               [ game state ]
+               gen (last from server)
+               x, y, held
+       overall
+               [ ui state ]
+               what are we dragging, drag start, click state, etc.
+
+server maintains
+       for each piece
+               gen
+       client list etc.