game in XMPP?

I've been designing a multiplayer game to run via HTTP, and I think I have decided to use BOSH + XMPP to pull off the game's communication, but I'm having a bit of trouble figuring out how it should work.

The game would basically provide a list of game rooms. Each game room would have a fairly small number of possible players in it (10). The game is turn based with each turn having a time limit. Players may enter / leave the game at will.

I need to maintain a game state between messages and clients for a game room. When I looked at the ejabberd modules, it did not appear that they would be able to maintain that memory unless I used database tables. I would prefer to stay away from database use for game state since the actions taken in all games over time would be pretty useless information to persist and the added disk accesses to store and retrieve that information would be unnecessary.

I am not sure how I should share and maintain the game state between multiple requests or multiple clients. Normally, with a C/C++ server, I would just maintain some memory containing the gamestate for each game room run by the server which would stay around as long as the game room is running, but no longer than that so that it wouldn't incur too many disk accesses or clutter a database.

This may be trivial, but I couldn't find any examples for that kind of usage in my searches. It seems like it must be possible since Chesspark runs their chess game server on similar technology, and it seems like they wouldn't store the chessboard state and every move in a database.

Any suggestions?

Thanks

As this is a general question

As this is a general question about XMPP/Jabber, maybe you better ask in the JDev mailing list, for example. See: XMPP Discussion

Syndicate content