In the example of Flappy Bird, yes, you can do some reasonable script-kiddy protection. For instance, lets say there's 3.2 seconds between obstacles. Now, lets say the user wants to submit a score of 7. Their time should be between 22.4 and 25.6. Now, lets do some checksuming just to make sure they didn't fake that.
Code: Select all
flappy_checksum = function(time, score) return math.floor(time * 47) + (score * 23) end
Alright, score of 7, time of 23.8, let's run those numbers. 1279. Lets submit that.
Code: Select all
{ score=7, time=23.8, checksum=1279 }
At the server, you double check that checksum.
Code: Select all
if checksum(player.time, player.score) == player.checksum and
player.time > player.score * 3.2 and
player.time < (player.score+1) * 3.2 and
then
accept_score(player)
end
Hooray. Dumb kiddies that are trying to screw with your server using curl will be stumped. I, however, will google "Love2d flappy birds clone server and security", and get this thread where the flappy_checksum function is listed in this post, where I'll find the math to generate your checksums. Or I'll unzip the flappy_birds_clone.love file and just visually inspect the lua files. And if you've compiled them, I can use the lua tools to load that module, print the functions in it, and run the checksum function directly.
So, ask yourself, at what level do you want to bring this fight? There's a point where instead of just checksuming, you're simulating the whole game at the server to check for illegal moves. If you're going to make the next DOTA or LOL or what have you, then yeah, this is probably necessary. Is it needed for a flappy birds clone?