Simple Networking Tutorial: Using SFML and Node to create a high score server using UDP

Started by
0 comments, last by MARS_999 12 years, 1 month ago
Not sure how many of you are interested in such a thing, but I just finished up a brief tutorial series on using SFML ( C++ ) to talk to a NodeJS highscore server. It covers creating a UDP socket, encoding information in JSON, passing it across the network, taking the highscore data and "doing stuff" with it on the server side, returning it back to the client, decoding it from JSON back into usable data then displaying it. I include a full zip of the project ( Visual Studio 2010 ), so you can simply download and compile if wanted.


The code is by no means production ready, but it does demonstrate all the concepts you need. If you are unfamiliar with Node, it is a server side Javascript environment based around Googles fast V8 JS engine. It makes writing highly parallel and scalable servers almost trivially easy and is worth checking out.


Part 1 - Setting up, running a node app, and making a simple network connection
Part 2 - JSON encoding your data in C++, passing in a new high score, decoding JSON in Node
Part 3 - returning high scores from Node back to the client, decoding JSON in C++. Also, a primitive high score webserver, just because.


Each part links to the next, so you can just start here if you want.


Please let me know if you have any comments, questions or if I made any stupid mistakes, as I no doubt have!
Advertisement
Nice! Thanks!

This topic is closed to new replies.

Advertisement