Chapter 10. Using a High Score List


Administration of the High Score Lists

The List in Action

Points to Remember

A high score list also called a leader board displays a list of the best scores for a game. The term "high score list" is somewhat of a misnomer, because the list actually displays the best scores, which are not always the highest scores. A good example is golf, in which the lowest score is the best score.

In this chapter you will learn how to add a high score list to a game, as well as how to configure and administer it. We provide you with all of the files you need to get a high score list working in a game. However, you will need a Windows server to use it successfully. Your Flash game saves your score by contacting a server-side script and sending it information (which, in this case, it stores in the database). Our high score list uses ASP pages as the server-side scripts and a Microsoft Access database to store the information. And in case I haven't made this point clear already ASP pages need a Windows server to be interpreted correctly.

Encryption

As you may know, I co-own a popular Flash game site called Electrotank. More than 2 million people play our games every month. When you run a site with that many people playing your games, you are bound to get some people who will try to figure out a way to cheat the high score list. Using some unethical tools, they can look at the ActionScript in the game and find the URL to which the game points when submitting a high score. From this information they can easily create something that will submit fake scores to the score list. The score list, of course, doesn't know the difference between the faked scores and the real scores. This leads to a really annoying problem: cheaters. If there is a way for people to cheat, they will eventually find it. This is not as rare as you may think it is. (For example, the score lists got tampered with on another [Flash 4] game site I used to own as well.) Since this problem isn't going away, you just need to take a few extra steps to make cheating more difficult.

With the files included for this book, we've increased the high score list security a little bit: We have enabled encryption. It is definitely not foolproof in all likelihood this system will get hacked, too but it will make the hackers' job much harder, so it will be hacked by a smaller number of people. We encrypt everything in Flash before sending it to the server. When the server receives the information, it then decrypts it and uses it. Good encryption algorithms require a key to encrypt or decrypt. We have an encryption function and pass in a key, which can be any string we choose, such as "thisIsTheKey," and the string that we want encrypted. The function returns encrypted information, which is unique to the key, and you can then send that to the server. In order to decrypt the information, the server needs the same key you used to encrypt it in the first place.

You may be thinking, "That sounds like pretty tight security; why can it still be hacked?" Well, we are storing both the encryption algorithm and the key in the game file. That is a security issue, but there isn't much we can do about that. After you understand everything in this chapter, you can take these files and try to increase the security yourself a little more. One thing you can do is load in the key from a separate file, and maybe even load in the encryption function through another SWF file. This is still not hack-proof, but every step you take is one more that a hacker will also have to go through. You want to make it not worth the hacker's while.



Macromedia Flash MX Game Design Demystified(c) The Official Guide to Creating Games with Flash
Macromedia Flash MX Game Design Demystified: The Official Guide to Creating Games with Flash -- First 1st Printing -- CD Included
ISBN: B003HP4RW2
EAN: N/A
Year: 2005
Pages: 163
Authors: Jobe Makar

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net