The original server
I wrote the original server for TankWar using Python and the Twisted library. Now, since I had nothing left, I had to reverse-engineer how the server used to work from the client’s code.
It proved to be a bit tricky, but eventually I succeeded
I decided I wanted to write the server as an Opera Unite application, and Opera was conveniently running a competition for Unite apps too.
The latest version of the application uses Bayeux as the protocol. It’s a straightforward JSON-based protocol for Comet, supported by the Dojo Foundation, and with client libraries available for both Dojo and jQuery.
Unite applications also have the ability to keep persistent state, so it was perfect for a game where I needed to keep things together over multiple requests.
I’m planning on doing some more stuff for the game, such as improving the engine itself as it’s a little bit glitchy. Perhaps also improving the graphics, maybe by using bitmap sprites with canvas.
If you want to check out the Unite application’s source code, simply download it from the mentioned site and rename the file to .zip. It should at least serve as a good example on how to use the Bayeux server for writing your own Comet-based Unite apps.