Forum BigDB How to execute server-side code

Discussion and help relating to the PlayerIO database solution, BigDB.

How to execute server-side code

Postby cjcenizal » March 30th, 2011, 12:16 am

First of all, keep up the great work guys! You're doing a fantastic job with PlayerIO.

I'm making a Farmville-type game, and I would like to validate the user's transactions on the server before committing them. Before using PlayerIO, I was used to using AMFPHP to execute PHP methods for doing this kind of stuff. How do I make calls to custom server-side code from Flash, using PlayerIO?

Under "Working with High Scores" in the BigDB example (http://playerio.com/documentation/bigdb/example), there is a SaveScores() example method, but it isn't shown in the context of a C# file, and there's no example code showing it being called from the client side. Thanks for any help!
cjcenizal
Paid Member
 
Posts: 115
Joined: March 29th, 2011, 12:31 am

Re: How to execute server-side code

Postby Henrik » March 30th, 2011, 10:07 am

You need to use the Multiplayer service, even though your game isn't actually a multiplayer game.

http://playerio.com/documentation/multi ... serverside

So, you need to make a roomtype with your server-side validation code. Basically you need to extend the GotMessage method to handle various requests from the clients by performing the validation and returning a result.

All your game clients then just need to make a single connection to the multiplayer service and send in their validation requests to that. You can use service-rooms so you don't have to worry about room names or whatever, that'll just load-balance your clients into a room that can handle their requests.
Henrik
.IO
 
Posts: 1838
Joined: January 4th, 2010, 1:53 pm

Re: How to execute server-side code

Postby cjcenizal » March 30th, 2011, 4:52 pm

Wow, that's great. Thank you, Henrik! For anyone else who has similar questions, I found these forum topics which have similar lines of discussion:

http://playerio.com/forum/post918?hilit=secure#p918
http://playerio.com/forum/post2212?hilit=secure#p2212
http://playerio.com/forum/post3566?hilit=secure#p3566
http://playerio.com/forum/post482?hilit=secure#p482
cjcenizal
Paid Member
 
Posts: 115
Joined: March 29th, 2011, 12:31 am


Return to BigDB