Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Serapth   Crossbones+   -  Reputation: 5592

Like
1Likes
Like

Posted 14 March 2012 - 10:36 AM

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!

Sponsor:

#2 MARS_999   Members   -  Reputation: 1288

Like
0Likes
Like

Posted 25 March 2012 - 07:55 AM

Nice! Thanks!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS