oxxxo Posted May 12, 2015 Share Posted May 12, 2015 Hi im planning to add an online leaderboard to my game.. The player does not need to log in the game, they just play and once the game is finish they will be ask for a name and submit that name along with the score to the leaderboard.. I had research some google REST API and some stuff are still quite confusing.. any help is appreciated.. thanks.. Horizonicblue 1 Link to comment Share on other sites More sharing options...
totallybueno Posted May 12, 2015 Share Posted May 12, 2015 I´m trying to do exactly the same, I used clay.io in the past but their service works poorly... not recommended at all. I´ll follow this post to have more options from the experts Link to comment Share on other sites More sharing options...
Nikow Posted May 12, 2015 Share Posted May 12, 2015 Maybe with phaser's local var ?... I never try. Link to comment Share on other sites More sharing options...
oxxxo Posted May 12, 2015 Author Share Posted May 12, 2015 Maybe with phaser's local var ?... I never try.I had already tried, storing it in local browser storage.. but this is not what really I wanted.. I want players to submit there score into some server .. and have there score ranked.. Link to comment Share on other sites More sharing options...
drhayes Posted May 12, 2015 Share Posted May 12, 2015 You could try looking into Parse and Firebase. I've used Firebase before to make a vaguely real-time multiplayer game, it's pretty neat. OTOH, you could set up the server yourself and host it somewhere. Link to comment Share on other sites More sharing options...
spinnerbox Posted May 12, 2015 Share Posted May 12, 2015 This firebase thing seems good. Never tried it. On the other hand you can create a mysql database gear on openshift.com and use as scoreboard. But yes you will need a web server gear to process db requests from/to Link to comment Share on other sites More sharing options...
Nikow Posted May 13, 2015 Share Posted May 13, 2015 I had already tried, storing it in local browser storage.. but this is not what really I wanted.. I want players to submit there score into some server .. and have there score ranked..Okay.. Do you try anything with ajax ? Link to comment Share on other sites More sharing options...
totallybueno Posted May 21, 2015 Share Posted May 21, 2015 So at the end I created my own leadersboard system... pretty basic stuff and that way I can do whaever I want The "only" problem is how to make the services secure and avoid fake scores/cheaters... but hey, I´m working with my own leaderboards Link to comment Share on other sites More sharing options...
spinnerbox Posted May 21, 2015 Share Posted May 21, 2015 - Don't trust the client, validate data when it gets to the server.- Use JS function closure to hide sensitive data.- Validate data as well on the client side. You may encript the data sent to the server with JS.- Minimize the JS code you load in index.html in one js file. You could also obfuscate it, there are softwares for this.- Use immediate anonymous function to close all you JS code in just two brackets "(function () {// my code here }())" In the end I could do all things in JS/Firebug so again it all falls back to server validation. Link to comment Share on other sites More sharing options...
george Posted May 21, 2015 Share Posted May 21, 2015 Forget about making your leaderboard secure. As long as your game is running on a client and not on the server it's just a matter of time until somebody submits a fake score. The most effective things I usual do: Calculate a hash/checksum and make the score a little bit verifiable.1. Calculate a hash for the data package you're submitting. This hash can be recalculated from an experienced attacker who reads your code and finds the secret key and salt. But hey this will prevent all the script kiddies from intercepting and modifying a highscore submission entry.2. Calculate your highscore with a special algorithm, so that you're able to sort out all the fake entries. A far too simple example: Only allow highscore that are divisible by 7. Together with 1.) an attacker would have to do the following steps: Intercept the request, update the highscore with a number that is divisible by 7 and recalculate the hash. You could append other annoying things to make the liste even longer. If all those things are distributed throughout your entire project it's going to be very tedious to submit a modified score. 3. Accept any manipulated highscore but mark it as fake. Now display it only to the attacker. The attacker will believe that he succeeded and maybe stop at this point. Regards George Carlos, totallybueno, jamespierce and 1 other 4 Link to comment Share on other sites More sharing options...
grumpygamer Posted May 21, 2015 Share Posted May 21, 2015 Woo, nifty techniques here!Yep, just some ajax will do. Not sure how you can tell phaser when the request has been successful though. Still I haven't got there yet. Link to comment Share on other sites More sharing options...
spinnerbox Posted May 21, 2015 Share Posted May 21, 2015 You could use JQuery ajax. It has all necessary things from sending request to recieving response from the server. Both JQuery and Phaser are plain JavaScript so it will be just exchange of js object/functions/data/json. http://api.jquery.com/jquery.ajax/ Not sure if there is some integrated support for Ajax in Phaser? https://phaser.io/docs/2.3.0/Phaser.Net.html Link to comment Share on other sites More sharing options...
totallybueno Posted May 22, 2015 Share Posted May 22, 2015 There´s no special suppor in Ajax for Phaser, but you don´t need it at all, it´s just javascript George, I do love de /7 technique, hahaha, I´m gonna use that for sure and you´ll be in a comment line, so check my code and say hi Link to comment Share on other sites More sharing options...
Recommended Posts