First Draft.
It is quite common to play games over IM networks. Since Tic-tac-toe is a well-known and simple game, it's a good example for a server-based game protocol.
This document addresses the requirements for a game protocol as defined by &xep-mug;. In particular this consists of:
The extensions needed to implement these requirements are qualified by the 'http://jabber.org/protocol/mug/tictactoe' namespace.
An entity implementing this protocol MUST also support &xep-mug; and answer to disco requests accordingly including both the Multi-User Gaming and the game &FEATURE; elements in the response.
A Tic-tac-toe game uses two game roles, "x" and "o". Both roles have to be assigned to exactly one player to start a match. If one role gets unassigned or a player gets unavailable the match has to be paused.
A service SHOULD offer a configuration form with the following options:
An implementation MUST be able to handle the a board with three cols and rows and three respective marks to win. Everything beyond that is OPTIONAL.
Submitting a strike option value bigger than the number of rows or columns SHOULD result in ¬acceptable; error.
The state in a Tic-tac-toe match represents the match configuration, the player who makes the next turn and the current state of the board. Every state is distributed to all occupants.
After a valid turn, the state gets updated with the corresponding mark.
The match is considered terminated when the board is full or when one player reaches the number of respective marks as defined by the strike option. After termination the service broadcasts the final state including either a <draw> or <won> (including a game role) element to indicate the resulting score and the initial state of the next round.
During the game, players change in turn, each of them MUST send only one move at a time. It MUST possess these attributes:
Name | Type | Description |
'id' | REQUIRED | The number of the move. First move is 1. |
'row' | REQUIRED | The horizontal position of the mark. |
'col' | REQUIRED | The vertical position of the mark. |
The author is not aware of any security issues introduced by this protocol extension.
This document requires no interaction with &IANA;.
The ®ISTRAR; shall include 'http://jabber.org/protocol/mug/tictactoe' in its registry of protocols.