Editing Miniature/Development/Phase 2.0: Real-time P2P Miniature/P2P-Protocol

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
[[Category:Miniature]]
+
Protocol draft for Miniature-P2P (by Michael Hasselmann)
-
 
+
-
Protocol draft for Miniature-P2P
+
  ================================
  ================================
   
   
-
  We will assume that P1 and P2 have already found each other, use a Miniature
+
  We will assume that P1 and P2 have already found each other and are able to
-
client** and are able to chat ("match nick" in FICS).
+
chat ("match nick" in FICS).
 +
   
   
-
(**) For now. We will want to lift this restriction and offer Miniature/Telepathy-Chess
 
-
plugins for other applications (in the far distant future, that is).
 
-
 
-
 
  A Chat
  A Chat
  ======
  ======
Line 23: Line 18:
  * This command is the *only* one that will work in every situation, without
  * This command is the *only* one that will work in every situation, without
   exception. It does not change the current game state.
   exception. It does not change the current game state.
-
 
+
-
 
+
  B Game mode negotiation
  B Game mode negotiation
  =======================
  =======================
Line 34: Line 29:
   to send/parse this:
   to send/parse this:
   
   
-
   "seek [time inc] [rated|unrated] [white|black|any]"
+
   "seek [time inc] [rated|unrated] [white|black]"
-
+
-
* If the seeker offers "any" colors it means he his indifferent wrt. color choice.
+
-
  Such games the game can be accepted by people who had choosen black, white or
+
-
  any.
+
   
   
  * Examples:
  * Examples:
Line 44: Line 35:
   "seek 5 0 rated white": same as above,
   "seek 5 0 rated white": same as above,
   "seek 2 10 u b":        2 minutes, 10s incr, unrated, seeker wants black
   "seek 2 10 u b":        2 minutes, 10s incr, unrated, seeker wants black
-
  "seek 2 12 r a": 2 minutes, 12s incr, rated, seeker wants black or white
 
-
 
   
   
  * When the other player receives a seek, he can either accept the offer or
  * When the other player receives a seek, he can either accept the offer or
Line 53: Line 42:
   
   
   1 host player (P1) sends seek,
   1 host player (P1) sends seek,
-
     A client player (P2) accepts seek: send "play" 2
+
     A client player (P2) accepts seek: send "play" ? 2
     B P2 ignores seek: P2 can now send a seek
     B P2 ignores seek: P2 can now send a seek
-
       A P1 accepts seek: send "play" 2
+
       A P1 accepts seek: send "play" ? 2
-
       B P1 ignores seek: 1
