Server and security

General discussion about LÖVE, Lua, game development, puns, and unicorns.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Server and security

Post by bobbyjones »

Yes harder. Which is verification. Verification can not be completely fool proof but its still technically verification. Some games do nothing and just let people submit obviously false scores. For example flappy birds
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: Server and security

Post by I~=Spam »

bobbyjones wrote:Yes harder. Which is verification. Verification can not be completely fool proof but its still technically verification. Some games do nothing and just let people submit obviously false scores. For example flappy birds
That is true hahaha. I still cannot believe just how viral flappy bird went... people can be weird in what they, as a whole, like.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Server and security

Post by Inny »

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?
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Server and security

Post by bobbyjones »

Well I'm sure a checksum would be on server. And the code not made public. But I get the point.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Server and security

Post by Robin »

bobbyjones wrote:Well I'm sure a checksum would be on server.
The whole point of a checksum is that the client sends the checksum. The code to calculate a checksum needs to be on both ends.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Server and security

Post by Jasoco »

I~=Spam wrote:
bobbyjones wrote:Yes harder. Which is verification. Verification can not be completely fool proof but its still technically verification. Some games do nothing and just let people submit obviously false scores. For example flappy birds
That is true hahaha. I still cannot believe just how viral flappy bird went... people can be weird in what they, as a whole, like.
Flappy Bird only got known because of PewDiePie. Without him, it would still be unknown and thrown to the wayside. It's basically like having Oprah promote your product. If the name is big enough and has enough followers, they will become customers of whatever they're told to buy/download. But that's off topic. lol
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: Server and security

Post by I~=Spam »

PewDiePie made it popular? That makes sense now. I actually don't know much about him other than what I have learned from an episode of south park. :crazy: I am such a grandpa. (I hope someone gets that reference...)
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests