# SmartFoxServer 2X v2.20.6 cumulative patch

PLEASE NOTE: this cumulative patch requires SFS2X 2.19.x or SFS2X 2.20.x. If you're running a version that is lower than 2.19, install 2.19.0 first and then apply this patch. SFS2X Download page

## How to use

- Unzip the patch and copy the decompressed folder inside your SmartFoxServer_2X/ installation folder.
- Open the patch folder.
- Run one of the three launch scripts based on the operating system in use:
  - Windows: double click the install-win.bat file
  - Linux: from a terminal run the install-linux.sh script
  - macOS: from a terminal run the install-osx.sh script

NOTE #1: If your SFS2X version is < 2.20.4 this patch will update the Tomcat http server, overwriting its current settings. If you have customized its configuration and/or deployed an SSL certificate you will need to re-apply those changes. We recommend backing up the Tomcat config and certificate before proceeding and restoring them after patching the server.
NOTE #2:
Under Windows 10/11 the default Zip utility will create an additional folder with the same name of the .zip file, if you extract the file from the contextual menu. We recommend double clicking the patch file instead and dragging the main folder to the SmartFoxServer_2X/ directory in your drive.

### Version 2.20.6

- Server Side
  - FIX: issue with MMOItemManager resulting in a potential NPE when removing an MMOItem
  - FIX: corner-case race condition when joining a Room that would result in clients not receiving the playerId of another User via the ROOM_JOIN event
  - NEW: updated license management, with hot-reloading for ip-based licenses and other improvements

### Version 2.20.5

- Server Side
  - NEW: Added feature in AdminTool to specify a list of custom HTTP headers that are extracted at login time from the client's connection request, and stored in the session object. This allows Extension developers to consult these headers at a later time. The feature works only for Websocket or BlueBox connections.
    Example:

          @Override
          public void init()
          {
            // ...
            addEventHandler(SFSEventType.USER_JOIN_ZONE, this::onJoinZone);
          }

          private void onJoinZone(ISFSEvent event)
          {
            var user = (User) event.getParameter(SFSEventParam.USER);
            var headers = (Map<String,String>) user.getSession().getSystemProperty(SFSConstants.SESSION_HTTP_HEADERS);

            if (headers != null)
            {
              // Access header params as Map<String, String>
              String agent = headers.get("User-Agent");

              if (agent != null)
              {
                // etc...
              }
            }
          }

    The headers to be extracted can be configured from: AdminTool > Server Settings > Web Server, under the Custom HTTP Headers box.

### Version 2.20.4

- Server Side
  - NEW: updated Tomcat to release 9.0.111, with several bug and security fixes.
  - NEW: new anti-spam settings for HTTP uploads are available via the AdminTool > Server Settings > WebServer. They allow to apply a cooldown between uploads and to define a limit of uploads per session. Additionally it can be used to kick spammers out based on the number of refused upload attempts.
  - NEW: new experimental support for CloudFlare's http header (CF-Connecting-IP) to detect the client's original address when running SmartFoxServer behind a CF reverse proxy.

### Version 2.20.3

- Server Side
  - NEW: in AdmintTool, added support for storing passwords as hashes in the local config, as opposed to plain text
  - NEW: updated Tomcat to release 9.0.105, with several bug and security fixes.
  - FIX: added Tomcat setting to handle GET/POST data as UTF-8 (default is ISO-8859-1) to avoid issues with multi-byte characters in forms and uploads

### Version 2.20.2

- Server Side
  - NEW: added public method getLastLocation() to MMOItem class
  - FIX: added support for multi-byte strings in SFSObject keys

### Version 2.20.1

- Server Side
  - NEW: added support for Emergency License
  - NEW: grace period increased to 96 hours (4 days) in case an error occurs during periodic license validation
  - NEW: added support for X-Forwarded-For header directive for HTTP file uploads
  - NEW: added customizable session cleaning interval
  - FIX: problem preventing SFS to enter grace period under extremely rare circumstances if an error occurs during periodic license validation
  - FIX: added checks for undocumented Tomcat exception during websocket write operations

### Version 2.20.0

- General
  - NEW: updated Tomcat http server with release 9.0.87, with several bug and security fixes, and performance improvements.
  - NEW: improved License Server communication with faster response times. Also the License Server is now reachable from China since the infrastructure was moved from Google App Engine to Amazon Web Services.
  - NEW: added <disconnectOnFullQueue> setting in core.xml to auto-disconnect slow clients whose packet queue has reached max capacity. By default the setting is not active. For more details see the documentation here.
  - NEW: GeoLite database updated to the latest release

### Version 2.19.3

- General
  - FIX: fixed an issue with the configuration of the ExtensionFloodFilter

### Version 2.19.2

- General
  - FIX: updates Tomcat from version 9.0.55 to 9.0.70

### Version 2.19.1

- General
  - FIX: issue with targeting a single Room data file via the Room Persistence API, specifically with the loadRoom(file) and removeRoom(file) methods.