send data on a website?

Discussion about everything. New games, 3d math, development tips...
Post Reply
pencil
Posts: 6
Joined: Tue Jul 04, 2006 3:47 pm
Location: Italy

send data on a website?

Post 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++?
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post 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)
stodge
Posts: 216
Joined: Fri Dec 05, 2003 5:57 pm

Post 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.
pencil
Posts: 6
Joined: Tue Jul 04, 2006 3:47 pm
Location: Italy

Post by pencil »

Thank you,
I think I'll try to use this libraryI've found.
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

That combined with a PHP/MySQL database would work. Thats how I'm running a master server for my p2p game.
pushpork
pencil
Posts: 6
Joined: Tue Jul 04, 2006 3:47 pm
Location: Italy

Post 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:
stodge
Posts: 216
Joined: Fri Dec 05, 2003 5:57 pm

Post by stodge »

Raknet most likely handles NAT, but check on their forums. He always gives prompt responses/assistance.
Post Reply