This three part tutorial covers creating a simple high score client and server. The client is a simple commandline application using SFML for networking and written in C++. The server is written in NodeJS
covers installing/running Node, creating your C++ project and creating a simple network connection.Part 2
covers encoding data in C++ in JSON format and sending it across the wire using UDP. The server then receives the data, decodes it and well, thats about it.Part 3
ends off with the server encoding high score results and returning them back to the client where they are decoded and displayed. Just to illustrate how brutally simple it is, this part also creates a simple web server for returning high score data via the browser.
At the end of each part is a zip download containing all the source, a preconfigured Visual Studio 2010 project, as well as the Node source code in a subfolder. Each page links to the next, so you don't have to click each link above.
At the end, you will have a fully functional high score server, and a client that can access it to update the list and get high scores. The code is by no means production ready, it is meant more for demonstration, but you have just about everything you would need to know to implement your own high score server by the end. You could easily swap out the SFML/C++ client for any other language/library capable of making UDP calls, as could you easily change to TCP, with a simple find and replace. This example is just for a leaderboard, but the exact same logic could be applied to creating a match making server ( with Node geolocation libraries ), a lobby, etc...
Hope some of you find it useful or interesting. Feedback as always appreciated. Cheers.