Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just finished my game and I'd like to add some ranking functionality to it. I have a mySQL database running on my website and want to be able to insert and retrieve data from it. My knowledge in server side programming is basic to none and I'm wondering if you could provide me some tips on how to approach this. My game was developed in C++.

1) Should I look for I library written in C/C++ that handles this client/server communication directly?


2) Should I implement it through a script (say python) and somehow interface it through my C++ code. By interfacing I imagine I'd call .py passing in a string as argument, and somehow receiving a string as return. (table entries, error messages, etc). Also I don't want anyone messing up with the database. I don't know, the source code would be there with connection authentication and I assume anyone knowing python could adjust it to inject any value in the database. Well, If that is a good approach what libraries could I use to interface C and Python (or any other say Java).

share|improve this question
Have you thought about building a simple REST API on your website, that your C++ game can consume by sending the appropriate GET/POST? – Nate Aug 14 '12 at 20:13
up vote 1 down vote accepted

Write a script in perl, python, or some other convenient scripting language that processes a form which specifies the game, who won etc. You can develop and test this script using any web browser. Use a network package such as libcurl to submit these forms from within the c++ application.

You will need to take some steps from the beginning to prevent fraud and accidents from trashing your rankings. For example, make your request include a md5 checksum to authenticate it and prevent altering the request, and keep track at the server to prevent the same request from being used twice.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.