Page 1 of 1

send data on a website?

Posted: Thu Jul 06, 2006 10:42 am
by pencil
QUESTION: Let's say I want to create a TOP10-killers-of-the-game chart on a website.
The game should load the chart from the site and if the player has done a great score should update the data onto the site.

What is the best way (or the most common) to do something like this in C++?

Posted: Thu Jul 06, 2006 11:39 am
by TheC
You would need to use a network library to open a TCP connection to your webserver.

The use HTTP standards to send your information to a dynamic page (like php)

Posted: Thu Jul 06, 2006 12:23 pm
by stodge
Or run a daemon of your own on the server that runs an HTTP server with access to the game database. Have your game server send updates to the daemon, which then updates the database. When people visit the site, the HTTP server generates dynamic pages from the database.

Obviously you could avoid having the extra daemon and run your game server and the HTTP server on the same computer.

Posted: Thu Jul 06, 2006 5:38 pm
by pencil
Thank you,
I think I'll try to use this libraryI've found.

Posted: Fri Jul 07, 2006 9:09 am
by JPulham
That combined with a PHP/MySQL database would work. Thats how I'm running a master server for my p2p game.

Posted: Fri Jul 07, 2006 2:58 pm
by pencil
Yes, I was thinking exactly about that, JPulham: a master server for a p2p game, so that I could also use the free web hosting offered by someone else's servers. 8)
I have a question for you (or anyone else with a similar project):
If you use the "server" to store peers addresses, does it also works for people behind a NAT ?
If so (even if not), can you put the code you use to get the address?
(Personally I am using Raknet for networking)

Sorry for the much specific and off-topic questions, feel free not to answer me. :oops:

Posted: Fri Jul 07, 2006 3:20 pm
by stodge
Raknet most likely handles NAT, but check on their forums. He always gives prompt responses/assistance.