Tag Archives: javascript api

Object serialization between static and dynamic languages

Among the advanced features provided in the SmartFoxServer SDK is the ability to exchange any class instance between client and server with minimal coding intervention. This is particularly useful for statically typed languages such as Java, C# and Actionscript, while dynamic languages such as Javascript are not directly supported.

In this article we’re going to discuss an alternative way to implement custom serialization for classes that are needed from both client and server side to implement our game logic.

If you’re not entirely familiar with the topic of class serialization in SFS2X we recommend reading this article from our documentation Continue reading

SFS2X and Node.js

Some time ago we have been asked by the developers at Gameshastra how to integrate our SFS2X JavaScript client API in Node.js, in order to create a Node application capable of interacting with SmartFoxServer 2X.

We have a strategy game for which we built native client apps in Android, iOS and HTML5. We are also exposing the client functionality as a rest api for apps to be built for Amazon Alexa and Google Assistant. That rest api is being built on Node.js and we want to consume the same services hosted on SFS2X, so that we can manage all the platforms from the same server base and provide unified experience.

Continue reading

New JavaScript API v1.7.10 released

We just released v1.7.10 of the SFS2X JavaScript client API.

Starting from this new version, we completely reviewed the build process of the API.
This fixes some compatibility issues of the internal third-party libraries with module bundlers (like webpack) and also brings:

  • reduced API file size (-41%)
  • a source map to help debug the API, should unexpected issues show up in the future
  • the official SFS2X API package for the npm package builder
  • Node.js compatibility

As always, the new package is available on the download page of our website (other than in the npm repository, from now on).

In order to showcase the usage of the API with npm and webpack, we also released a variant Connector example describing the project setup and build process, including the new source mapping option.

Enjoy!