SFS2X Docs / DevelopmentBasics / introduction
» Development Basics
In this section we will guide you through the basic concepts of multiplayer development using SmartFoxServer 2X. From a generic perspective all multiplayer games and applications work very similarly regardless of their different genres (multiplayer action game, MMORPG, MMORTS, virtual worlds, etc).
In essence they all consist of clients connected via a persistent connection (using the TCP protocol) to a central server which is responsible for maintaining the game states and synchronize players with each others.
Under SmartFoxServer we use the concept of Zone to indicate a portion of the server dedicated to a specific application, allowing the developer to run multiple different games and apps without them interfering with each others.
You could think of Zones as different "virtual hosts" under an HTTP server, where you can run multiple web apps at the same time, in proper isolation.
» Three basic steps
An SFS2X client will typically follow a few simple steps to start the communication with the server:
- Attempt a connection with the server
- Login in one of the available Zones
- Send and receive requests to the server's "System Controller" or to the available Extensions and handle the server events
In this section of the SmartFoxServer documentation we will analyze each phase in detail providing code examples, suggestions and illustrating advanced options for each step.
» The Server controllers
Each time a client sends a request to the server he's talking to a Server Controller which is a service responsible for handling requests and sending user updates. Under SFS2X we have the following two main controllers.
- System Controller: this is the main one, responsible for handling all common client requests such as login, join, create room and all the other calls documented in the client API. In other words this controller exposes all the public SFS2X API to the connected users. This includes advanced features such as the Game API and Buddy List API. Thanks to the Privilege Manager offered by SFS2X you can also limit specific type of users (guest, regular, moderator, etc) to access certain controller's features.
- Extension Controller: this controller is exclusively dedicated to handling the custom client requests directed to the server extensions. In other words this service will route custom requests to your server-side code and return responses in form of events. This controller is also able to communicate via UDP protocol allowing faster updates for real-time games (see the Using UDP protocol document for more informations).
The SFS2X client API takes care of directing the client requests to the appropriate controller behind the scenes, so there is no particular action required on the developer's end.