3

I'm currently developing a turn by turn multi player game for a proof of concept. What I want is that a player from a WP7 can play against a PC player. I'm using the push notification to contact the phone, that's ok for this part.

But I'm hitting a wall when I want to contact the PC. I wanted to use the same approach, but the Push Notification Server Side Library is using the Windows.Phone DLL, which is unavailable on PC-XNA.

Any ideas of how I should proceed or suggestions?

Thanks for your time.

esylvestre
  • 1,850
  • 4
  • 21
  • 30

4 Answers4

2

The Push Notification Service is intended for communication between a server and a Windows Phone 7 device, which is why there is no assembly available for you to use it from a desktop PC application. In order to add support for Phone to PC multiplayer gaming you will need to run your own server to handle the communications that both devices can contact and communicate through.

Derek Lakin
  • 16,179
  • 36
  • 51
  • May I ask you what are you recommending for the communication between client/server in XNA for a PC. I'll do my research, but if you have experience with this technologie, it would be appreciated. Thanks. – esylvestre Feb 07 '11 at 15:16
  • I don't have any experience in this area and the solution depends entirely on your requirements. I'd suggest that you probably want to keep the amount of data being communicated as low as possible, so perhaps a messaging system based on JSON would do the trick. – Derek Lakin Feb 07 '11 at 17:44
1

One thing you could look at is using Growl for Windows:
http://www.growlforwindows.com/gfw/developers.aspx

There's a C# API to respond to notifications, which you can think of as being similar to the push notifications on the phone. The server can then decide which notification system to use based on what kind of client it is. So using the native push notification if it's a phone, or using growl if windows (or mac if you end up making a mac client as well using something like monomac ;-) ). I've never used it myself, but it seems like the ideal solution.

Joel Martinez
  • 46,929
  • 26
  • 130
  • 185
0

I would follow this How-To to get push notifications working from server --> phone. That should not be all that difficult, and it sounds like you may already have that working.

What you need to do is setup a polling mechanism on the PC game in order to update the state. You could simulate push style notifications with some type of long-polling, since you're using .NET/XNA I presume you'd also be using WCF.

A combination of these two approaches should get all of your clients talking to the server, and the server correctly dishing out responses, either pushing them to WP7 and/or long-poll responses to the PC.

Community
  • 1
  • 1
Nate
  • 30,286
  • 23
  • 113
  • 184
  • Thanks for the tips. I followed this article http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/01/14/windows-push-notification-server-side-helper-library.aspx for the Push Notifications. – esylvestre Feb 07 '11 at 21:32
  • That looks good too. Check out the link on long-polling for the desktop version of your game. – Nate Feb 07 '11 at 22:15
0

If you are ok with targeting only Win8; Win8 will support push notification service very much like the phone. This is a tutorial I've found: http://blog.jayway.com/2011/10/12/implementing-windows-8-push-notifications-an-example/

Unknown1987
  • 1,671
  • 13
  • 30