SmartFoxServer API (key classes and Key Interfaces)
SmartfoxServer2x programing can be divided into server related programing, client related programing.
As mentioned earlier to this session Extension are fundamental units of smartfoxserver2x, through the extension programing we can control the zone and rooms.
Extension Life Cycle:-
- Extension is a java program so in the same way, Extension program have a life cycle as extension initialization done at init() method and ends at destroy() method.
- init() whenever the extension loaded into Smartfox this will be fired, during the lifespan of extension it is fired only once.
- destroy() this method is fired while at the time of extension close/kill.
SmartfoxServer2X provides an API with that we can create the extension jar files. Key Classes of Smartfox/Extension API
Key Classes And Interfaces of SmartFoxServer2X API
- We can create the zones manually by creating zone.xml files under zones folder
- We can create the zones using SmartfoxAdminTool in easy GUI manner.
- Simple code to create room from Server side:
- Simple code to create room at Client side:
Sno | Class/Interface | Description |
1 | ISFSExtension | Root Interface which consists the methods of extension life cycle to implement. |
2 | IServerEventHandler | |
3 | IClientRequestHandler | |
4 | SFSExtension | An abstract class which implements ISFSExtension , If we
want to call a java program as Extension File then it must
extend this class.
Main Methods of this class are
|
5 | BaseServerEventHandler |
|
6 | BaseClientRequestHandler |
|
7 | SFSEventType |
|
8 | SmartFoxServer |
|
9 | SFSDBManager |
|