Proposal
Things will be delightfully slow at work this week, so I’m definitely planning to revive this my favorite therapeutic dialogue between myself and a blank page.
It’s totally off-task in terms of getting the project to a concrete waypoint in its progression, but while combat trucks along I have thought a lot about the potential to make Sigma compatible with iPhone/smartphone usage.
Maybe not for the overall health of HTTP’s design, but for selfish reasons it’s a bit of a shame that it’s still very hard to push arbitrary data to a webpage. It’s very easy to get data from a browser, but sending information without prior announcement looks pretty hackish.
Of course, any kind of “chat” (a MUD is essentially a very, very advanced form of chat server) will require live sending and receiving, and receiving doesn’t always immediately follow a send. Meaning if somebody else walks into a room, the client must receive the information in order to announce it, but there was no warning anything would happen since the user did not initiate that action.
You can do this without Flash, but it’s one of those things that you can’t really assume will work in all cases. Google apparently uses something like this to achieve Google Talk within the Gmail interface. It works, but it’s not smooth to implement.
There is a Flash object called XMLSocket that enables two-way socket communication within a webpage, with the only penalty seeming to be the vice of using Flash at all. Well, that and you have to implement a non-HTTP socket server (which doesn’t seem that bad when you already have a MUD server going).
With that and a little glue you pretty much have two-way communication, so you can update the output window with server events and send input back to the server.
On the Sigma side, implementation is a cinch due to our nice forward-looking object oriented structure. A new socket type and protocol just means a new Player class. Any input from the client is captured as normal (in a different control loop) and just injected into the command queue like anything else.
You don’t even need Adobe to compile ActionScript to an SWF, and jQuery has a plugin that optimizes web effects for the iPhone (if necessary). Implementing via web rather than a native App makes you portable and removes the App Store from the equation outright.
It’s tempting to give it a try.