[JDEV] Add-on support from Jabber protocol
Thomas Charron
tcharron at ductape.net
Wed Aug 1 10:43:05 CDT 2001
Doc looks good. Only a coupla syntax issues I can see here. First,
Browsing. You guys are definatly 'getting it' as far as this is concerned.
Theres only a small isse with the response. The 'get' is correct, but I think
I'd do this a little differently then you did. The 'conversation' would look
more like this:
<iq type='get' to='jid2'>
<user xmlns='jabber:iq:browse'/>
</iq>
<iq type='result' to='jid1' from='jid2'>
<user xmlns='jabber:iq:browse' jid='user at jid2'>
<user jid="user at server/home" type="client" name="Home Desktop"/>
<application jid="user at server/chess" type="i3connectchess" name="Chess"/>
</user>
</iq>
There are actually several ways to do this, but this would be easiest. If
you implemented a generic gaming protocol, for use by multiple games, it could
look like this:
<iq type='get' to='jid2'>
<user xmlns='jabber:iq:browse'/>
</iq>
<iq type='result' to='jid1' from='jid2'>
<user xmlns='jabber:iq:browse' jid='user at jid2'>
<user jid="user at server/home" type="client" name="Home Desktop"/>
<application jid="user at server/chess" type="i3connectgame"
name="ChessMasta"/>
</user>
</iq>
<iq type='get' to='user at server/chess'>
<user xmlns='jabber:iq:browse'/>
</iq>
<iq type='result' to='jid1' from='jid2'>
<application xmlns='jabber:iq:browse' jid="user at server/chess"
type="i3connectgame" name="ChessMasta">
<ns>i3connect:games:chess</ns>
<ns>i3connect:games:checkers</ns>
</application>
</iq>
Make sense? The important thing is to remember to use xmlns to designate
tags outside of the scope of jabber:iq:browse. While we're loose as far as
validation is concerned, it'd be nice to at least TRY to stay within the
rules.. 8-P
Now, as far as data is concerned, IQ isn't *really* the mechanism to do this
with. The <message> tag is. Perhaps use IQ to 'negotiate' a session, but then
use the <thread> tag within a message to handle a logical stream:
<message id='i3Con_1' to='jid1' from='jid2'>
<thread>Game19274</thread>
<x xmlns='i3connect:games:chess>
<move From='D7' To='D5'>
</x>
</message>
Think of Info/Query as an RPC mechanism. You make a call, and get a
response. There is no logical 'stream' beyond the response to a get/set.
Messages, on the other hand, have threads, which logically group messages
together.
You also may want to take into consideration message confirmation. Using the
message and thread tags, you can:
A) Numerically keep track of messages associated with a game, ensuring you
didn't miss anything
B) Provide recipt messages, so ya don't have any 'moves' get lost.
C) Log the logical progression of the game.
By providing valid recipt, you also gain the ability to play with games being
interupted, and provide for a game transport that keeps track of games FOR you,
allowing for non-interactive play, aka, users wouldn't have to BOTH be online..
Anyway, overall, it looks really good, and is a good start to a decent use of
the protocol system. Others onlist may disagree, if so, speak up, I'm not
afraid to be called an idiot.. 8-P
---
Thomas Charron
<< Wanted: One decent sig >>
<< Preferably litle used >>
More information about the JDev
mailing list