views:

674

answers:

2

Hi,

I'm thinking of building a multi-player game using GAE. When player A makes a move, I'd like to record the details and then let player B know about the move.

I thought that I might get some open-source XMPP library in my client and notify presence to my app if that is possible? I wouldn't want to force the player to sign-up to a service like google talk, so I'll generate jid's on the fly based on session id.

Would like to hear from you!

Thanks

+3  A: 

You are not going to be able to make your gae app an xmpp server because you cannot open sockets - doing so is restricted by the api.

However, you don't need to run an xmpp server to achieve what you want to do. You can use the XMPP libraries available in the appengine api to make your app a client that your game 'clients' talk to see the python api here: http://code.google.com/appengine/docs/python/xmpp/. Not all your game clients need to be gtalk clients, but they will need to be able to bridge into gtalk, which I believe most will be able to.

There is a short example here: http://code.google.com/appengine/articles/using_xmpp.html

dar
The example assumes your user already has a xmpp client and id. I think the OP wants this to work without that assumption - the game itself would be the client, and would generate anonymous ids. Would that scenario also work?
Peter Recore
The short answer is either No, or Yes but he will need to run his own xmpp server outside of GAE to create these anonymous xmpp ids since the GAE client cannot create new ids. If you choose to create the anonymous xmpp ids you're probably doing so because you have a custom client and are tunneling your game protocol through xmpp, right? If the idea is to use GAE to power the xmpp server that's not going to work because of the no-socket rule. But you could use an external xmpp server and use GAE to do the turn engine.
dar
I thought the GAE API may have supported XMPP server commands because the documentation indicates that the GAE is can be [appid]@appspot.com or [anything]@[app-id].appspotchat.com. But after finally getting my head round the workings of XMPP I see that the GAE is only a client. Otherwise, yes XMPP was supposed to be a tunnel just to get round the limitation of having no sockets on GAE. I needed a method to notify my player instantly without polling.
kasuku
At first I asked why is GAE supporting XMPP messaging when it is capable of sending and receving emails (which has much farther reach).Now I see the benefits of XMPP. If it does get a huge user base, I look forward building asynchronous messaging implementations. But if GAE somehow enable sockets, I know what I'll be using.
kasuku
A: 

I am trying to do the same thing. Right now, for testing, I am using an XMPP account that belongs to a third party. ... What do you mean by "Anonymous ID" ? Is there a way to connect to the GAE XMPP client without a 3rd party server?

batpic
I'm still a novice on XMPP but I think some servers (like ejabberd) support connections from anonymous clients. i.e. anyone can connect without a passwordYou can send a message to your GAE server app and it can send messages back to any jabber server ..... and that's about it
kasuku