SFS2X Docs / ExtensionsJava / recipes
» Extension recipes
In this document we have collected a number of recipes from our blog on how to accomplish some specific tasks that you might need during Extensions development.
Also check the HOWTOs in the Development Basics section of this documentation for other general recipes.
-
How to add new Java libraries or Extension dependencies
Deploying the libraries' JAR files without messing around with the classpath -
How to create an Extension based custom login
Implementing a custom login on the server-side -
How to create Rooms from server side
Multiple snippets showing how to create Rooms from Extension code -
Custom login with database
How to validate the client credentials against the user profiles stored in a database -
Querying the database and sending resultsets
How to read data from a database and send it to the client in a convenient format -
Multiple DB connections
How to connect to multiple databases in the same Extension -
How to debug your Extensions
Attach your favorite Debugger for bug hunting in Extensions -
How to schedule timed tasks in an Extension
How to set timers for recurring events that must be notified to the clients -
How to send an email from an Extension
Send emails directly from your server side code -
AutoJoiner Extension
How to create a simple Extension that automatically joins users in an available Room and creates more Rooms when the available ones are all occupied -
Maintaining game state across multiple reloads
A simple strategy to maintain application state across multiple Extension reloads -
Using the trace(…) command from anywhere in your Extension code
A useful little tool to log any information to debug your Extension code -
Integrating EclipseLink with SmartFoxServer 2X
How to build a simple Login Extension using EclipseLink in place of the default DBManager API provided by SFS2X -
Login with encryption
The implications of TLS protocol encryption for the login phase and the differences with the previous modality of secure login -
HTTP Request and Extensions integration
How to integrate regular HTTP calls with the SmartFoxServer runtime and how to communicate with Extension code via HTTP GET/POST requests -
Custom logging for SFS2X Extensions
How to tweak the logging configuration in SmartFoxServer 2X in order to do advanced logging from Extension code -
Using the geolocation API
How to use the embedded geolocation API and database in your Extension code