Online Highscore example

Previous topic - Next topic

Moru

I made a simple online highscore example that uses PHP, MySQL and GLBasic ofcourse :-) It calls a homepage with the path "http://your.homepage.com/index.php/listgame/highscore/game_name/playername/score/64byte_hash"

The PHP side needs an installation of CodeIgniter to work. http://codeigniter.com/

The 64byte_hash is created from all the other data so if those don't add up when the server gets it all, it won't be added. This should be resonably safe until someone REALY wants to hack your highscore table :-)

To get the list of highscores just call the same routine (Highscores) with an empty name and score and you will download an ini-file that the scores will be loaded from and shown to you.

You can find the code on my homepage under "CODE". Ofcourse you have to change the password in the file, you can find it if you search for "secret code" in both the PHP file "listgame.php" and the GLBasic file "SpaceInvaders.gbas"

Good luck!

Hemlos

Curious...

Why not just send the highscore through the game itself, to a game server via the GLBasic networking commands? Ie: Make the game server record scores into its own datafile, which is in a website port 80 directory, as an HTML. GLBasic is pretty powerful combined with just a webhost, it can even be setup to write a php data instead of building HTML.
Bing ChatGpt is pretty smart :O

Moru

Eh? Because I can do the same thing in PHP with a couple of lines of code? PHP is the simplest way of doing it and it works on almost ALL webservers out there. Not everyone has the possibility to install custom files on the webhost. GLBasic is made for games, not hosting websites. I preffer to just write a few lines of PHP and have others worry about ports and garbage coming into that port randomly from the internet.

In case your post was just a joke, forgive me for the stupid answer...

Hemlos

I didnt say anything about using glbasic to host a website...only to alter the score datafile.

Is installing CodeIgniter to a website a "custom" thing?

I see your point, its just a workaround tho :P
Bing ChatGpt is pretty smart :O

Moru

Codeigniter is just a PHP library, no custom thing needed. It might even be a good idea to run your whole homepage by using Codeigniter since it catches a lot of the dangers of passing values to an SQL database.

Hemlos

Sounds like a good ida Moru. Nice work.
Bing ChatGpt is pretty smart :O