Pascal Bourque wrote:
Hello,

I am planning the architecture of a multi-player game that will be based on XMPP.

In the game, there is a concept of game rooms which will be represented by MUC chat rooms. Each room will be joined by an arbiter bot who will manage the game being held in that room. XMPP messages exchanged in a room will be game commands never seen by the end-users, so it will effectively be a conversation between the game clients and the arbiter bot.

There will be an external component responsible for managing the game rooms. It will monitor the number of players currently logged into the XMPP server and create or delete game (MUC) rooms as needed.

On the game UI side, we have a "lobby" where players can see which rooms are currently available, as well as the count of players in each room and the state of the room (waiting for more players, game in progress, etc). In the lobby, we want the UI to refresh in real-time so that it always shows the current stats of each game room. If game rooms are created, they should appear immediately in the lobby. As other players join a room, the player count for that room should be updated in the UI.

When the lobby is initially displayed, I can do a disco IQ to the MUC service to retrieve the list of game rooms and their attributes, but that info is static. If 2 more rooms appear 3 seconds after the initial disco, they won't appear in the lobby. I could do polling by issuing a disco IQ every few seconds, but that wouldn't quite fit in the XMPP spirit, would it? :)

So in other words, I need to monitor the state of the MUC rooms (number of rooms as well as each room's attributes) in a PubSub-like manner.


There are other situations where this would be useful. Basically for any service which is dynamic, it would be useful to have this ability

I just had a little chat with Peter Saint-Andre about this, and he mentionned that there had recently been some discussion about defining a "disco#meta" protocol to replace the use of service discovery extensions (XEP-0128) for things like this. He said that this was something that would/could be discussed at the XMPP summit next week.

I actually think a feature listed in the when you disco#info the service would list a pubsub type feature which you would then subscribe too.


Tory Patnoe

Reply via email to