The Daily Click ::. Forums ::. Non-Klik Coding Help ::. MYSQL and Scoring
 

Post Reply  Post Oekaki 
 

Posted By Message

Cybermaze



Registered
  03/04/2003
Points
  853
10th October, 2004 at 17:47:27 -

It is true javascript can be used for a lot of stuff. However its power is in client side effects.

If you made some kind of algorithm in javascript anyone could see it by looking at the source file (and then youre not come any further).

A simple way that makes it more difficult to cheat with a highscore table is to submit extra control data like:

www.mysite.com/highscore.php?name=me&score=1289&id=1875&control=4353458657567

Then you would of course make sure the highscore is only accepted if the control data is submitted and valid. Please note the numbers I wrote in the above URL are purely fictional.

In your MMF application you calculate id and control by an algorithm, say:

id is a random number between 1000 and 9999 (you know how to in MMF)

control = (score * id) + (score * 5422) - (id * 1365)

or something like that. this is merely a suggestion.

Then in your highscore.php you calculate back again and if the calculation equals the control number submitted the highscore is real or someone found out to break your algorithm.

The more complex the algorithm is, the harder it is to break. Please note that small calculations will have the least impact on the algorithm and thus add least to the complexity. Like if score and id are number like 1256 and 6980 and the algorithm is: (score * id) + 65 the constant (+65) will not have a big impact on the algorithm and thus make the algorithm appear more linear than: (score * id) * 65. The more nonlinear the algorithm seems the harder it is to breake unless you know what you are doing. Also be careful about dividing as dividing may give decimal numbers and if you do not handle that the same way in MMF and php you may get different results (I dont remember but I believe both MMF and php by default throws away the decimal part, but be careful you do not round of one of the places).

Obviously it is possible break the algorithm but the person will require a number of results (score, id and control) to calculate back and most likely no one bothers to do that unless they really can gain something (like money) which is rarely the case with click games.

Image Edited by the Author.

 
If you knew, I would have to kill you...

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
23rd October, 2004 at 10:14:50 -

Great! Page not found! Of course not!
Why did you make it a link anyway?

Image Edited by the Author.

 
Old member (~2004-2007).

Cybermaze



Registered
  03/04/2003
Points
  853
3rd November, 2004 at 12:51:50 -

uhh ... if it is not a link it would not be a realistic example would it? when you write a link tdc automatically turns it into a clickable link.

Informational message: Use of brain when reading forums is advised.

 
If you knew, I would have to kill you...

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
18th November, 2004 at 01:57:36 -

Brain? What good is that?

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
   

Post Reply



 



Advertisement

Worth A Click