Class SFSZone
- All Implemented Interfaces:
Zone
Overview
The Zone represent an application running in the Server, from a simple chat application to a large scale MMO with dozens of games. Each Zone can contain any number of Rooms organized in Room Groups.Also each Zone provides a number of essential services:
- Room and User management
- Persistent BuddyList system
- Words filtering
- Flood filtering
- Database connection management and pooling
- Event dispatching
- Room persistence
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleancom.smartfoxserver.bitswarm.rdp.TransportConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidchangeRoomCapacity(Room room, int newMaxUsers, int newMaxSpect) voidchangeRoomName(Room room, String newName) voidchangeRoomPasswordState(Room room, String password) voidcheckAndRemove(Room room) booleancontainsGroup(String groupId) Check if the Zone contains the specified GroupbooleancontainsProperty(Object key) Checks the existence of a Zone propertybooleancontainsPublicGroup(String groupId) Check if the Zone contains the specified public GroupcreateRoom(CreateRoomSettings params) Use theSFSApi.createRoom(Zone, CreateRoomSettings, User)method insteadcreateRoom(CreateRoomSettings params, User user) Use theSFSApi.createRoom(Zone, CreateRoomSettings, User)method insteadcom.smartfoxserver.util.IAdminHelperObtain a reference to the Zone's Database Manager.Get the list of Groups that each User will be automatically subscribed to when joining the Zone.getDump()getFilterChain(SystemRequest requestId) Obtain a reference to the Zone's SystemFilterChain.IFloodFilter<?> intgetGroupEvents(String groupId) Get the full list of Room Groups available in the Zone.Get the prefix used by the system to auto-generate guest user names.intgetId()intThe maximum number of Rooms that can be created in the Room.intThe maximum number of users allowed to join the Zone.intThe max number of login attempts (in the same session) a user can fail before being disconnected.intGet the max number of "FindRoom" results for a client request.intGet the max number of "Find User" results for a client request.intGet the max number of people that can be invited a by a single client side JoinRoomInvitationRequestintThe maximum number of characters allowed for a Room nameintThe maximum number of Rooms that a User can create at once.intThe maximum number of Room Variables allowed for each Room.intGet the max allowed idle seconds for the UDP connection.intGet the max allowed idle time for a User.intThe maximum number of characters allowed for a User namesintThe maximum number of User Variables allowed for each User.intThe minimum number of characters allowed for Room namegetName()The name of the Zone.getProperty(Object key) Properties are custom values that can be added or removed from the Zone at run-time.Get a list of names of the "Public" Room Groups available in the Zone.com.smartfoxserver.bitswarm.rdp.TransportConfiggetRoomById(int id) Get a Room from its unique IDgetRoomByName(String name) Get a Room from its nameGet the list of Rooms in the ZonegetRoomListData(List<String> groupIds) getRoomListFromGroup(String groupId) Get the list of Rooms from a specific GroupgetRoomListFromGroupList(Collection<String> groups) Obtain a Room list generated by merging all Rooms from the provided group namescom.smartfoxserver.entities.managers.IRoomManagerObtain the Room Persistence API object.Get the list of Sessions logged in the ZonegetSessionsInGroup(String groupId) Get a list of Sessions from all Rooms in the provided Room GroupgetSessionsListeningToGroup(String groupId) Get a list of Sessions listening for events in a specific Groupintcom.smartfoxserver.util.IResponseThrottlergetUserById(int id) Get a User from its unique IDgetUserByName(String name) Get a User from its namegetUserBySession(ISession session) Get a User from its Session objectintGet the current amount of Users connected to the ZoneintGet the rate (in ms.) at which the UserCountUpdates events are fired to the clients.Get the list of Users logged in the Zonecom.smartfoxserver.entities.managers.IUserManagerintReturn the amount of seconds available for a User to reconnect to the system in case their socket connection goes down.getUsersInGroup(String groupId) Get a list of Users from all Rooms in the provided Room Groupcom.smartfoxserver.util.IWordFiltercom.smartfoxserver.entities.managers.IZoneManagervoidinitRoomPersistence(RoomStorageMode mode, BaseStorageConfig config) Initializes the Room Persistence functionality.booleanisActive()Checks if the Zone is currently enabled in the system or not.booleanTrue if only buddies can be invited by a client side JoinRoomInvitationRequest, false otherwise.booleanDeprecated.booleanCheck if the Zone fires LOGIN events to the Zone extension at login time.booleanTrue if protocol cryptography is turned on in this Zone.booleanToggle the filtering of Buddy messages via the Words Filter.booleanReturns true if the FilterChain was initializedbooleanIf turned on the Zone will apply the Words Filter to private messagesbooleanIf turned on the Zone will apply the Words Filter to Room namesbooleanIf turned on the Zone will apply the Words Filter to User names provided at login timebooleanIf turned on it allows a User to connect from another location while another connection is already active.booleanToggles geolocation for clients.booleanisGroupEventSet(String groupId, SFSRoomEvents eventToCheck) Checks whether a specific Room Event for the specified Group is activebooleanCheck if the Zone allows guest users (those sending no name and no password).booleanisHidden()booleanReturns true if the LagMonitor requests are also actively resetting the User's idle timerbooleanbooleanTrue if the Zone supports HTTP uploads.voidregisterEventsForRoomGroup(String groupId, Set<SFSRoomEvents> flags) voidvoidremoveProperty(Object key) Removes a property.voidremoveRoom(int roomId) voidremoveRoom(Room room) voidremoveRoom(String name) voidremoveUser(int userId) voidremoveUser(ISession session) voidremoveUser(User user) voidremoveUser(String userName) voidremoveUserFromRoom(User user, Room room) voidResets the whole SystemController Filter chain.voidsetActive(boolean flag) Changes the state of the Zone.voidsetAdminHelper(com.smartfoxserver.util.IAdminHelper adminHelper) voidsetAllowInvitationsOnlyForBuddies(boolean allowInvitationsOnlyForBuddies) voidsetBuddyListManager(BuddyListManager buddyListManager) voidsetClientAllowedToOverridRoomEvents(boolean flag) Deprecated.voidsetCustomLogin(boolean flag) voidsetDBManager(IDBManager manager) voidsetDefaultGroups(List<String> groupIDs) voidsetDefaultPlayerIdGeneratorClassName(String className) voidsetEncrypted(boolean value) voidsetExtension(ISFSExtension extension) voidsetFilterBuddyMessages(boolean flag) voidsetFilterChain(SystemRequest requestId, ISystemFilterChain chain) Set a SystemFilterChain for a specific SystemController's Request.voidsetFilterPrivateMessages(boolean flag) voidsetFilterRoomNames(boolean flag) voidsetFilterUserNames(boolean flag) voidsetForceLogout(boolean flag) voidsetGeoLocationEnabled(boolean value) voidsetGuestUserAllowed(boolean flag) voidsetGuestUserNamePrefix(String prefix) voidsetHidden(boolean flag) voidsetId(int id) voidsetLagMonitorKeepAlive(boolean value) voidsetMaxAllowedRooms(int max) voidsetMaxAllowedUsers(int max) voidsetMaxFailedLogins(int value) voidsetMaxFindRoomResults(int value) voidsetMaxFindUserResults(int value) voidsetMaxInvitationsPerRequest(int maxInvitationsPerRequest) voidsetMaxRoomNameChars(int maxRoomNameChars) voidsetMaxRoomsCreatedPerUserLimit(int max) voidsetMaxRoomVariablesAllowed(int max) voidsetMaxUdpIdleSeconds(int seconds) voidsetMaxUserIdleTime(int seconds) voidsetMaxUserNameChars(int max) voidsetMaxUserVariablesAllowed(int max) voidsetMinRoomNameChars(int minRoomNameChars) voidsetPrivilegeManager(PrivilegeManager privilegeManager) voidsetProperty(Object key, Object value) Properties are custom values that can be added or removed from the Zone at run-time.voidsetPublicGroups(List<String> groupIDs) voidsetRdpTxConfig(com.smartfoxserver.bitswarm.rdp.TransportConfig cfg) voidsetUdpKeepAlive(boolean value) When true, sends a ping every few seconds to every UDP connection to keep it alive.voidsetUploadEnabled(boolean val) voidsetUserCountChangeUpdateInterval(int interval) voidsetUserReconnectionSeconds(int seconds) voidsetZoneManager(com.smartfoxserver.entities.managers.IZoneManager manager) toString()voidvalidateUserName(String name)
-
Field Details
-
lagMonitorKeepAlive
public volatile boolean lagMonitorKeepAlive -
rdpTxConfig
public com.smartfoxserver.bitswarm.rdp.TransportConfig rdpTxConfig
-
-
Constructor Details
-
SFSZone
-
-
Method Details
-
getRoomManager
public com.smartfoxserver.entities.managers.IRoomManager getRoomManager()- Specified by:
getRoomManagerin interfaceZone
-
getUserManager
public com.smartfoxserver.entities.managers.IUserManager getUserManager()- Specified by:
getUserManagerin interfaceZone
-
containsGroup
Check if the Zone contains the specified Group- Specified by:
containsGroupin interfaceZone- Returns:
- true if the Zone contains the specified Group
-
containsPublicGroup
Check if the Zone contains the specified public Group- Specified by:
containsPublicGroupin interfaceZone- Returns:
- true if the Zone contains the specified public Group
-
createRoom
Use theSFSApi.createRoom(Zone, CreateRoomSettings, User)method instead- Specified by:
createRoomin interfaceZone- Throws:
SFSCreateRoomException
-
createRoom
Use theSFSApi.createRoom(Zone, CreateRoomSettings, User)method instead- Specified by:
createRoomin interfaceZone- Throws:
SFSCreateRoomException
-
changeRoomName
- Specified by:
changeRoomNamein interfaceZone- Throws:
SFSRoomException
-
changeRoomPasswordState
- Specified by:
changeRoomPasswordStatein interfaceZone
-
changeRoomCapacity
- Specified by:
changeRoomCapacityin interfaceZone
-
addRoom
- Specified by:
addRoomin interfaceZone- Throws:
SFSTooManyRoomsException
-
getGuestUserNamePrefix
Get the prefix used by the system to auto-generate guest user names.Example: by default the prefix is "Guest#"
At the end of the prefix it will be added the unique user id.- Specified by:
getGuestUserNamePrefixin interfaceZone- Returns:
- the user name prefix
-
getUserCount
public int getUserCount()Get the current amount of Users connected to the Zone- Specified by:
getUserCountin interfaceZone- Returns:
- the amount of Users connected to the Zone
-
getTotalRoomCount
public int getTotalRoomCount()- Specified by:
getTotalRoomCountin interfaceZone- Returns:
- the total number of Rooms
-
getGameRoomCount
public int getGameRoomCount()- Specified by:
getGameRoomCountin interfaceZone- Returns:
- the total number of game Rooms
-
getMaxAllowedRooms
public int getMaxAllowedRooms()The maximum number of Rooms that can be created in the Room.- Specified by:
getMaxAllowedRoomsin interfaceZone- Returns:
- the maximum number of Rooms that can be created in the Room.
-
getMaxUserVariablesAllowed
public int getMaxUserVariablesAllowed()The maximum number of User Variables allowed for each User.- Specified by:
getMaxUserVariablesAllowedin interfaceZone- Returns:
- the maximum number of User Variables allowed for each User.
-
getMaxAllowedUsers
public int getMaxAllowedUsers()The maximum number of users allowed to join the Zone.- Specified by:
getMaxAllowedUsersin interfaceZone- Returns:
- the maximum number of users allowed to join the Zone.
-
getMaxRoomsCreatedPerUserLimit
public int getMaxRoomsCreatedPerUserLimit()The maximum number of Rooms that a User can create at once.Example: if the limit is == 3 and the User has created Rooms A, B and C he won't be able to create any more Room at least until any of these Rooms is destroyed.
- Specified by:
getMaxRoomsCreatedPerUserLimitin interfaceZone- Returns:
- the maximum number of Rooms that a User can create at once.
-
getName
The name of the Zone. Each Zone must have a unique name. -
getId
public int getId() -
getProperty
Properties are custom values that can be added or removed from the Zone at run-time. They can be used for many purposes, in particular to keep global references that can be shared across multiple objects in the extension code, Rooms etc...- Specified by:
getPropertyin interfaceZone- Parameters:
key- the name of the property- Returns:
- the value of the property, null if the property doesn't exist
-
removeProperty
Removes a property.- Specified by:
removePropertyin interfaceZone- Parameters:
key- the name of the property.- See Also:
-
getPublicGroups
Get a list of names of the "Public" Room Groups available in the Zone. Public Groups are those in which the client is allowed to create Rooms dynamically. The other Groups can be manipulated only via server side code.- Specified by:
getPublicGroupsin interfaceZone- Returns:
- the list of group ids
-
getGroups
Get the full list of Room Groups available in the Zone. More groups can be added from server side by simply assigning a non-existent Group Id to a newly created Room. As soon as the new Group is detected, it will be added to the Group List -
getDefaultGroups
Get the list of Groups that each User will be automatically subscribed to when joining the Zone.- Specified by:
getDefaultGroupsin interfaceZone- Returns:
- the list of default groups
- See Also:
-
getRoomById
Get a Room from its unique ID- Specified by:
getRoomByIdin interfaceZone- Parameters:
id- the Room id- Returns:
- the Room or null if no Room exists with the specified ID
-
getRoomByName
Get a Room from its name- Specified by:
getRoomByNamein interfaceZone- Parameters:
name- the Room name- Returns:
- the Room or null if no Room exists with the specified name
-
getRoomList
Get the list of Rooms in the Zone- Specified by:
getRoomListin interfaceZone- Returns:
- the room list
-
getRoomListFromGroup
Get the list of Rooms from a specific Group- Specified by:
getRoomListFromGroupin interfaceZone- Parameters:
groupId- the id of the group- Returns:
- the list of Rooms in the specified Group
-
getRoomListFromGroupList
Description copied from interface:ZoneObtain a Room list generated by merging all Rooms from the provided group names- Specified by:
getRoomListFromGroupListin interfaceZone- Parameters:
groups- a list of valid Room Group names- Returns:
- the Room list generated by merging all Rooms from the provided group names
-
getUserById
Get a User from its unique ID- Specified by:
getUserByIdin interfaceZone- Parameters:
id- the User ID- Returns:
- the User, or null if no User exists with the provided ID
-
getUserByName
Get a User from its name- Specified by:
getUserByNamein interfaceZone- Parameters:
name- the User name- Returns:
- the User, or null if no User exists with the provided name
-
getUserBySession
Get a User from its Session object- Specified by:
getUserBySessionin interfaceZone- Parameters:
session- the Session- Returns:
- the User, or null if no User exists for the provided Session. In this case it would mean that the client is connected but not logged id.
-
getUserCountChangeUpdateInterval
public int getUserCountChangeUpdateInterval()Get the rate (in ms.) at which the UserCountUpdates events are fired to the clients.A value of zero will use the default, real-time updating that was also present in SmartFoxServer 1.x In high traffic servers these updates could be thousands per second, so we highly recommend to use a slower update rate in order to optimize the network usage. Reasonable values can be in the range of 500ms - 2000ms
- Specified by:
getUserCountChangeUpdateIntervalin interfaceZone- Returns:
- the interval in milliseconds between each UserCountUpdate
-
getUCountThrottler
public com.smartfoxserver.util.IResponseThrottler getUCountThrottler()- Specified by:
getUCountThrottlerin interfaceZone
-
getDefaultPlayerIdGeneratorClassName
- Specified by:
getDefaultPlayerIdGeneratorClassNamein interfaceZone
-
setDefaultPlayerIdGeneratorClassName
- Specified by:
setDefaultPlayerIdGeneratorClassNamein interfaceZone
-
isUploadEnabled
public boolean isUploadEnabled()True if the Zone supports HTTP uploads.- Specified by:
isUploadEnabledin interfaceZone- Returns:
- true if the Zone supports HTTP uploads.
-
setUploadEnabled
public void setUploadEnabled(boolean val) - Specified by:
setUploadEnabledin interfaceZone
-
isLagMonitorKeepAlive
public boolean isLagMonitorKeepAlive()Description copied from interface:ZoneReturns true if the LagMonitor requests are also actively resetting the User's idle timer- Specified by:
isLagMonitorKeepAlivein interfaceZone
-
setLagMonitorKeepAlive
public void setLagMonitorKeepAlive(boolean value) - Specified by:
setLagMonitorKeepAlivein interfaceZone
-
isFilterChainInited
public boolean isFilterChainInited()Returns true if the FilterChain was initialized- Specified by:
isFilterChainInitedin interfaceZone- Returns:
- true if at least one Filter was added to the FilterChain
-
resetSystemFilterChain
public void resetSystemFilterChain()Resets the whole SystemController Filter chain. All filters for any SystemRequest is removed.- Specified by:
resetSystemFilterChainin interfaceZone
-
isHidden
public boolean isHidden() -
setHidden
public void setHidden(boolean flag) -
getFilterChain
Obtain a reference to the Zone's SystemFilterChain. Here you can add custom filters that will execute before any System Request is handled by the system itself.- Specified by:
getFilterChainin interfaceZone- Parameters:
requestId- the request id associated with the filter chain- Returns:
- the SystemFilterChain
- See Also:
-
setFilterChain
Set a SystemFilterChain for a specific SystemController's Request. For example you can set one ore more filters for the CreateRoom request or the PublicMessage etc... The filter chain will be executed before the request is passed to the SystemController.- Specified by:
setFilterChainin interfaceZone- Parameters:
requestId- the SystemController request Idchain- the filter chain- See Also:
-
getExtension
- Specified by:
getExtensionin interfaceZone
-
setExtension
- Specified by:
setExtensionin interfaceZone
-
getUserReconnectionSeconds
public int getUserReconnectionSeconds()Return the amount of seconds available for a User to reconnect to the system in case their socket connection goes down. A value of zero will turn the reconnection feature off.- Specified by:
getUserReconnectionSecondsin interfaceZone- Returns:
- the amount of seconds to reconnect.
-
setUserReconnectionSeconds
public void setUserReconnectionSeconds(int seconds) - Specified by:
setUserReconnectionSecondsin interfaceZone
-
getMaxUserIdleTime
public int getMaxUserIdleTime()Get the max allowed idle time for a User. When this interval expires the server will disconnect the "idle" User. Any request sent from the client will reset the Idle timer.- Specified by:
getMaxUserIdleTimein interfaceZone- Returns:
- the time in seconds
-
setMaxUserIdleTime
public void setMaxUserIdleTime(int seconds) - Specified by:
setMaxUserIdleTimein interfaceZone
-
getMaxUdpIdleSeconds
public int getMaxUdpIdleSeconds()Get the max allowed idle seconds for the UDP connection. Any request sent from the client will reset the idle timer.- Specified by:
getMaxUdpIdleSecondsin interfaceZone- Returns:
- the time in seconds
-
isUdpKeepAlive
public boolean isUdpKeepAlive()- Specified by:
isUdpKeepAlivein interfaceZone- Returns:
- true if the keep alive system is active for the UDP connection
-
setUdpKeepAlive
public void setUdpKeepAlive(boolean value) Description copied from interface:ZoneWhen true, sends a ping every few seconds to every UDP connection to keep it alive. This is only useful if the UDP communication is expected to have "gaps" for a some time (e.g. more than ten seconds). In most action games UDP updates happen at a constant rate and there is no need to use an extra keep-alive signal.Default value is false
- Specified by:
setUdpKeepAlivein interfaceZone- Parameters:
value-
-
setMaxUdpIdleSeconds
public void setMaxUdpIdleSeconds(int seconds) - Specified by:
setMaxUdpIdleSecondsin interfaceZone
-
getUsersInGroup
Get a list of Users from all Rooms in the provided Room Group- Specified by:
getUsersInGroupin interfaceZone- Parameters:
groupId- a group Id- Returns:
- the list of Users from all Rooms in the provided Room Group
-
getSessionsInGroup
Get a list of Sessions from all Rooms in the provided Room Group- Specified by:
getSessionsInGroupin interfaceZone- Parameters:
groupId- a group Id- Returns:
- the list of Sessions from all Rooms in the provided Room Group
-
getSessionsListeningToGroup
Description copied from interface:ZoneGet a list of Sessions listening for events in a specific Group- Specified by:
getSessionsListeningToGroupin interfaceZone- Parameters:
groupId- a group Id- Returns:
- the list of Sessions listening for events in a specific Group
-
getSessionList
Get the list of Sessions logged in the Zone- Specified by:
getSessionListin interfaceZone- Returns:
- the list of Sessions logged in the Zone
-
getUserList
Get the list of Users logged in the Zone- Specified by:
getUserListin interfaceZone- Returns:
- the list of Users logged in the Zone
-
getZoneManager
public com.smartfoxserver.entities.managers.IZoneManager getZoneManager()- Specified by:
getZoneManagerin interfaceZone
-
isActive
public boolean isActive()Checks if the Zone is currently enabled in the system or not. Inactive Zones won't allow anyone to login. You can deactivate a Zone at runtime (from the AdminTool) if you are planning to remove it. All Users will be disconnected. -
isClientAllowedToOverridRoomEvents
public boolean isClientAllowedToOverridRoomEvents()Deprecated.- Specified by:
isClientAllowedToOverridRoomEventsin interfaceZone
-
isCustomLogin
public boolean isCustomLogin()Check if the Zone fires LOGIN events to the Zone extension at login time. This allows the developer to take full control over the login process in their extension code, like checking the credentials etc...- Specified by:
isCustomLoginin interfaceZone- Returns:
- true if the Zone uses a custom login process
- See Also:
-
isForceLogout
public boolean isForceLogout()If turned on it allows a User to connect from another location while another connection is already active. This will result in the first session to be disconnected and the new one to be started.- Specified by:
isForceLogoutin interfaceZone- Returns:
- true if the feature is turned on
-
isGuestUserAllowed
public boolean isGuestUserAllowed()Check if the Zone allows guest users (those sending no name and no password). If so the server will automatically set up a "guest name" for the User.- Specified by:
isGuestUserAllowedin interfaceZone- Returns:
- true if the Zone allows guests
- See Also:
-
isFilterUserNames
public boolean isFilterUserNames()If turned on the Zone will apply the Words Filter to User names provided at login time- Specified by:
isFilterUserNamesin interfaceZone- Returns:
- true if filtering is turned on
-
isFilterRoomNames
public boolean isFilterRoomNames()If turned on the Zone will apply the Words Filter to Room names- Specified by:
isFilterRoomNamesin interfaceZone- Returns:
- true if filtering is turned on
-
setFilterRoomNames
public void setFilterRoomNames(boolean flag) - Specified by:
setFilterRoomNamesin interfaceZone
-
isFilterBuddyMessages
public boolean isFilterBuddyMessages()Toggle the filtering of Buddy messages via the Words Filter.- Specified by:
isFilterBuddyMessagesin interfaceZone- Returns:
- true if buddy messages filtering is turned on
-
setFilterBuddyMessages
public void setFilterBuddyMessages(boolean flag) - Specified by:
setFilterBuddyMessagesin interfaceZone
-
containsProperty
Checks the existence of a Zone property- Specified by:
containsPropertyin interfaceZone- Parameters:
key- the name of the property- Returns:
- true if the property exists
-
registerEventsForRoomGroup
- Specified by:
registerEventsForRoomGroupin interfaceZone
-
isGroupEventSet
Checks whether a specific Room Event for the specified Group is active- Specified by:
isGroupEventSetin interfaceZone- Parameters:
groupId- the group nameeventToCheck- the type of event to check- Returns:
- true if the event is active
-
getGroupEvents
- Specified by:
getGroupEventsin interfaceZone
-
removeRoom
public void removeRoom(int roomId) - Specified by:
removeRoomin interfaceZone
-
removeRoom
- Specified by:
removeRoomin interfaceZone
-
removeRoom
- Specified by:
removeRoomin interfaceZone
-
checkAndRemove
- Specified by:
checkAndRemovein interfaceZone
-
removeUserFromRoom
- Specified by:
removeUserFromRoomin interfaceZone
-
getMinRoomNameChars
public int getMinRoomNameChars()The minimum number of characters allowed for Room name- Specified by:
getMinRoomNameCharsin interfaceZone- Returns:
- the minimum number of characters allowed for Room name
-
setMinRoomNameChars
public void setMinRoomNameChars(int minRoomNameChars) - Specified by:
setMinRoomNameCharsin interfaceZone
-
getMaxRoomNameChars
public int getMaxRoomNameChars()The maximum number of characters allowed for a Room name- Specified by:
getMaxRoomNameCharsin interfaceZone- Returns:
- the maximum number of characters allowed for a Room name
-
setMaxRoomNameChars
public void setMaxRoomNameChars(int maxRoomNameChars) - Specified by:
setMaxRoomNameCharsin interfaceZone
-
getMaxUserNameChars
public int getMaxUserNameChars()The maximum number of characters allowed for a User names- Specified by:
getMaxUserNameCharsin interfaceZone- Returns:
- the maximum number of characters allowed for a User names
-
setMaxUserNameChars
public void setMaxUserNameChars(int max) - Specified by:
setMaxUserNameCharsin interfaceZone
-
setActive
public void setActive(boolean flag) Changes the state of the Zone. De-activating a Zone at runtime will result in an abrupt disconnection of all Users. Use only when strictly necessary. -
setId
public void setId(int id) -
setClientAllowedToOverridRoomEvents
public void setClientAllowedToOverridRoomEvents(boolean flag) Deprecated.- Specified by:
setClientAllowedToOverridRoomEventsin interfaceZone
-
setCustomLogin
public void setCustomLogin(boolean flag) - Specified by:
setCustomLoginin interfaceZone
-
setForceLogout
public void setForceLogout(boolean flag) - Specified by:
setForceLogoutin interfaceZone
-
setGuestUserAllowed
public void setGuestUserAllowed(boolean flag) - Specified by:
setGuestUserAllowedin interfaceZone
-
setFilterUserNames
public void setFilterUserNames(boolean flag) - Specified by:
setFilterUserNamesin interfaceZone
-
setGuestUserNamePrefix
- Specified by:
setGuestUserNamePrefixin interfaceZone
-
setMaxAllowedRooms
public void setMaxAllowedRooms(int max) - Specified by:
setMaxAllowedRoomsin interfaceZone
-
setMaxAllowedUsers
public void setMaxAllowedUsers(int max) - Specified by:
setMaxAllowedUsersin interfaceZone
-
setMaxUserVariablesAllowed
public void setMaxUserVariablesAllowed(int max) - Specified by:
setMaxUserVariablesAllowedin interfaceZone
-
setMaxRoomsCreatedPerUserLimit
public void setMaxRoomsCreatedPerUserLimit(int max) - Specified by:
setMaxRoomsCreatedPerUserLimitin interfaceZone
-
setProperty
Properties are custom values that can be added or removed from the Zone at run-time. They can be used for many purposes, in particular to keep global references that can be shared across multiple objects in the extension code, Rooms etc...- Specified by:
setPropertyin interfaceZone- Parameters:
key- the name of the propertyvalue- the value of the property
-
setPublicGroups
- Specified by:
setPublicGroupsin interfaceZone
-
setDefaultGroups
- Specified by:
setDefaultGroupsin interfaceZone
-
setUserCountChangeUpdateInterval
public void setUserCountChangeUpdateInterval(int interval) - Specified by:
setUserCountChangeUpdateIntervalin interfaceZone
-
setZoneManager
public void setZoneManager(com.smartfoxserver.entities.managers.IZoneManager manager) - Specified by:
setZoneManagerin interfaceZone
-
validateUserName
- Specified by:
validateUserNamein interfaceZone- Throws:
SFSException
-
getFloodFilter
- Specified by:
getFloodFilterin interfaceZone
-
getWordFilter
public com.smartfoxserver.util.IWordFilter getWordFilter()- Specified by:
getWordFilterin interfaceZone
-
removeAllUsers
public void removeAllUsers()- Specified by:
removeAllUsersin interfaceZone
-
removeUser
public void removeUser(int userId) - Specified by:
removeUserin interfaceZone
-
removeUser
- Specified by:
removeUserin interfaceZone
-
removeUser
- Specified by:
removeUserin interfaceZone
-
removeUser
- Specified by:
removeUserin interfaceZone
-
getMaxRoomVariablesAllowed
public int getMaxRoomVariablesAllowed()The maximum number of Room Variables allowed for each Room.NOTE: each Room can set its own limit of Room Variables. However when a Room is created from a client request this Zone limit is applied.
- Specified by:
getMaxRoomVariablesAllowedin interfaceZone- Returns:
- the maximum number of Room Variables allowed for each Room.
-
setMaxRoomVariablesAllowed
public void setMaxRoomVariablesAllowed(int max) - Specified by:
setMaxRoomVariablesAllowedin interfaceZone
-
getPrivilegeManager
- Specified by:
getPrivilegeManagerin interfaceZone
-
setPrivilegeManager
- Specified by:
setPrivilegeManagerin interfaceZone
-
getBuddyListManager
- Specified by:
getBuddyListManagerin interfaceZone
-
setBuddyListManager
- Specified by:
setBuddyListManagerin interfaceZone
-
getDBManager
Obtain a reference to the Zone's Database Manager.- Specified by:
getDBManagerin interfaceZone- See Also:
-
setDBManager
- Specified by:
setDBManagerin interfaceZone
-
isFilterPrivateMessages
public boolean isFilterPrivateMessages()If turned on the Zone will apply the Words Filter to private messages- Specified by:
isFilterPrivateMessagesin interfaceZone- Returns:
- true if the Words Filter is applied to private messages
-
setFilterPrivateMessages
public void setFilterPrivateMessages(boolean flag) - Specified by:
setFilterPrivateMessagesin interfaceZone
-
login
- Specified by:
loginin interfaceZone- Throws:
SFSLoginException
-
getRoomListData
- Specified by:
getRoomListDatain interfaceZone
-
getRoomListData
- Specified by:
getRoomListDatain interfaceZone
-
toString
-
getDump
-
getAdminHelper
public com.smartfoxserver.util.IAdminHelper getAdminHelper() -
setAdminHelper
public void setAdminHelper(com.smartfoxserver.util.IAdminHelper adminHelper) -
initRoomPersistence
Initializes the Room Persistence functionality. Typically you will invoke this method in the init() method of your Extension.The Room Persistence API provides two different storage systems for Rooms:
- FILE_STORAGE: which uses the local file system to store Room data. Doesn't require a config object.
- DB_STORAGE which uses an external database (via the Zone's DBManager) to store Room data. Requires a config object.
- Specified by:
initRoomPersistencein interfaceZone- Parameters:
config- an optional config object. At the moment it is required only for DB_STORAGE mode only.- See Also:
-
getRoomPersistenceApi
Obtain the Room Persistence API object.IMPORTANT: it is necessary to first initialize the Persistence system before accessing it. Failing this will return a null object.
- Specified by:
getRoomPersistenceApiin interfaceZone- Returns:
- the Room Persistence API object or null if the API was not initialized.
- See Also:
-
isEncrypted
public boolean isEncrypted()True if protocol cryptography is turned on in this Zone. Requests sent unencrypted when the flag is turned ON will result in a sudden client disconnection.- Specified by:
isEncryptedin interfaceZone- Returns:
- true if protocol cryptography is turned on in this Zone
-
setEncrypted
public void setEncrypted(boolean value) - Specified by:
setEncryptedin interfaceZone
-
getMaxInvitationsPerRequest
public int getMaxInvitationsPerRequest()Get the max number of people that can be invited a by a single client side JoinRoomInvitationRequest- Specified by:
getMaxInvitationsPerRequestin interfaceZone- Returns:
- the max number of people that can be invited a by a single client side JoinRoomInvitationRequest
-
setMaxInvitationsPerRequest
public void setMaxInvitationsPerRequest(int maxInvitationsPerRequest) - Specified by:
setMaxInvitationsPerRequestin interfaceZone
-
isAllowInvitationsOnlyForBuddies
public boolean isAllowInvitationsOnlyForBuddies()True if only buddies can be invited by a client side JoinRoomInvitationRequest, false otherwise.- Specified by:
isAllowInvitationsOnlyForBuddiesin interfaceZone- Returns:
- true if only buddies can be invited by a client side JoinRoomInvitationRequest, false otherwise.
-
setAllowInvitationsOnlyForBuddies
public void setAllowInvitationsOnlyForBuddies(boolean allowInvitationsOnlyForBuddies) - Specified by:
setAllowInvitationsOnlyForBuddiesin interfaceZone
-
getMaxFailedLogins
public int getMaxFailedLogins()Description copied from interface:ZoneThe max number of login attempts (in the same session) a user can fail before being disconnected.- Specified by:
getMaxFailedLoginsin interfaceZone- Returns:
- the max number of login attempts (in the same session) a user can fail before being disconnected.
-
setMaxFailedLogins
public void setMaxFailedLogins(int value) - Specified by:
setMaxFailedLoginsin interfaceZone
-
isGeoLocationEnabled
public boolean isGeoLocationEnabled()Description copied from interface:ZoneToggles geolocation for clients.- Specified by:
isGeoLocationEnabledin interfaceZone- Returns:
- true if geolocation is enabled in this Zone
-
setGeoLocationEnabled
public void setGeoLocationEnabled(boolean value) - Specified by:
setGeoLocationEnabledin interfaceZone
-
getMaxFindUserResults
public int getMaxFindUserResults()Description copied from interface:ZoneGet the max number of "Find User" results for a client request. Default is 50.- Specified by:
getMaxFindUserResultsin interfaceZone- Returns:
- the max number of results for "Find User" requests from client side.
-
setMaxFindUserResults
public void setMaxFindUserResults(int value) - Specified by:
setMaxFindUserResultsin interfaceZone
-
getMaxFindRoomResults
public int getMaxFindRoomResults()Description copied from interface:ZoneGet the max number of "FindRoom" results for a client request. Default is 50.- Specified by:
getMaxFindRoomResultsin interfaceZone- Returns:
- the max number of results for "FindRoom" requests from client side.
-
setMaxFindRoomResults
public void setMaxFindRoomResults(int value) - Specified by:
setMaxFindRoomResultsin interfaceZone
-
getRdpTxConfig
public com.smartfoxserver.bitswarm.rdp.TransportConfig getRdpTxConfig()- Specified by:
getRdpTxConfigin interfaceZone
-
setRdpTxConfig
public void setRdpTxConfig(com.smartfoxserver.bitswarm.rdp.TransportConfig cfg) - Specified by:
setRdpTxConfigin interfaceZone
-