To convert or not to convert, that is the question...

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

CameronB
Posts: 7
Joined: 11 Sep 2010, 17:47

To convert or not to convert, that is the question...

Postby CameronB » 03 Nov 2010, 06:14

I'm developing a multiplayer persistent game (slowly... it's a hobby), and I have my server-side software working great with 1.6.6 SFS and Unity3D, hibernate, MySQL Database, etc... I went to go load my development environment on a new laptop and noticed that there is this new SFS 2X.

Well, it seems like it's a good thing, but what do I know? Not enough, to be sure. It seems like it will require some code conversion. My question is, what exactly would I be getting with SFS2x that SFS Pro 1.6.6 is not providing me? Since this is a hobby for now, I don't really have to worry about messing up a production environment. In that sense, I don't want to "fall behind" when I could be learning about the latest and greatest technology -- and yet if this new technology isn't going to benefit me at all, I don't see why I should bother learning about it.

Normally I pass objects between server and client as JSON format, and the new handleClientRequest doesn't seem to use JSON. Per the docs, it takes this ISFSObject which I am not sure about. Is it better to use this or JSONObject? Please pardon my lack of knowledge in this regard. Any additional info would be appreciated. I am certainly not so far in development that I can't switch gears.

Thanks,
-Cameron B
User avatar
jpardoe
Posts: 132
Joined: 31 Aug 2009, 20:54

Postby jpardoe » 03 Nov 2010, 09:46

Hi CameronB,

Take a look at this if you haven't already done so: http://www.smartfoxserver.com/2X/features.php

I was at a similar stage in development and decided to make the switch because the new version is more efficient and easier to code (once you get your head around the system).

Certainly if you're doing it as a hobby, you learn new things and keep up to date, so what's to lose?
CameronB
Posts: 7
Joined: 11 Sep 2010, 17:47

Postby CameronB » 03 Nov 2010, 15:37

Hey Jpardoe,

Thanks for the response... Yes, I have already looked at that link... It seems promising. I guess I'm just a little confused about the "Highly Efficient Protocol" part:

"Thew new binary protocol provides major improvements in server and network performance, delivering an average of 5x in encoding times and 6x in packet size reduction. "

The encoding part is confusing me... Does this mean I don't have to worry about sending things as JSONObjects anymore? Does the framework automatically encode it so that it is the most efficient transfer possible?

I originally decided to use JSON instead of XML based on the recommendations from the forums -- people said it was "faster". I'm just wondering if that still applies with this new framework.

Thanks a lot!! :)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 03 Nov 2010, 15:59

It does exactly that - automatically transfers your objects the most efficient way

Instead of string/xml/json based (which are all text in the end), the new API and server use highly optimized binary data for sending the smallest possible packets over the network.

So you dont have to worry about these things anymore :-)

/Thomas
CameronB
Posts: 7
Joined: 11 Sep 2010, 17:47

Postby CameronB » 03 Nov 2010, 16:21

I see :) Awesome!

Thanks Thomas :)

-Cameron

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 63 guests