<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for SteveGibson.com</title>
	<atom:link href="http://www.stevegibson.com/blog/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://www.stevegibson.com/blog</link>
	<description>...front toward enemy...</description>
	<lastBuildDate>Wed, 17 Jun 2009 15:18:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on Jabber/XMPP Game Bot for Z-Machine, MUSH, and more&#8230; by Steve Gibson</title>
		<link>http://www.stevegibson.com/blog/?p=3&#038;cpage=1#comment-12</link>
		<dc:creator>Steve Gibson</dc:creator>
		<pubDate>Wed, 17 Jun 2009 15:18:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=3#comment-12</guid>
		<description>&lt;a href=&quot;#comment-11&quot; rel=&quot;nofollow&quot;&gt;@Zac&lt;/a&gt; 
Zac, generally it occurs within a few seconds.  Contact me via email or xmpp if you&#039;re still having a problem.</description>
		<content:encoded><![CDATA[<p><a href="#comment-11" rel="nofollow">@Zac</a><br />
Zac, generally it occurs within a few seconds.  Contact me via email or xmpp if you&#8217;re still having a problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jabber/XMPP Game Bot for Z-Machine, MUSH, and more&#8230; by Zac</title>
		<link>http://www.stevegibson.com/blog/?p=3&#038;cpage=1#comment-11</link>
		<dc:creator>Zac</dc:creator>
		<pubDate>Tue, 16 Jun 2009 16:43:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=3#comment-11</guid>
		<description>How long does the bridge normally take to accept an invitation? I&#039;m eager to try this out.</description>
		<content:encoded><![CDATA[<p>How long does the bridge normally take to accept an invitation? I&#8217;m eager to try this out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jabber/XMPP Game Bot for Z-Machine, MUSH, and more&#8230; by Steve Gibson</title>
		<link>http://www.stevegibson.com/blog/?p=3&#038;cpage=1#comment-10</link>
		<dc:creator>Steve Gibson</dc:creator>
		<pubDate>Tue, 12 May 2009 15:16:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=3#comment-10</guid>
		<description>Sven,

Thanks.  I&#039;ll give it a go and see if that corrects the problem.</description>
		<content:encoded><![CDATA[<p>Sven,</p>
<p>Thanks.  I&#8217;ll give it a go and see if that corrects the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jabber/XMPP Game Bot for Z-Machine, MUSH, and more&#8230; by Sven N.</title>
		<link>http://www.stevegibson.com/blog/?p=3&#038;cpage=1#comment-9</link>
		<dc:creator>Sven N.</dc:creator>
		<pubDate>Tue, 12 May 2009 13:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=3#comment-9</guid>
		<description>I noticed the out-of-order messages are still there.

I think you should just add a short timeout (like 300msec)  to the select() call and send all data collected in that time period as one message.

In pseudo code:

a. select() on stdout+stderr with a 300ms timeout.
b1. if you read something, append the bytes read to a buffer 
b2. else: (you didn&#039;t read anything i.e. the timeout kicked in), send the buffer data via xmpp and empty the buffer
c. goto a.</description>
		<content:encoded><![CDATA[<p>I noticed the out-of-order messages are still there.</p>
<p>I think you should just add a short timeout (like 300msec)  to the select() call and send all data collected in that time period as one message.</p>
<p>In pseudo code:</p>
<p>a. select() on stdout+stderr with a 300ms timeout.<br />
b1. if you read something, append the bytes read to a buffer<br />
b2. else: (you didn&#8217;t read anything i.e. the timeout kicked in), send the buffer data via xmpp and empty the buffer<br />
c. goto a.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XMPP Bridge release by Bruno Antunes</title>
		<link>http://www.stevegibson.com/blog/?p=37&#038;cpage=1#comment-6</link>
		<dc:creator>Bruno Antunes</dc:creator>
		<pubDate>Tue, 03 Feb 2009 17:29:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=37#comment-6</guid>
		<description>Great, great!! :D

I hope I can contribute with my Z-machine run/stop interpreter soon as well!</description>
		<content:encoded><![CDATA[<p>Great, great!! <img src='http://www.stevegibson.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I hope I can contribute with my Z-machine run/stop interpreter soon as well!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jabber/XMPP Game Bot for Z-Machine, MUSH, and more&#8230; by Steve Gibson</title>
		<link>http://www.stevegibson.com/blog/?p=3&#038;cpage=1#comment-4</link>
		<dc:creator>Steve Gibson</dc:creator>
		<pubDate>Tue, 03 Feb 2009 04:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=3#comment-4</guid>
		<description>Actually, after looking into it a bit further, it looks like that RFC is directed at server implementations. Since the bot is a client, it is only required to send to the base JID. The server is supposed to determine how to route the message.

Still looking at buffering to frotz output...</description>
		<content:encoded><![CDATA[<p>Actually, after looking into it a bit further, it looks like that RFC is directed at server implementations. Since the bot is a client, it is only required to send to the base JID. The server is supposed to determine how to route the message.</p>
<p>Still looking at buffering to frotz output&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jabber/XMPP Game Bot for Z-Machine, MUSH, and more&#8230; by Steve Gibson</title>
		<link>http://www.stevegibson.com/blog/?p=3&#038;cpage=1#comment-3</link>
		<dc:creator>Steve Gibson</dc:creator>
		<pubDate>Tue, 03 Feb 2009 04:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=3#comment-3</guid>
		<description>You&#039;re right about it needing to send to the
JID/resource. I&#039;m not sure how I overlooked that, but I&#039;ll definitely
see about fixing it.

The z-machine bridge buffering may be a bit more tricky (for me) to
figure out. I think the problem will be knowing when the process is
done sending data. Currently I&#039;m using popen3() and a select() call
to grab the data from STDOUT and STDERR as the frotz process spits it
out. Dunno if you are a programmer, but here is what I&#039;m doing:
&lt;pre lang=&quot;Ruby&quot;&gt;
@stdin, @stdout, @stderr = Open3.popen3(&quot;./dfrotz -Z0 -w #{width} -p
zgames/#{zgame}.z5&quot;)
loop do
 result = select([@stdout, @stderr], nil, nil)
 if result != nil
   for data in result[0]
     if data == @stdout
       send_to_user(@stdout.gets)
     elsif data == @stderr
       send_to_user(@stderr.gets)
     end
   end # for
 end
end # loop
&lt;/pre&gt;
I can probably play around with this a bit, maybe use a timeout or
something... but I definitely understand the issue with limited screen
real estate on a Blackberry. I personally use a Blackberry Curve and
the BeeJive IM client. What I do, though, is create a very short
nickname in my roster for the bot (like &quot;xb&quot;) and don&#039;t use timestamps
on each message. The BeeJive IM client even goes one better and
doesn&#039;t prepend the sender&#039;s nickname for consecutive messages. In
addition to the point you raise, the current method has another
problem where occasionally lines in a paragraph will arrive in the
opposite order they were sent. Doing as you suggest and sending the
response from the frotz process as a single message will solve that
problem as well.

Thanks again for the feedback! I&#039;ll take a look at these issues
tomorrow and will likely have an update running very soonish.</description>
		<content:encoded><![CDATA[<p>You&#8217;re right about it needing to send to the<br />
JID/resource. I&#8217;m not sure how I overlooked that, but I&#8217;ll definitely<br />
see about fixing it.</p>
<p>The z-machine bridge buffering may be a bit more tricky (for me) to<br />
figure out. I think the problem will be knowing when the process is<br />
done sending data. Currently I&#8217;m using popen3() and a select() call<br />
to grab the data from STDOUT and STDERR as the frotz process spits it<br />
out. Dunno if you are a programmer, but here is what I&#8217;m doing:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#0066ff; font-weight:bold;">@stdin</span>, <span style="color:#0066ff; font-weight:bold;">@stdout</span>, <span style="color:#0066ff; font-weight:bold;">@stderr</span> = Open3.<span style="color:#9900CC;">popen3</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./dfrotz -Z0 -w #{width} -p
zgames/#{zgame}.z5&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">loop</span> <span style="color:#9966CC; font-weight:bold;">do</span>
 result = <span style="color:#CC0066; font-weight:bold;">select</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>@stdout, <span style="color:#0066ff; font-weight:bold;">@stderr</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
 <span style="color:#9966CC; font-weight:bold;">if</span> result != <span style="color:#0000FF; font-weight:bold;">nil</span>
   <span style="color:#9966CC; font-weight:bold;">for</span> data <span style="color:#9966CC; font-weight:bold;">in</span> result<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
     <span style="color:#9966CC; font-weight:bold;">if</span> data == <span style="color:#0066ff; font-weight:bold;">@stdout</span>
       send_to_user<span style="color:#006600; font-weight:bold;">&#40;</span>@stdout.<span style="color:#CC0066; font-weight:bold;">gets</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     <span style="color:#9966CC; font-weight:bold;">elsif</span> data == <span style="color:#0066ff; font-weight:bold;">@stderr</span>
       send_to_user<span style="color:#006600; font-weight:bold;">&#40;</span>@stderr.<span style="color:#CC0066; font-weight:bold;">gets</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#008000; font-style:italic;"># for</span>
 <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#008000; font-style:italic;"># loop</span></pre></div></div>

<p>I can probably play around with this a bit, maybe use a timeout or<br />
something&#8230; but I definitely understand the issue with limited screen<br />
real estate on a Blackberry. I personally use a Blackberry Curve and<br />
the BeeJive IM client. What I do, though, is create a very short<br />
nickname in my roster for the bot (like &#8220;xb&#8221;) and don&#8217;t use timestamps<br />
on each message. The BeeJive IM client even goes one better and<br />
doesn&#8217;t prepend the sender&#8217;s nickname for consecutive messages. In<br />
addition to the point you raise, the current method has another<br />
problem where occasionally lines in a paragraph will arrive in the<br />
opposite order they were sent. Doing as you suggest and sending the<br />
response from the frotz process as a single message will solve that<br />
problem as well.</p>
<p>Thanks again for the feedback! I&#8217;ll take a look at these issues<br />
tomorrow and will likely have an update running very soonish.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jabber/XMPP Game Bot for Z-Machine, MUSH, and more&#8230; by Ryan Parish</title>
		<link>http://www.stevegibson.com/blog/?p=3&#038;cpage=1#comment-2</link>
		<dc:creator>Ryan Parish</dc:creator>
		<pubDate>Tue, 03 Feb 2009 04:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevegibson.com/blog/?p=3#comment-2</guid>
		<description>A couple of things to look at for google talk compatibility.
1. message replies are sent back to the bare JID rather than the JID + resource, you need to reply to the full JID per http://tools.ietf.org/html/rfc3921#section-11. Since google talk ignores resource priority all replies sent from the bot get received by all logged in resources.

2. Perhaps you should buffer the responses from the z-machine and then send a single message stanza when the z-machine is done sending data, rather than one message per line (I imagine your doing some kind of readline deal). With clients like google talk for blackberry and PSI the users nick or jid is displayed with each message like this...
[22:49:29] ---------- XMPP Bridge commands -----------
[22:49:29] !about : About the Gamebridge.
[22:49:29] !enter : Enter the chat lobby.
[22:49:29] !exit : Exit the chat lobby.
[22:49:29] !frotz : Connect to a z-game. (e.g., !frotz zork1 [scrn_width] )

On a blackberry that&#039;s half the screen real estate used up per line.

Keep up the good work!</description>
		<content:encoded><![CDATA[<p>A couple of things to look at for google talk compatibility.<br />
1. message replies are sent back to the bare JID rather than the JID + resource, you need to reply to the full JID per <a href="http://tools.ietf.org/html/rfc3921#section-11" rel="nofollow">http://tools.ietf.org/html/rfc3921#section-11</a>. Since google talk ignores resource priority all replies sent from the bot get received by all logged in resources.</p>
<p>2. Perhaps you should buffer the responses from the z-machine and then send a single message stanza when the z-machine is done sending data, rather than one message per line (I imagine your doing some kind of readline deal). With clients like google talk for blackberry and PSI the users nick or jid is displayed with each message like this&#8230;<br />
[22:49:29] &#8212;&#8212;&#8212;- XMPP Bridge commands &#8212;&#8212;&#8212;&#8211;<br />
[22:49:29] !about : About the Gamebridge.<br />
[22:49:29] !enter : Enter the chat lobby.<br />
[22:49:29] !exit : Exit the chat lobby.<br />
[22:49:29] !frotz : Connect to a z-game. (e.g., !frotz zork1 [scrn_width] )</p>
<p>On a blackberry that&#8217;s half the screen real estate used up per line.</p>
<p>Keep up the good work!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
