About Zone and Creation And Configuration in SmartFoxServer2X With Code Snippet


zone files are stored/placed at config folder of smartfoxserver2x.(SFS2X-<config).

By default smartfoxserver2x gives a simple zone named "BasicExamples", so we will have a file named "BasicExamples.zone.xml" in the zones folder.

Follows These 10 steps To Create/Configure New Zone

Step 1:- Make a copy of "BasicExamples.zone.xml" file and rename according to our implementation.
Assume I renamed it as CasinoGameServer.zone.xml.

Step 2:- We need to modify mainly these tags
Name
isCustomLogin
MaxUsers
userReconnectionSeconds
overrideMaxUserIdleTime
allowGuestUsers
Extension
rooms
room
extension part
databaseManager

Step 3:- Name of the zone must be same as Filename placed in zones folder. <name>CasinoGameServer</name>

Step 4:- If we want to allow the user only with username and password then set "isCustomLogin" to true by default it is false. (Means Users needs Custom login or default login can specify here)

Step 5:- If have any extension program to control the activity of zone then need to specify under <Extension> tag
<Extension>com.tutorialtous.smartfox.CasinoGameServerZoneExtension</Extension>

Step 6:- Similar to the above tags check these tags

Tag Description
<MaxUsers> Specifies How many users can able to join in Zone
<userReconnectionSeconds> Max reconnection for a user to zone (at the time of connection lost)
<overrideMaxUserIdleTime> How Many Seconds does a user can sit Idle (means without any request/event)
<allowGuestUsers> want to allow the guest users or not
<rooms> if we have any static rooms/Lobby under this tag we need mention room(<room>) tags
<room>
<room>
<databaseManager> Smartfox Provides inbuilt database connectivity Program we can configure that using this tag, means if our zone needs the database connectivity then we need to enable this <databaseManager> like this.
                        <databaseManager active="true">
   <driverName></driverName>
   <connectionString></connectionString>
   <userName></userName>
   <password></password>
   <testSql></testSql>
<maxActiveConnections />
<maxIdleConnections />
<exhaustedPoolAction />
<blockTime />
 </databaseManager>
                      
<extension> If our zone needs programmatic interaction then we need to create an extension program and we need to mention those details like, name of the extension, type of extension, file name of extension.
                        <extension>
    <name>CasinoGameServer</name>
    <type>JAVA</type>
    <file>com.tutorialtous.smartfoxserver. MySFSExtension </file>
    <propertiesFile></propertiesFile>
    <reloadMode>AUTO</reloadMode>
  </extension>
                      
Copyright © 2018-2020 TutorialToUs. All rights reserved.