Are there any existing frameworks I can build on? Should I build my own? How can I prevent fake scores from being posted to it?
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – MAnd, Kromster, Josh
ScoreLoop is available for Android platform.
You can use ScoreNinja too. ScoreNinja offers an easy way to implement global scores but requires to view your score in the ScoreNinja application.
Otherwise Cocos iphone provides a global score with CocosLive. You can use CocosLive.net or use your own GoogleApp Engine VM. CocosLive is not available on Android platform but the protocol is REST with JSON and can easily be ported.
My current solution is CocosLive for Android and iPhone with my own VM but i will use ScoreLoop in my next game for social network integration.
Check out OpenFeint : Getting Started With OpenFeint SDK for Android 1.8 Easy to start !
Do the following:
(1) User gets a score in the game.
(2) Create the string "Username,score,timestamp" or something similar.
(3) Append a salt (secret string) to this string: "username,score,timestamp,SALTSTRING"
(4) Calculate a hash of this string with your favourite algorithm, (MD5, SHA...).
(5) Post "Username,score,timestamp" together with the hash you computed to your site: www.yoursite.com?str=username,score,timestamp&hash=MYHASH or something similar
(6) On your server, redo the calculation, i.e. create "username,score,timestamp,SALTSTRING" and then compare with the hash the user submitted. If no match, then something has been tampered with.
Note, if the user can obtain the class files, then they can be decompiled, and thus the salt can be seen. However, if the user can decompile your program, there is no way to prevent false high scores: the user may modify the code to make the game easier and use that version. You will have no way to check for that.