Making An Online Scoreboard
Author: | Klikmaster
|
Submitted: | 1st November, 2003
|
Views: | 10219
| Rated: |
|
|
Making an online Scoreboard
I will show you how to make your own hi-score board using asp, yes sorry php people. I will show you basically how the system works and how to submit the scores to the scoreboard using moosock, so sorry again if you don’t have it. I will mention MMF throughout this article, but it should work with TGF too.
ASP HOSTS
If you need an asp host first, these are 2 good ones I use, www.1asphost.com and www.brinkster.com . I recommend 1asphost, as it holds 70mb more space and supports ASP 3.0 rather than 2.0
THE FILES
Here is a zip containing the files I have used for my online scoreboard: http://hometown.aol.co.uk/xjoeydude/hiscore.zip . It also contains an open source MMF application, to show you how to submit the scores with moosock.
WHAT HAPPENS?
In the MMF application, moosock connects and executes a web address. The web address should be the location of the add.asp file with something called a querystring. A querystring is something that tags on to the end of a web address to give more functionality to it. This is the querystring that should be added to the address for add.asp:
?name=…&score=…
Obviously you need to specify what the name and score is, so in my example I used:
www.whatever.com/add.asp?name= + string$( String ) + &score= + Str$( score( Player 1 ) )
Make sure the score is included in Str$() because it makes the number into text, you need this to work. I have incorporated MMF’s object actions (string and a random score) to the query string. That is how the data is passed from the MMF app to add.asp.
When the data reaches add.asp, the results from the querystring are put into the database. Scores.asp shows what is in the database, sorted by highest score, and a rank is assigned to each name.
CONFIGURING IT TO WORK
MMF - In the moosock “send text” line replace the www.whatever.com/ with your directory that contains add.asp, replace Edittext$( Edit ) with the location of the name of the player, and replace Str$( score( Player 1 ) ) with wherever you get the player’s score.
If your database is in a different directory to add.asp and scores.asp, open up add.asp and scores.asp and find the text where it says database.mdb and change that so that it refers to the correct directory. If you need to clear the hiscore table, reupload the database to overwrite the old one.
You can fiddle around with the code however much you want, as you may want to customise the design.
I hope you understood the jist of what I was saying, and hope everything works out.
Klikmaster
|
|
|