Author Archives: SmartFoxServer Team

Run SmartFoxServer 2X with JRE 16 and higher

As of 2023 SmartFoxServer 2X ships with the JRE 11 (LTS) out of the box, but it can also run with a higher version if needed.

In our documentation we have a detailed table with all the supported Java releases and their level of compatibility with SFS2X, which we recommend to consult.

At the time of writing this article SFS2X does not run with a JRE version 16 or higher without additional configuration. In this short article we will discuss how to configure the SmartFoxServer launchers to support the most recent Java runtimes, up to the latest JRE 20.

Continue reading

SmartFoxServer Cluster launch and new updates!

Hello,
we are pleased to announce that SmartFoxServer Cluster is finally here, as part of the tools in the Overcast cloud.

The new Cluster feature offers additional scalability super-powers to your SmartFoxServer based games with:

  • Automatic horizontal scaling
  • Automatic load balancing
  • Advanced cluster-wide matchmaking
  • Advanced monitoring and management via SFS2X AdminTool
  • Extended SFS2X client side API with new events and requests

Consult our website for more info on the Overcast cloud service

To learn more about the SmartFoxServer Cluster check the documentation website 

Also you can learn how to create SmartFoxServer Cluster applications in Unitythanks to a number of new detailed tutorials with source code that we have just released.

» Two months Cluster promotion

Starting today and until May 31st. 2023 all SmartFoxServer Cluster prices will be discounted by 20%

The promotion includes all prepaid server renewals until the end of the offer. After May 31st, server renewals will be reverted to the standard service price.

New in 2.19: Extension Flood Filter

With the release of SmartFoxServer 2.19.0 we have introduced a new Extension Flood Filter that provides fine grained control over the packet rate of Extension requests: it can be used to limit the number of calls per second for specific requests and automatically set rules for warning and banning the offending client(s).

It also includes the ability to catch unknown Extension calls (i.e. requests for which there doesn’t exist a request handler) and apply auto-ban rules as well.

Under normal circumstances, e.g. users playing with the official client app, there shouldn’t be a concern about request spam: limitations can be easily coded in the client itself. However it’s also relatively easy for malicious users to reverse engineer a client made in Javascript, Unity or Java and bypass such limitations.

Overview

In the diagram below we show a bird’s eye view of the filter and its position in the Extension invocation chain. For each request handler defined in our Extension code (via the addRequestHandler methods) we can set a limit expressed in number of calls per second.

Extension Flood Filter

In this example we have defined a playerShoot request handler and we’ve also set a limit of 4 requests/sec. If a client sends 20 calls in one second only the first 4 will be passed to the Extension and processed, while the rest will be discarded. Additionally, based on the auto-ban rules, the sender will either be warned or banned.

Usage

The Extension Flood Filter is inactive by default. To activate it we need to call the initFloodFilter(…) method available from the parent SFSExtension class.

public class AntiFloodTestExtension extends SFSExtension
{
    static final String PLAYER_SHOOT = "pShoot";
    static final String PLAYER_MOVE = "pMove";
 
    @Override
    public void init()
    {
        ExtensionFloodFilterConfig cfg = new ExtensionFloodFilterConfig();
        cfg.banDurationMinutes = 120;
        cfg.maxFloodingAttempts = 3;
        cfg.secondsBeforeBan = 2;
        cfg.banMessage = "You are now banned. Reason: request flooding.";
        cfg.filterRules = Map.of
                        (
                            PLAYER_SHOOT, 4, 
                            PLAYER_MOVE, 15
                        );
     
        initFloodFilter(cfg);
     
        addRequestHandler(PLAYER_SHOOT, (sender, param) -> {
         
            trace("Shooting");
     
        });
     
        addRequestHandler(PLAYER_MOVE, (sender, param) -> {
         
            trace("Moving");
     
        });
    }
}

The initializer method takes a ExtensionFloodFilterConfig object with with a number of properties for warning and banning clients.

For more details on each setting, default values and further details please check our documentation website here.

SmartFoxServer 2.19.0 is available!

We have just released SmartFoxServer 2X 2.19.0, which introduces Extension Flood Filters to limit the number of Extension calls on a per-request basis. The release comes also with updated Tomcat (websocket/BlueBox), updated GeoIP database and a host of bug fixes.

Please note: the new release comes as a standalone installer so it can’t be used to update a previous instance.

» Get the new SmartFoxServer 2.19.0 installer from our download section.
» Read the full release notes here.

SmartFoxServer 2.18.3 is out!

We just released SFS2X patch 2.18.3 which fixes a couple of problems with the Analytics module, adds IP-range support for Admin clients and fixes a minor UI issue with the AdminTool. You can read the release notes and proceed with the download from here.

While you are at it, also check out the latest client API in our dedicated download section.

Please note: the patch requires SFS2X 2.18.0 to be already installed.

SmartFoxServer 2.18.2 is available!

We just released SFS2X patch 2.18.2 which provides a series of features that have been requested and launches updated client-side APIs for all supported platforms. You can read the release notes and proceed with the download from here.

The latest client API can be obtained from our dedicated download section.

Please note: the patch requires SFS2X 2.18.0 to be already installed.

Custom Room Storage with SFS2X 2.18

Since the release of SmartFoxServer 2.18 we have introduced a way to override the default implementations for the Room Persistence API so that they can be customized to your needs.

Prior to this release we provided a file-based and a relational database-based storage mechanisms that could be used in conjunction with the API to save the state of multiple active Rooms.

With the new release you can now create your own storage implementations and plug them into the Persistence API. In this short article we’ll walk you through what has changed and how you can create a custom storage class.

Continue reading