Continuing from a previous post about Singletons we are going to discuss a simple strategy to maintain application state across multiple Extension reloads. Before delving into the details, let’s first analyze the reasons why this may help. Continue reading
In this recipe we will see how we can create a simple Extension that automatically joins users in an available Room and creates more Rooms when the seats are all occupied. Continue reading
Emails can be sent directly from your server side code in order to provide registration confirmations, updates or even debugging and stats reports.
In order to enable email sending you will need to setup the Emailer Service from the AdminTool: from theServerConfigurator choose the Emailer tab, turn on the service and set your SMTP parameters. Continue reading
Often times in the server-side game logic it is necessary to use timers for recurring events that are sent to the clients (e.g. the end of a turn time, npc actions, etc).
A quick solution to this problem is using the ScheduledThreadPoolExecutor class, provided in the JDK, which offers a convenient task executor backed by a pool of threads. SFS2X already runs its own instance of this Executor (wrapped in a class called TaskScheduler). Continue reading
You can easily attach a Remote Debugger to the server and enable your favorite Debugger for bug hunting in your Extensions.
SmartFoxServer 2X can be started with the sfs2x.bat (Windows) or sfs2x.sh (Linux/Unix/MacOSX) scripts. By adding some JVM switches to the launch script you can enable remote debugging. You can do it by following these steps: Continue reading
SFS2X provides detailed logging of all its activities. You can consult them at any time by checking the logs/folder. Additionally under the logs/boot/ folder you will find detailed logs of the boot phase. Continue reading
Together with SFS2X we provide the latest version of our SmartFoxBits components, which can save you a ton of time in setting up the application GUI if you are using the Adobe Flash platform to build your client.
The base SmartFoxBits pack contains five components:
- Connector: manages the connection/disconnection process (supporting the new reconnection system too)
- Login: handles the login process
- RoomList: manages the Rooms list, including the Groups feature (allowing to create multiple views of the list based on groups)
- UserList: manages the user list allowing private chat
- ChatBox: provides a basic chatting component
You can check all the details and read the documentation on the SmartFoxBits page.
There can be cases in which one application requires to connect to multiple databases. By default each Zone in SFS2X exposes a single DBManager object but we can create more of these via code, to manage multiple data sources. Continue reading
This recipe shows how to read data from a database and send it to the client in a convenient format. Continue reading
This recipe discusses the common scenario in which you need to validate the client credentials against the user profiles stored in a database. We will also show how to execute more custom logic right after the login, for example setting User Variables and joining a Room from server-side. Continue reading