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

Post Reply  Post Oekaki 
 

Posted By Message

Pabloa



Registered
  29/09/2004
Points
  70
30th September, 2004 at 20:48:46 -

I know someone may have posted this in the past (But me like you, who could be bothered searching for it). But does anyone know how to make TGF/MMF write and read MYSQL entries for scoring?


 
n/a

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
30th September, 2004 at 20:52:44 -

MMF has a Database object that can connect to any database if you have a driver for. However if it's an EXE you are creating I would be more inclined to use an Access database which can be utilised the same way.

~Mike ¿

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert

Pabloa



Registered
  29/09/2004
Points
  70
30th September, 2004 at 21:04:03 -

Great! Thanks

Image Edited by the Author.

 
n/a

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
1st October, 2004 at 04:22:17 -

it can easily be achived with php and mysql. The problem lies in encryption. Afaik, php can use something called MD5 encryption, and i'm not sure that's achievable in MMF.
In mmf i would open a browser doing something like this:

http://www.kitty.com/gamescore.php?name=whatever&score=87234987
- then grab these variables in the gamescore.php file and put it in the database, and display the score list.

The problem, as you can see, is that any user could easily edit this url and give himself a much higher score.

I dunno if you could use algorythms. Maybe convert the score to hex, and use the average of the score as a checksum or something.

 
n/a

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
1st October, 2004 at 05:43:28 -

MD5 encryption is only one way. i.e. one encrypted, it's impossible to get it back to its original form. you could write your own algorithm for encryption - make it as complicated as you want, do it in MMF, then have your PHP script decrypt it.

a simple example would be

score = (score + 5) * 27

in MMF, then in PHP do:

score = (score / 27) - 5

obviously that'd be easy to crack, so you'd have to make it more complicated, but that's the basic idea.

 
www.thenatflap.co.uk

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
1st October, 2004 at 06:09:02 -

yeah, that's what i've been thinking i had to do. Also, if there was a way to convert numbers to the octal system, and back again it would be great. The reason for this is that hex is becoming somewhat known so it might be decodable. Hmm, come to think of it, hex ranges from 1 to F (16 numbers), and the octal system must obviously have to be a system with 8 numbers. Maybe they could interact somehow ?

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
1st October, 2004 at 21:46:53 -

I've always found that ordering drinks for girls in the form of an SQL query results in a guaranteed score.

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
2nd October, 2004 at 15:59:10 -

"Hey baby, there must be something wrong with my database, because your number isn't in it"

 
n/a

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
3rd October, 2004 at 10:03:20 -

"SELECT drink_name FROM bar WHERE drink_name='Bacardi Breezer' AND spiked='true'"

btw that line's a guaranteed shag for you, chris.

 
www.thenatflap.co.uk

醤油の兵士

Almost Human

Registered
  12/06/2002
Points
  173

VIP Member
4th October, 2004 at 18:21:10 -

try base 36 no one would ever guess that, then you need to byte shift it by 128, then after that bytemod it by 128, then Add your credit card number to it, then let me test the engine...ok, so I'm kidding about the credit card number part, but that should encrypt it pretty well. If you don't know what bytemod is, it's an encryption engine I invented myself, it's byte shift by CharNo % Key, I bet I could even make one in JavaScript!

HAR HAR HAR! I OWN STOCKS IN JAVASCRIPT!

Javascript is really a lot more powerful than people give it credit for...people are always using it for rollovers and stuff, don't they see it can be used for much more than just that? JavaScript can even create dynamic web pages. Just use the search and hash section of the location. Get them thorugh location.search and location.hash. The URLs are formatted like this: http://www.blahblahblah.com/blah.html?Search#Hash. when you retrieve the hash and search part though, you'll get the ? and # with it too, just a matter of a few simple parsing techniques...now how'd I get off on this irrelevant tangent?

 
As a boy, I wanted to be a train. I didn’t realize this was unusual—that other kids played with trains, not as them.

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
5th October, 2004 at 03:34:14 -

RAndomness indeed...also, succumb to the power of PHP b*tch (kidding)...

you guys could try looking here:
http://eviscerator.users.whitehat.dk/index.php?page=score.php

i'm not sure this method is good, but you can see my theory in action.

 
n/a

Batchman



Registered
  08/08/2003
Points
  231
5th October, 2004 at 14:57:50 -

there is no standart for javascript yet, so i may not work depending on your browser...
prefer avoid it

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
5th October, 2004 at 15:05:47 -

i wrote a tutorial over at Klik Academy (PHP/MMF though). http://klikacademy.com/viewarticle.php?id=12

 
My signature is never too big!!!

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
5th October, 2004 at 17:27:31 -

Joe, I used your article, its good

 
n/a

醤油の兵士

Almost Human

Registered
  12/06/2002
Points
  173

VIP Member
5th October, 2004 at 17:40:46 -

well, not everyone has php support on their servers FTP could always work...then you have the problem of hacking the passwords though...:S can't win with everything


Back on my irrelavent tangents

http://www.themovie2010.tk is a good example of javascript.

quick code snippets:
http://themovie.sitesled.com/navi.js - The navigation bar
http://themovie.sitesled.com/staff.html - links to profiles
http://themovie.sitesled.com/staff1.html?Chris - my profile page
http://themovie.sitesled.com/staff1.html?Danny - My friends profile
http://themovie.sitesled.com/news.js - my news function
http://themovie.sitesled.com/Chris/bio.js - nice profile methods

 
As a boy, I wanted to be a train. I didn’t realize this was unusual—that other kids played with trains, not as them.

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