GAMEEND Message
This message may be send by the Initiator as well as by the
Follower to request termination of the game. This message may
initially only be sent by the program that has to move first (so
a GAMEEND may initially only be sent by a program if it is it's
turn, so actually GAMEEND is sent instead of a MOVE message. If a
program wants to terminate the game, but it is not it's turn, it
has to wait until it is it's turn).
GAMEEND is sent by the other program (on receipt of the initial
GAMEEND message) to acknowledge the termination request. It has
no choice, the game will always be terminated.
A reason to end the game is for example because the thinking time from the GAMEREQ message is exceeded, or because the number of moves from the GAMEREQ message is exceeded. Or any other reason you can think of.
Layout
1 byte | 1 byte | 1 byte |
header | reason | stop code |
header | message type, always 'E' (upper case) |
reason | '0' if the Draughts computer program wants to terminate the game without wanting or being able to give a reason for it (always allowed). Optionally the following codes may be used in the initial GAMEEND message (for informational purposes only): `1' (I give up), `2' (draw, for example the same position on board for the third time), '3' (I win) |
stop code | '0' if the current game is to be terminated, but the program is willing to play a next game; `1' if the program wants to stop entirely, and does not want to play a next game. |
Example
0----0----1----1----2----2----3----3----4----4----5----5----6----6
0----5----0----5----0----5----0----5----0----5----0----5----0----5
E00
The program wants to terminate the current game, but is willing to play a next game.
Processing on receipt of a GAMEEND message
On receipt instead of a MOVE message:
- If the Follower receives this message with stop code `0', the Follower terminates the current game, it may save the played game to disk, and sends a GAMEEND message to acknowledge the termination request. If the Follower wants to stop entirely with playing games, it sends the GAMEEND message with stop code 1, otherwise with stop code 0. In the latter case the Follower starts waiting for a GAMEREQ message.
- If the Follower receives this message with stop code `1', the Follower terminates the current game, it may save the played game to disk, and sends a GAMEEND message to acknowledge the termination request with a stop code 1. After this the Follower stops processing DamExchange messages and may terminate itself.
- If the Initiator receives this message with stop code `0', the Initiator terminates the current game, it may save the played game to disk, and sends a GAMEEND message to acknowledge the termination request. If the Initiator wants to stop entirely with playing games, it sends the GAMEEND message with stop code 1, otherwise with stop code 0. In the latter case the Initiator starts a new game by sending a GAMEREQ message.
- If the Initiator receives this message with stop code `1', The Initiator terminates the current game, it may save the played game to disk, and sends a GAMEEND message to acknowledge the termination request with a stop code 1. After this the Initiator stops processing DamExchange messages and may terminate itself.
On receipt as acknowledge on a self-sent GAMEEND message (reason is always '0'):
- If the Follower receives this message with stop code `0', the Follower starts waiting for a GAMEREQ message.
- If the Follower receives this message with stop code `1', the Follower stops processing DamExchange messages and may terminate itself.
- If the Initiator receives this message with stop code `0', the Initiator starts a new game by sending a GAMEREQ message.
- If the Initiator receives this message with stop code `1', the Initiator stops processing DamExchange messages and may terminate itself.