Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Andrechan on Sun 03/09/2006 21:07:11

Title: sending high score to a web page
Post by: Andrechan on Sun 03/09/2006 21:07:11
Hi!  :)
I would like to let people send their score on a web page (in php). Is it possible to send a Post  Http request to a page?

If it's not possible maybe I can do this way:
After the game over player enters his name and then the game generates an Url of the form
http://myurl/highscore.php?name=John&score=100&code=rrtrgfgd

with the code field a result of cripting the name and the score in some way (to avoid cheating). The php page will control if Cript(name,score)=code
But the problem is: what function can I use to cript?
Title: Re: sending high score to a web page
Post by: rockeh on Sun 03/09/2006 22:29:44
The only solution I can think of right now is outputting the URL to a file, sort of like this:

// figure out how to code the score
File *score = File.Open("score.html", eFileWrite);
score.WriteString ("<html><body><a href='http://yoursite/hiscore.php?name=John&score=100&code=blablabla'>Click here</a></body></html>");
score.Close();


Now, what this should do is create an HTML document that contains a link which will create a new user and high score -- always assuming your PHP does that :)

Also, please note that I haven't actually tried this, so it may not work...
Title: Re: sending high score to a web page
Post by: Gilbert on Mon 04/09/2006 02:05:55
There're similar questions asked in the past, like this (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=19940.0) and this (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=22335.0).
Title: Re: sending high score to a web page
Post by: Vince Twelve on Mon 04/09/2006 07:59:20
I'm planning on implementing a simple system like this in my game (though I haven't gotten to that point yet and am not sure if it'll make the final game.)  But what I'm planning is simply to have the game supply a code and a webpage upon completion of the game.  For example:
QuoteCongratulations, you've won!  Go to http://www._____.com/____ and enter the following code to join the high score list: XKJERAL

It adds an extra step for the player, but you don't have to mess around writing plugins (which I have no idea how to do).

The more difficult part is coming up with a cryptographic scheme that can encode the player's score along with a sufficiently large random number (generated at the start of a new game so the player doesn't save just before finishing and then load repeatedly to add his name to the high score list many times), and have competent error checking included (so that a random guess or attempt at hacking the encoding scheme won't work).
Title: Re: sending high score to a web page
Post by: strazer on Fri 08/09/2006 14:00:48
The FileNet plugin that was brought up here now has its own thread: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28261

Please continue discussion about that plugin there.