21

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

kasuku
  • 371
  • 3
  • 13

2 Answers2

9

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
  • 6,520
  • 7
  • 33
  • 44
  • 6
    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 Jan 24 '10 at 02:44
  • 2
    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 Jan 24 '10 at 05:11
  • 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 Jan 25 '10 at 11:32
  • 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 Jan 25 '10 at 11:43
  • @dar it's almost 6 years. Does gae acts as full xmpp server now? – Avinash Raj Jul 14 '16 at 13:58
3

Might be worthwhile spending 15 mins to look at Amazon's Elastic Compute Cloud (EC2) You can deploy a cloud server for about 2 cents an hour. Here's a good overview http://www.youtube.com/watch?v=ZAB8wCg9MyE&feature=player_embedded

johndpope
  • 5,035
  • 2
  • 41
  • 43