Author Archives: SmartFoxServer Team

Security for HTML5 games

With SmartFoxServer 2X 2.13.4 we introduced websocket origin checks for HTML5 clients. What this mechanism does is essentially verify the provenance of the client against a white-list of domains configured by the server admin. If the client origin does not match any of the allowed domains the client connection is denied.

In this article we’ll demonstrate how to use and configure websocket origins in SmartFoxServer 2X and discuss the advantages and limitations of this security measure. We’ll also take a deeper look at the issue of cheating clients and propose several ideas to improve the security of your online game. Continue reading

New C# API v1.7.9 released

We just released v1.7.9 of the SFS2X C# client API for Unity / .Net / Mono / Universal Windows Platform.

What’s new:

  • Rewritten BlueBox client, using .Net 4.5.x classes.
  • Added support for BlueBox (tunneled) connection over HTTPS.
  • Added support for proxy settings for the BlueBox connection (not available under Universal Windows Platform).
  • Rewritten SmartFox.InitCrypto() method; now it doesn’t require to be run as a coroutine in Unity.
  • Unified .DLLs for Unity and .Net/Mono; now both environments can reference the same library.
  • Updated WebsocketSharp library for Unity WebGL builds.

…And we also fixed a WSS connection issue in Unity.

You can get the updated API at this url: https://www.smartfoxserver.com/download/sfs2x#p=client

Enjoy!

SFS2X multi-threading demystified

Often times articles in this blog are inspired by questions and issues raised by our users and this new entry is no exception. One aspect of SmartFoxServer that seems to intimidate developers is the multi-threaded environment behind custom Extensions, and the relative implications in terms of concurrency, scalability and performance.

In this new entry we’re going to demystify the subject and demonstrate how simple and painless is writing server side code, even when many other things are running concurrently. Continue reading

Best of both worlds: SFS2X + server side Unity for realtime games (p2)

In part one of this article series we took a bird’s eye look at various client-server strategies for action multiplayer games. We then highlighted the advantages of running an hybrid solution with SmartFoxServer 2X and Unity on the server side to combine the best of both worlds.

In this second part we’ll be looking at the details of implementing such a solution, the potential difficulties and how to overcome them.

If you have skipped the first article we highly recommend to go back and read it, before you proceed. Continue reading

Best of both worlds: SFS2X + server side Unity for realtime games (p1)

Realtime multiplayer games have been around for over four decades, even though their popularity is a much more recent phenomenon, and they remain one of the trickiest type of games  to develop. Delivering a smooth and responsive action for the players while hiding the latency and limitations of the network is still a major source of coding pain.

Also many games heavily rely on physics to add extra realism and interesting mechanics which in turn adds more complexity to make sure that all players are accurately in synch with each other.

With the emergence of powerful 3D engines such as Unreal and Unity these complex features have been integrated with the visual and rendering systems, hiding the intricacies of physics simulations and networking, and making it more accessible to all developers.

In this article we’re going to take a deep look at the available solutions for multiplayer action games, explore different architectures and examine the multiplayer side of engines such as Unity.

For each method we’ll discuss the pros and cons and finally we’ll propose an integration with SmartFoxServer 2X that we think provides the best of both worlds. 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!

New client API updates available!

We have just released a new client side API update across all supported platforms, ironing out a few bugs that were reported recently.

In particular we have solved an issue whereby reconnecting an encrypted session would cause a server side error and fail to reconnect.

Make sure to check our client API section of the website to read the release notes and download the updates.