• Advertisement
Sign in to follow this  

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

This topic is 2128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Not sure how many of you are interested in such a thing, but I just finished up a brief tutorial series on using [url="http://sfml-dev.org"]SFML [/url]( C++ ) to talk to a [url="http://nodejs.org/"]NodeJS [/url]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.

[url="http://www.gamefromscratch.com/post/2012/01/31/Network-programming-with-SFML-and-Nodejs-Part-1.aspx"]Part 1[/url] - Setting up, running a node app, and making a simple network connection
[url="http://www.gamefromscratch.com/post/2012/02/28/Network-programming-with-SFML-and-Nodejs-Part-2.aspx"]Part 2[/url] - JSON encoding your data in C++, passing in a new high score, decoding JSON in Node
[url="http://www.gamefromscratch.com/post/2012/03/14/Network-programming-with-SFML-and-Nodejs-Part-3.aspx"]Part 3[/url] - 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 [url="http://www.gamefromscratch.com/post/2012/01/31/Network-programming-with-SFML-and-Nodejs-Part-1.aspx"]just start here[/url] 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!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement