Saving Hiscores
Blitz3D Forums/Blitz3D Beginners Area/Saving Hiscores
| ||
Hi all! I want my proggy to be able to save the users hi-scores online? Can anybody give pointers or provide links to such information? |
| ||
A simple way to do this, would be to write the scores to a local 'datafile', then upload the file to your webspace. A quite comprehensive routine for high score recording locally is given here: http://www.blitzbasic.com/codearcs/codearcs.php?code=1668 For the uploading of the file to the webspace (and subsequent downloading for readingit back too) gets more complex. You may find this useful: http://www.blitzbasic.com/codearcs/codearcs.php?code=1444 In short, the basic outline for what you would require is: 1) Create a 'default' Hi-Score table of data and upload it. 2) Your program will initially want to download and read the most recent hi-score list from the webspace and have the values kept in memory. You can delete the downloaded local file once read which will help prevent people from messing with it 3) When a game is finished, if a Hi-Score has been beaten, follow from step 4, otherwise, do nothing* :) 4) Re-Write out the hiscores from within your program into a local datafile, including the new high score. 5) Upload this datafile, overwriting the existing one on your webspace. Now you will have an up-to-date record online for the next time the game is loaded and/or scores are read. 6) Again, you can now delete the local file if you wish yto help prevent it being messed with. *You MIGHT want to regularly re-download the hi score table,m in case two different people have played at the same time but this is a little bit more involved, but shouldn't be too difficult if you can get it working as above :) |
| ||
Use Etna! Just follow my signature... (you have to know a bit php and mysql) |
| ||
Apologies to all...I had a bit of life for the last 2 weeks that needed a good kicking. Malice: Having looked at the code - it looks awfully complex, but looks to be the most promising. RepeatUntil: That ETNA looks the business, but alas, I know nothing of PHP or MySQL...could you give a quick lesson? |