mario
|
intro
|
protocol
|
ai
|
book
|
play
Mario's Internet Chess Protocol
client to server
chat
function
say something to your opponent
children
text node with content of message
examples
"<chat>you're going down</chat>"
draw
function
offer a draw
examples
"<draw/>"
forfeit
function
forfeit match
examples
"<forfeit/>"
list
function
request list of current seeks
examples
"<list/>"
move
function
play a move
attributes
from
'a1','a2',etc
to
'a1','a2',etc
promotion (optional)
'Q','R','B','N'
gameover (optional)
'checkmate','stalemate','50-move rule','repetition','check' ('check' is sent every move by a client that cannot check the position for itself)
examples
"<move from='e2' to='e4'/>"
"<move from='g7' to='h8' promotion='Q'/>"
"<move from='f3' to='f7' gameover='checkmate'/>"
received
function
if the server has latency compensation enabled, the client is required to respond to each 'move' frame with a 'received' frame
examples
"<received/>"
seek
function
look for a new game
attributes
name
name of seeker
initial
start time in seconds
increment
time increment in seconds
variant
chess variant (optional. default: "standard")
examples
"<seek name='fred' initial='300' increment='2' variant='960'/>"
timeout
function
signal that your opponent has timed out
examples
"<timeout/>"
server to client
chat
function
relay a message from player A to player B
attributes
name
identity of sender
children
text node with content of message
examples
"<chat name='lego'>you're going down</chat>"
confirm
function
confirm and validate latest move submission
examples
"<confirm/>"
draw
function
notify player A of player B's draw offer
examples
"<draw/>"
game
function
announce a new game
attributes
color
'white','black'
initial
start time in seconds
increment
time increment in seconds
lineup
piece lineup for chess 960 (optional)
timelock
'1' or '0' - indicates whether the server has latency compensation enabled
examples
"<game color='white' initial='120' increment='15' lineup='QRBKNRNB' timelock='1'/>"
gameover
function
when a player claims gameover, the server must verify before sending a gameover frame to both players
attributes
outcome
'1-0','0-1','1/2-1/2'
reason
'agreement','stalemate','50-move rule','repetition','timeout','forfeit','checkmate'
examples
"<gameover outcome='1-0' reason='forfeit'/>"
list
function
provide list of current seeks (in response to list frame from client)
children
seek
attributes
name
identity of seeker
initial
start time in seconds
increment
time increment in seconds
examples
"<list><seek initial='600' increment='0' name='marbot:f3openings'/><seek initial='300' increment='2' name='susan'/></list>"
move
function
notify player A of player B's move
attributes
from
'a1','a2',etc
to
'a1','a2',etc
promotion (optional)
'Q','R','B','N'
examples
"<move from='e2' to='e4'/>"
"<move from='g7' to='h8' promotion='Q'/>"
notice
function
send text to client
children
text node with content of notice
examples
"<notice>invalid move</notice>"
"<notice>not your move</notice>"
"<notice>unknown command</notice>"
"<notice>finding game...</notice>"
"<notice>no current game</notice>"
time
function
sync client clocks with server clock
attributes
white
time in seconds
black
time in seconds
examples
"<time white='304.78330946' black='301.884140968'/>"