In Smartfox server, we can create zones. Zones are generally the name of the game app. We have numerous zones each specific to a game. In each zone, we can create rooms. These rooms can be chat, game, news, public etc.
Whenever a user is logged into server, he is generally assigned to a room. This can be a public room. This room is specially used for public chat. Server can use this room to push any public message to the user.
Zones can be created via logging into the admin url (http://10.0.3.74:8080/admin). Here we have left panel with different image button. Click on the zone configurator.
You can create a zone and can add as many rooms as you want. When you add a zone, smart fox creates an xml files in zones directory of your smartfox installation. The file name is the name of your zone given in the admin tool.
in my case it will created MyGame.zone. This file has all the details related to the zones and rooms.
<zone>
<name>MyGame</name>
<isCustomLogin>false</isCustomLogin>
<isForceLogout>true</isForceLogout>
<applyWordsFilterToUserName>true</applyWordsFilterToUserName>
<applyWordsFilterToRoomName>true</applyWordsFilterToRoomName>
<applyWordsFilterToPrivateMessages>true</applyWordsFilterToPrivateMessages>
<isFilterBuddyMessages>true</isFilterBuddyMessages>
<maxUsers>1000</maxUsers>
<maxUserVariablesAllowed>5</maxUserVariablesAllowed>
<maxRoomVariablesAllowed>5</maxRoomVariablesAllowed>
<minRoomNameChars>3</minRoomNameChars>
<maxRoomNameChars>10</maxRoomNameChars>
<maxRooms>500</maxRooms>
<maxRoomsCreatedPerUser>3</maxRoomsCreatedPerUser>
<userCountChangeUpdateInterval>1000</userCountChangeUpdateInterval>
<userReconnectionSeconds>0</userReconnectionSeconds>
<overrideMaxUserIdleTime>120</overrideMaxUserIdleTime>
<allowGuestUsers>true</allowGuestUsers>
<guestUserNamePrefix>Guest#</guestUserNamePrefix>
<publicRoomGroups>default,games,chat</publicRoomGroups>
<defaultRoomGroups>default,games,chat</defaultRoomGroups>
<defaultPlayerIdGeneratorClass></defaultPlayerIdGeneratorClass>
<wordsFilter active="false">
<useWarnings>false</useWarnings>
<warningsBeforeKick>3</warningsBeforeKick>
<kicksBeforeBan>2</kicksBeforeBan>
<banDuration>1440</banDuration>
<maxBadWordsPerMessage>0</maxBadWordsPerMessage>
<kicksBeforeBanMinutes>3</kicksBeforeBanMinutes>
<secondsBeforeBanOrKick>5</secondsBeforeBanOrKick>
<warningMessage>Stop swearing or you will be banned</warningMessage>
<kickMessage>Swearing not allowed: you are being kicked</kickMessage>
<banMessage>Too much swearing: you are banned</banMessage>
<wordsFile>config/wordsFile.txt</wordsFile>
<filterMode>WHITELIST</filterMode>
<banMode>NAME</banMode>
<hideBadWordWithCharacter>*</hideBadWordWithCharacter>
</wordsFilter>
<floodFilter active="false">
<banDurationMinutes>1440</banDurationMinutes>
<maxFloodingAttempts>5</maxFloodingAttempts>
<secondsBeforeBan>5</secondsBeforeBan>
<banMode>NAME</banMode>
<logFloodingAttempts>true</logFloodingAttempts>
<banMessage>Too much flooding, you are banned</banMessage>
</floodFilter>
<rooms>
<room>
<name>game</name>
<groupId>games</groupId>
<password></password>
<maxUsers>2</maxUsers>
<maxSpectators>0</maxSpectators>
<isDynamic>true</isDynamic>
<isGame>true</isGame>
<isHidden>false</isHidden>
<autoRemoveMode>DEFAULT</autoRemoveMode>
<permissions>
<flags>PASSWORD_STATE_CHANGE,PUBLIC_MESSAGES</flags>
<maxRoomVariablesAllowed>10</maxRoomVariablesAllowed>
</permissions>
<events>USER_ENTER_EVENT,USER_EXIT_EVENT,USER_COUNT_CHANGE_EVENT,USER_VARIABLES_UPDATE_EVENT</events>
<badWordsFilter isActive="false"/>
<roomVariables/>
<extension>
<name></name>
<type>JAVA</type>
<file></file>
<propertiesFile></propertiesFile>
<reloadMode>AUTO</reloadMode>
</extension>
</room>
<room>
<name>chat</name>
<groupId>chats</groupId>
<password></password>
<maxUsers>2147483647</maxUsers>
<maxSpectators>0</maxSpectators>
<isDynamic>false</isDynamic>
<isGame>false</isGame>
<isHidden>false</isHidden>
<autoRemoveMode>DEFAULT</autoRemoveMode>
<permissions>
<flags>PASSWORD_STATE_CHANGE,PUBLIC_MESSAGES</flags>
<maxRoomVariablesAllowed>10</maxRoomVariablesAllowed>
</permissions>
<events>USER_ENTER_EVENT,USER_EXIT_EVENT,USER_COUNT_CHANGE_EVENT,USER_VARIABLES_UPDATE_EVENT</events>
<badWordsFilter isActive="false"/>
<roomVariables/>
<extension>
<name></name>
<type>JAVA</type>
<file></file>
<propertiesFile></propertiesFile>
<reloadMode>AUTO</reloadMode>
</extension>
</room>
</rooms>
<disabledSystemEvents/>
<privilegeManager active="false">
<profiles class="java.util.Arrays$ArrayList">
<a class="profile-array">
<profile id="0">
<name>Guest</name>
<deniedRequests class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>CreateRoom</string>
<string>PrivateMessage</string>
<string>SetRoomVariables</string>
<string>SetUserVariables</string>
<string>ChangeRoomName</string>
<string>ChangeRoomPassword</string>
<string>ChangeRoomCapacity</string>
<string>InitBuddyList</string>
<string>AddBuddy</string>
<string>BlockBuddy</string>
<string>RemoveBuddy</string>
<string>SetBuddyVariables</string>
<string>GoOnline</string>
<string>BuddyMessage</string>
<string>ModeratorMessage</string>
<string>AdminMessage</string>
<string>KickUser</string>
<string>BanUser</string>
</a>
</deniedRequests>
<permissionFlags/>
</profile>
<profile id="1">
<name>Standard</name>
<deniedRequests class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ModeratorMessage</string>
<string>AdminMessage</string>
<string>KickUser</string>
<string>BanUser</string>
</a>
</deniedRequests>
<permissionFlags class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ExtensionCalls</string>
</a>
</permissionFlags>
</profile>
<profile id="2">
<name>Moderator</name>
<deniedRequests class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>AdminMessage</string>
</a>
</deniedRequests>
<permissionFlags class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ExtensionCalls</string>
<string>SuperUser</string>
</a>
</permissionFlags>
</profile>
<profile id="3">
<name>Administrator</name>
<deniedRequests/>
<permissionFlags class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ExtensionCalls</string>
<string>SuperUser</string>
</a>
</permissionFlags>
</profile>
</a>
</profiles>
</privilegeManager>
<extension>
<name>ChakravestExtension</name>
<type>JAVA</type>
<file>com.chakravest.game.extension.ChakravestApplicationExtension</file>
<propertiesFile></propertiesFile>
<reloadMode>AUTO</reloadMode>
</extension>
<buddyList active="false">
<allowOfflineBuddyVariables>true</allowOfflineBuddyVariables>
<maxItemsPerList>100</maxItemsPerList>
<maxBuddyVariables>15</maxBuddyVariables>
<offlineBuddyVariablesCacheSize>500</offlineBuddyVariablesCacheSize>
<customStorageClass></customStorageClass>
<useTempBuddies>true</useTempBuddies>
<buddyStates class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>Available</string>
<string>Away</string>
<string>Occupied</string>
</a>
</buddyStates>
<badWordsFilter isActive="true"/>
</buddyList>
<databaseManager active="true">
<driverName>com.mysql.jdbc.Driver</driverName>
<connectionString>jdbc:mysql://localhost:3306/mysql</connectionString>
<userName>root</userName>
<password>admin</password>
<testSql>select * from People</testSql>
<maxActiveConnections>10</maxActiveConnections>
<maxIdleConnections>10</maxIdleConnections>
<exhaustedPoolAction>FAIL</exhaustedPoolAction>
<blockTime>3000</blockTime>
</databaseManager>
</zone>
Whenever a user is logged into server, he is generally assigned to a room. This can be a public room. This room is specially used for public chat. Server can use this room to push any public message to the user.
Zones can be created via logging into the admin url (http://10.0.3.74:8080/admin). Here we have left panel with different image button. Click on the zone configurator.
You can create a zone and can add as many rooms as you want. When you add a zone, smart fox creates an xml files in zones directory of your smartfox installation. The file name is the name of your zone given in the admin tool.
in my case it will created MyGame.zone. This file has all the details related to the zones and rooms.
<zone>
<name>MyGame</name>
<isCustomLogin>false</isCustomLogin>
<isForceLogout>true</isForceLogout>
<applyWordsFilterToUserName>true</applyWordsFilterToUserName>
<applyWordsFilterToRoomName>true</applyWordsFilterToRoomName>
<applyWordsFilterToPrivateMessages>true</applyWordsFilterToPrivateMessages>
<isFilterBuddyMessages>true</isFilterBuddyMessages>
<maxUsers>1000</maxUsers>
<maxUserVariablesAllowed>5</maxUserVariablesAllowed>
<maxRoomVariablesAllowed>5</maxRoomVariablesAllowed>
<minRoomNameChars>3</minRoomNameChars>
<maxRoomNameChars>10</maxRoomNameChars>
<maxRooms>500</maxRooms>
<maxRoomsCreatedPerUser>3</maxRoomsCreatedPerUser>
<userCountChangeUpdateInterval>1000</userCountChangeUpdateInterval>
<userReconnectionSeconds>0</userReconnectionSeconds>
<overrideMaxUserIdleTime>120</overrideMaxUserIdleTime>
<allowGuestUsers>true</allowGuestUsers>
<guestUserNamePrefix>Guest#</guestUserNamePrefix>
<publicRoomGroups>default,games,chat</publicRoomGroups>
<defaultRoomGroups>default,games,chat</defaultRoomGroups>
<defaultPlayerIdGeneratorClass></defaultPlayerIdGeneratorClass>
<wordsFilter active="false">
<useWarnings>false</useWarnings>
<warningsBeforeKick>3</warningsBeforeKick>
<kicksBeforeBan>2</kicksBeforeBan>
<banDuration>1440</banDuration>
<maxBadWordsPerMessage>0</maxBadWordsPerMessage>
<kicksBeforeBanMinutes>3</kicksBeforeBanMinutes>
<secondsBeforeBanOrKick>5</secondsBeforeBanOrKick>
<warningMessage>Stop swearing or you will be banned</warningMessage>
<kickMessage>Swearing not allowed: you are being kicked</kickMessage>
<banMessage>Too much swearing: you are banned</banMessage>
<wordsFile>config/wordsFile.txt</wordsFile>
<filterMode>WHITELIST</filterMode>
<banMode>NAME</banMode>
<hideBadWordWithCharacter>*</hideBadWordWithCharacter>
</wordsFilter>
<floodFilter active="false">
<banDurationMinutes>1440</banDurationMinutes>
<maxFloodingAttempts>5</maxFloodingAttempts>
<secondsBeforeBan>5</secondsBeforeBan>
<banMode>NAME</banMode>
<logFloodingAttempts>true</logFloodingAttempts>
<banMessage>Too much flooding, you are banned</banMessage>
</floodFilter>
<rooms>
<room>
<name>game</name>
<groupId>games</groupId>
<password></password>
<maxUsers>2</maxUsers>
<maxSpectators>0</maxSpectators>
<isDynamic>true</isDynamic>
<isGame>true</isGame>
<isHidden>false</isHidden>
<autoRemoveMode>DEFAULT</autoRemoveMode>
<permissions>
<flags>PASSWORD_STATE_CHANGE,PUBLIC_MESSAGES</flags>
<maxRoomVariablesAllowed>10</maxRoomVariablesAllowed>
</permissions>
<events>USER_ENTER_EVENT,USER_EXIT_EVENT,USER_COUNT_CHANGE_EVENT,USER_VARIABLES_UPDATE_EVENT</events>
<badWordsFilter isActive="false"/>
<roomVariables/>
<extension>
<name></name>
<type>JAVA</type>
<file></file>
<propertiesFile></propertiesFile>
<reloadMode>AUTO</reloadMode>
</extension>
</room>
<room>
<name>chat</name>
<groupId>chats</groupId>
<password></password>
<maxUsers>2147483647</maxUsers>
<maxSpectators>0</maxSpectators>
<isDynamic>false</isDynamic>
<isGame>false</isGame>
<isHidden>false</isHidden>
<autoRemoveMode>DEFAULT</autoRemoveMode>
<permissions>
<flags>PASSWORD_STATE_CHANGE,PUBLIC_MESSAGES</flags>
<maxRoomVariablesAllowed>10</maxRoomVariablesAllowed>
</permissions>
<events>USER_ENTER_EVENT,USER_EXIT_EVENT,USER_COUNT_CHANGE_EVENT,USER_VARIABLES_UPDATE_EVENT</events>
<badWordsFilter isActive="false"/>
<roomVariables/>
<extension>
<name></name>
<type>JAVA</type>
<file></file>
<propertiesFile></propertiesFile>
<reloadMode>AUTO</reloadMode>
</extension>
</room>
</rooms>
<disabledSystemEvents/>
<privilegeManager active="false">
<profiles class="java.util.Arrays$ArrayList">
<a class="profile-array">
<profile id="0">
<name>Guest</name>
<deniedRequests class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>CreateRoom</string>
<string>PrivateMessage</string>
<string>SetRoomVariables</string>
<string>SetUserVariables</string>
<string>ChangeRoomName</string>
<string>ChangeRoomPassword</string>
<string>ChangeRoomCapacity</string>
<string>InitBuddyList</string>
<string>AddBuddy</string>
<string>BlockBuddy</string>
<string>RemoveBuddy</string>
<string>SetBuddyVariables</string>
<string>GoOnline</string>
<string>BuddyMessage</string>
<string>ModeratorMessage</string>
<string>AdminMessage</string>
<string>KickUser</string>
<string>BanUser</string>
</a>
</deniedRequests>
<permissionFlags/>
</profile>
<profile id="1">
<name>Standard</name>
<deniedRequests class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ModeratorMessage</string>
<string>AdminMessage</string>
<string>KickUser</string>
<string>BanUser</string>
</a>
</deniedRequests>
<permissionFlags class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ExtensionCalls</string>
</a>
</permissionFlags>
</profile>
<profile id="2">
<name>Moderator</name>
<deniedRequests class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>AdminMessage</string>
</a>
</deniedRequests>
<permissionFlags class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ExtensionCalls</string>
<string>SuperUser</string>
</a>
</permissionFlags>
</profile>
<profile id="3">
<name>Administrator</name>
<deniedRequests/>
<permissionFlags class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>ExtensionCalls</string>
<string>SuperUser</string>
</a>
</permissionFlags>
</profile>
</a>
</profiles>
</privilegeManager>
<extension>
<name>ChakravestExtension</name>
<type>JAVA</type>
<file>com.chakravest.game.extension.ChakravestApplicationExtension</file>
<propertiesFile></propertiesFile>
<reloadMode>AUTO</reloadMode>
</extension>
<buddyList active="false">
<allowOfflineBuddyVariables>true</allowOfflineBuddyVariables>
<maxItemsPerList>100</maxItemsPerList>
<maxBuddyVariables>15</maxBuddyVariables>
<offlineBuddyVariablesCacheSize>500</offlineBuddyVariablesCacheSize>
<customStorageClass></customStorageClass>
<useTempBuddies>true</useTempBuddies>
<buddyStates class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>Available</string>
<string>Away</string>
<string>Occupied</string>
</a>
</buddyStates>
<badWordsFilter isActive="true"/>
</buddyList>
<databaseManager active="true">
<driverName>com.mysql.jdbc.Driver</driverName>
<connectionString>jdbc:mysql://localhost:3306/mysql</connectionString>
<userName>root</userName>
<password>admin</password>
<testSql>select * from People</testSql>
<maxActiveConnections>10</maxActiveConnections>
<maxIdleConnections>10</maxIdleConnections>
<exhaustedPoolAction>FAIL</exhaustedPoolAction>
<blockTime>3000</blockTime>
</databaseManager>
</zone>