At first, sharing your session state between your Node.js HTTP server and websockets server might seem difficult. However, if you're using Express and NowJS (or the technologies they're built on, Connect and Socket.IO, respectively), most of the work has already been done for you -- it's just a matter of connecting the right pieces together. An example follows, written in Coffeescript.
Finally, here it is: HydrateJS.
For some of the technical challenges, see my previous post.
Let me know what you think in the comments, and if you're using it, feature requests, etc.
Note: RSS subscribers, I've (finally) enabled summary-only feed entries, so you will have to click through to see the full post.
It seems to me that many approach the use of MVC in games with skepticism, but the more I develop a game in MVC, the more I am reassured in my decision to do so. I operate by the principle that models should absolutely not know about their view(s) (or controllers) -- models should be completely standalone chunks of state and logic that can only reference other models. However, this can present us with a few problems.
Or, to rephrase the question, "I know how to add event handlers to an object -- how do I enumerate what's already been attached?"
And it's pretty easy, but unfortunately it doesn't use a public API. Anyway, try this in Firebug:
If there are any events on that element, they'll be displayed. The only drawback is...you have to know exactly which element the events are attached to, or guess around a bit.
So I like jQuery. And I like Greasemonkey. I especially like the ability of Greasemonkey's ajax calls to go cross-domain. But how do I get access to this functionality in my event handlers? Calling GM_xmlhttprequest in a method that doesn't execute while the Greasemonkey sandbox is still alive doesn't work. At first I didn't think it was possible, but I discovered a way...using setInterval.
Note...this site is down for now...
You don't have to understand it to see that it's at least a bit interesting, so check it out:
It documents a bunch of different ways of doing similar things, and compares them in terms of performance. How much are you really losing by using the jQuery convenience method?
TODO: bring animations to charts in the Google Visualization API via jQuery to illustrate performance described in previous post.