+
       B P1 ignores seek: ? 1
   2 game starts (http://www.freechess.org/Help/HelpFiles/play.html)
   2 game starts (http://www.freechess.org/Help/HelpFiles/play.html)
   
   
-
* A seek is accepted by sending the same seek back (with the exception of color
 
-
  choosing, where "any" always matches).
 
   
   
-
  >>jukey>>
+
  C Moves
-
There is possible a special situation if you opponent is not using
+
-
Miniature (which not allows the players to choose if they want to start the game
+
-
manually or automaticly) and don't automaticly accept games. See fourth
+
-
paragraph in http://www.freechess.org/Help/HelpFiles/play.html :
+
-
"If the ad calls
+
-
for a manual start, the other user will be notified that you are challenging
+
-
him/her to a match; he/she then can accept or decline your offer to play that
+
-
match."
+
-
In this case the description above changes into:
+
-
  1 host player (P1) sends seek,
+
-
    A client player (P2) accepts seek: send "play" → 2
+
-
    B P2 ignores seek: P2 can now send a seek
+
-
      A P1 accepts seek: send "play" → 2
+
-
      A P2 using manual as seek parameter accepts the offer to play from P1 → 2
+
-
      B P2 using manual as seek parameter declines the offer to play from P1 → 1
+
-
      C P2 using manual as seek parameter accepts the offer to play from P1
+
-
but P1 is no more available (for example in an other game) → 3
+
-
      B P1 ignores seek: → 1
+
-
  2 game starts (http://www.freechess.org/Help/HelpFiles/play.html)
+
-
  3 P1 is shown as not ready to play
+
-
>>mikhas>>
+
-
telepathy has the concept of channels and resources. one channel would be the
+
-
one of available players, and you would probably set your availibility much like in
+
-
normal jabber chats if I understood that part correctly.
+
-
<<mikhas<<
+
-
<<jukey<<
+
-
 
+
-
 
+
-
  C Moves
+
  =======
  =======
   
   
Line 114: Line 72:
  * Move requests that are sent when it is not the player's turn should
  * Move requests that are sent when it is not the player's turn should
   be silently discarded.
   be silently discarded.
-
  >>jukey>>
+
   
-
  Maybe the client also should not be able to send a request if it is
+
   
-
the opponents move.
+
-
>>mikhas>>
+
-
Not really needed, and one should not rely on that because of the inherent raciness.
+
-
It is better to mostly define the protocol from the "what data should I accept in
+
-
which state" point of view.
+
-
<<mikhas<<
+
-
<<jukey<<
+
-
 
+
-
 
+
  D Takeback
  D Takeback
  ==========
  ==========
Line 136: Line 85:
   same n) to accept. Now it doesn't even matter who sends it first.
   same n) to accept. Now it doesn't even matter who sends it first.
   1 P1 sends "takeback n",
   1 P1 sends "takeback n",
-
     A P2 accepts: send "takeback n" 2
+
     A P2 accepts: send "takeback n" ? 2
-
     B P2 declines: nothing happens 3.
+
     B P2 declines: nothing happens ? 3.
   2 N half-moves are taken back.
   2 N half-moves are taken back.
   3 P2 or P1 sends his next move (notice how this can clash with a "takeback n"
   3 P2 or P1 sends his next move (notice how this can clash with a "takeback n"
Line 150: Line 99:
   
   
  * A takeback request can be simply ignored without further actions.
  * A takeback request can be simply ignored without further actions.
-
 
+
-
 
+
  E Draw
  E Draw
  ======
  ======
Line 162: Line 111:
  * Otherwise, same as in takeback, without position sending:
  * Otherwise, same as in takeback, without position sending:
   1 P1 sends "draw",
   1 P1 sends "draw",
-
     A P2 accepts: send "draw" 2
+
     A P2 accepts: send "draw" ? 2
-
     B P2 declines: nothing happens 3.
+
     B P2 declines: nothing happens ? 3.
   2 Game ends in draw.
   2 Game ends in draw.
   3 P1 sends his next move (P2 is not allowed to demand a draw if it is not his
   3 P1 sends his next move (P2 is not allowed to demand a draw if it is not his
     turn, also, same conflict resolution as in takeback: draw confirmation wins
     turn, also, same conflict resolution as in takeback: draw confirmation wins
     over P1's move, and P2 is free to ignore the move).
     over P1's move, and P2 is free to ignore the move).
-
 
+
-
 
+
  F Resign
  F Resign
  ========
  ========
Line 176: Line 125:
  * Players can resign at any time, I guess? No confirmation by other player
  * Players can resign at any time, I guess? No confirmation by other player
   needed, game ends.
   needed, game ends.
-
 
+
-
 
+
  G Adjourn
  G Adjourn
  =========
  =========
Line 187: Line 136:
  * Similar to draw and takeback:
  * Similar to draw and takeback:
   1 P1 ran out of time, unresponsive
   1 P1 ran out of time, unresponsive
-
     A P2 sends "adjourn" 3
+
     A P2 sends "adjourn" ? 3
     (B P2 claims the win, not important yet for our case)
     (B P2 claims the win, not important yet for our case)
   2 P1 sends "adjourn"
   2 P1 sends "adjourn"
-
     A P2 accepts: send "adjourn" 3
+
     A P2 accepts: send "adjourn" ? 3
     B P2 declines: nothing happens
     B P2 declines: nothing happens
   3 Game is adjourned, both sides save the current position locally, game ends.
   3 Game is adjourned, both sides save the current position locally, game ends.
 +
----------
 +
Initial source: https://garage.maemo.org/pipermail/chess-developer/2010-April/000133.html

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)