[Standards] ProtoXEP: Game Support

Richard Dobson richard at dobson-i.net
Sat Jan 12 13:40:54 CST 2008


Some notes to slightly enhance the protocol, rather than doing the 
following:

<message
     from='romeo at montague.net/garden'
     to='juliet at capulet.com/balcony'>
 
<thread>romeo at montague.net-juliet@capulet.com-checkers-1591-02-21T12:56:15Z-1234</thread>
   <body>You have been invited to a game of Checkers by 
romeo at montague.net.</body>
   <x xmlns='http://jabber.org/protocol/games'>
     <invite
         transport='one-to-one'
         type='new'>
       <reason>
         Hello Juliet,
         would you like to play a little game?
       </reason>
     </invite>
     <game var='http://jabber.org/protocol/games/checkers'/>
   </x>
</message>

I would simplify it as the following:

<message
     from='romeo at montague.net/garden'
     to='juliet at capulet.com/balcony'>
 
<thread>romeo at montague.net-juliet@capulet.com-checkers-1591-02-21T12:56:15Z-1234</thread>
   <body>You have been invited to a game of Checkers by 
romeo at montague.net.</body>
   <invite xmlns='http://jabber.org/protocol/games'
     transport='one-to-one' type='new'>
     <reason>
       Hello Juliet,
       would you like to play a little game?
     </reason>
     <game var='http://jabber.org/protocol/games/checkers'/>
   </invite>
</message>

There is no need for the top level x element, that is only a historical 
remnant that a few specs use, also regarding the invite it makes more 
sense for the game element to be inside the invite rather than outside 
it, I would also update all the other actions too so they dont use the x 
element either.

Also I would adjust the move action from:

<message
     from='juliet at capulet.com/balcony'
     to='romeo at montague.net/garden'
     type='chat'>
 
<thread>juliet at capulet.com-romeo@montague.net-checkers-1591-02-23T11:36:25Z-4321</thread>
   <body>What do you say to this?</body>
   <x xmlns='http://jabber.org/protocol/games'>
     <move xmlns='http://jabber.org/protocol/games/tictactoe'
         id='1'
         row='2'
         col='2'/>
   </x>
</message>

To be slightly more generic into a turn action that encapsulates the 
move i.e.:

<message
     from='juliet at capulet.com/balcony'
     to='romeo at montague.net/garden'
     type='chat'>
 
<thread>juliet at capulet.com-romeo@montague.net-checkers-1591-02-23T11:36:25Z-4321</thread>
   <body>What do you say to this?</body>
   <turn xmlns='http://jabber.org/protocol/games'>
     <move xmlns='http://jabber.org/protocol/games/tictactoe'
         id='1'
         row='2'
         col='2'/>
   </turn>
</message>

Hope this helps.

Richard




More information about the Standards mailing list