Author Archives: SmartFoxServer Team

Using functional Java with SFS2X Java API

With the release of patch 2.13.1 SmartFoxServer 2X adds support for lambda expressions in Java Extensions. Also we have added support for this new JDK 8 feature in the Java client API, starting from release 1.7.1

If you’re not familiar with lambda expressions we highly recommend to take a look at our introductory article where we illustrate the basics and show how to integrate the feature in your server side code.

In this new article we will focus on the client side of things but, before getting started, make sure you are already using the JDK 8 (or later) and the SFS2X Java API 1.7.1 (or higher) Continue reading

Handling network switches on mobile devices

In the last blog post we talked about what happens behind the scenes when we pull the ethernet cable or shut down the wifi network, and why this isn’t a reliable way to test a “sudden disconnection” scenario.

In this new article we’ll continue our journey “behind the scenes” taking a look at mobile devices and in particular at how to correctly handle the switch between networks, such as WiFi, 3G and 4G. Continue reading

What really happens when you unplug your network or wifi

In this brief article we’re going to take a look at what really happens when we shut down a device’s wifi or unplug the ethernet cable off of a computer. While intuitively one would expect the current connections to go down, this is likely not the case.
We are going to see why this happens and clarify a few misconceptions that arise when testing disconnection scenarios in a multiplayer game. Continue reading

HTML5 / JavaScript tutorials

We just published the first batch of HTML5 / JavaScript tutorials describing the following examples in details:

  • Connector
    Learn how to configure the client and make your first connection
  • Simple Chat
    Learn how to create a basic chat environment for connected users
  • Advanced Chat
    Learn how to create a complete browser-based chat application featuring public chat messaging, Rooms management, private chat messaging and more
  • Game Lobby
    Learn how to create a “lobby” application where users can meet and invite each other to play games

All tutorials are available in our documentation website.

Kotlin and SmartFoxServer 2X

You may have heard of the Kotlin language before, but recently it has seen a big spike in popularity thanks to Google officially adopting it for Android development, alongside Java and C++.

Kotlin is an interesting statically typed language, developed by the good folks at Jetbrains, that shares many similarities with the likes of Scala and Swift. In a sense, it could be thought of the equivalent of Swift for the Java platform: a more modern, concise and safer language that runs in the JVM, fully interoperable with Java.

If that’s not enough, Kotlin also aims at compiling for other targets beyond the JVM, such as Javascript and native platforms and seeks to support asynchronous programming via coroutines and non blocking I/O.

In the context of using Kotlin with SmartFoxServer nothing would be easier: the integration on both server side and client side is painless and it works out of the box with any SFS2X release.

Let’s take a closer look, shall we? Continue reading