public interface Zone
Modifier and Type | Method and Description |
---|---|
void |
addDisabledSystemEvent(java.lang.String eventID)
INTERNAL
|
void |
addRoom(Room room)
INTERNAL
Instead use
SFSApi.createRoom(Zone, CreateRoomSettings, User) |
void |
changeRoomCapacity(Room room,
int newMaxUsers,
int maxMaxSpect)
INTERNAL
Instead use
SFSApi.changeRoomCapacity(User, Room, int, int) |
void |
changeRoomName(Room room,
java.lang.String newName)
INTERNAL
Instead use
SFSApi.changeRoomName(User, Room, String) |
void |
changeRoomPasswordState(Room room,
java.lang.String password)
INTERNAL
Instead use
SFSApi.changeRoomPassword(User, Room, String) |
void |
checkAndRemove(Room room) |
boolean |
containsGroup(java.lang.String groupId)
Check if the Zone contains the specified Group
|
boolean |
containsProperty(java.lang.Object key)
Checks the existance of a Zone property
|
boolean |
containsPublicGroup(java.lang.String groupId)
Check if the Zone contains the specified public Group
|
Room |
createRoom(CreateRoomSettings params) |
Room |
createRoom(CreateRoomSettings params,
User user) |
BuddyListManager |
getBuddyListManager()
INTERNAL
Instead use
SFSBuddyApi |
IDBManager |
getDBManager()
Obtain a reference to the Zone's Database Manager.
|
java.util.List<java.lang.String> |
getDefaultGroups()
Get the list of Groups that each User will be automatically subscribed to when joining the Zone.
|
java.lang.String |
getDefaultPlayerIdGeneratorClassName() |
java.lang.String |
getDump() |
ISFSExtension |
getExtension()
INTERNAL
|
ISystemFilterChain |
getFilterChain(SystemRequest requestId)
Obtain a reference to the Zone's SystemFilterChain.
|
IFloodFilter |
getFloodFilter()
INTERNAL
|
int |
getGameRoomCount() |
java.util.Set<SFSRoomEvents> |
getGroupEvents(java.lang.String groupId) |
java.util.List<java.lang.String> |
getGroups()
Get the full list of Room Groups available in the Zone.
|
java.lang.String |
getGuestUserNamePrefix()
Get the prefix used by the system to auto-generate guest user names.
|
int |
getId()
A numeric ID used by the AdminTool.
|
int |
getMaxAllowedRooms()
The maximum number of Rooms that can be created in the Room.
|
int |
getMaxAllowedUsers()
The maximum number of users allowed to join the Zone.
|
int |
getMaxFailedLogins()
The max number of login attempts (in the same session) a user can fail before being disconnected.
|
int |
getMaxFindRoomResults()
Get the max number of "FindRoom" results for a client request.
|
int |
getMaxFindUserResults()
Get the max number of "Find User" results for a client request.
|
int |
getMaxInvitationsPerRequest()
Get the max number of people that can be invited a by a single client side JoinRoomInvitationRequest
|
int |
getMaxRoomNameChars()
The maximum number of characters allowed for a Room name
|
int |
getMaxRoomsCreatedPerUserLimit()
The maximum number of Rooms that a User can create at once.
|
int |
getMaxRoomVariablesAllowed()
The maximum number of Room Variables allowed for each Room.
|
int |
getMaxUserIdleTime()
Get the max allowed idle time for a User.
|
int |
getMaxUserVariablesAllowed()
The maximum number of User Variables allowed for each User.
|
int |
getMinRoomNameChars()
The minimum number of characters allowed for Room name
|
java.lang.String |
getName()
The name of the Zone.
|
PrivilegeManager |
getPrivilegeManager() |
java.lang.Object |
getProperty(java.lang.Object key)
Properties are custom values that can be added or removed from the Zone at run-time.
|
java.util.List<java.lang.String> |
getPublicGroups()
Get a list of names of the "Public" Room Groups available in the Zone.
|
Room |
getRoomById(int id)
Get a Room from its unique ID
|
Room |
getRoomByName(java.lang.String name)
Get a Room from its name
|
java.util.List<Room> |
getRoomList()
Get the list of Rooms in the Zone
|
ISFSArray |
getRoomListData()
INTERNAL
|
ISFSArray |
getRoomListData(java.util.List<java.lang.String> groupIds)
INTERNAL
|
java.util.List<Room> |
getRoomListFromGroup(java.lang.String groupId)
Get the list of Rooms from a specific Group
|
com.smartfoxserver.v2.entities.managers.IRoomManager |
getRoomManager()
Obtain a reference to the internal Room Manager
|
IRoomStorage |
getRoomPersistenceApi()
Obtain the Room Persistence API object.
|
java.util.Collection<ISession> |
getSessionList()
Get the list of Sessions logged in the Zone
|
java.util.Collection<ISession> |
getSessionsInGroup(java.lang.String groupId)
Get a list of Sessions from all Rooms in the provided Room Group
|
java.util.Collection<ISession> |
getSessionsListeningToGroup(java.lang.String groupId)
Get a list of Sessions listening for events in a specific Group
|
int |
getTotalRoomCount() |
com.smartfoxserver.v2.util.IResponseThrottler |
getUCountThrottler()
INTERNAL
|
User |
getUserById(int id)
Get a User from its unique ID
|
User |
getUserByName(java.lang.String name)
Get a User from its name
|
User |
getUserBySession(ISession session)
Get a User from its Session object
|
int |
getUserCount()
Get the current amount of Users connected to the Zone
|
int |
getUserCountChangeUpdateInterval()
Get the rate (in ms.) at which the UserCountUpdates events are fired to the clients.
|
java.util.Collection<User> |
getUserList()
Get the list of Users logged in the Zone
|
com.smartfoxserver.v2.entities.managers.IUserManager |
getUserManager() |
int |
getUserReconnectionSeconds()
Return the amount of seconds available for a User to reconnect to the system in case their socket connection goes
down.
|
java.util.Collection<User> |
getUsersInGroup(java.lang.String groupId)
Get a list of Users from all Rooms in the provided Room Group
|
IWordFilter |
getWordFilter()
INTERNAL
|
com.smartfoxserver.v2.entities.managers.IZoneManager |
getZoneManager() |
void |
initRoomPersistence(RoomStorageMode mode,
BaseStorageConfig config)
Initializes the Room Persistence functionality.
|
boolean |
isActive()
Checks if the Zone is currently enabled in the system or not.
|
boolean |
isAllowInvitationsOnlyForBuddies()
True if only buddies can be invited by a client side JoinRoomInvitationRequest, false otherwise.
|
boolean |
isClientAllowedToOverridRoomEvents() |
boolean |
isCustomLogin()
Check if the Zone fires LOGIN events to the Zone extension at login time.
|
boolean |
isEncrypted()
True if protocol cryptography is turned on in this Zone.
|
boolean |
isFilterBuddyMessages()
Toggle the filtering of Buddy messages via the Words Filter.
|
boolean |
isFilterChainInited()
Returns true if the FilterChain was initialized
|
boolean |
isFilterPrivateMessages()
If turned on the Zone will apply the Words Filter to private messages
|
boolean |
isFilterRoomNames()
If turned on the Zone will apply the Words Filter to Room names
|
boolean |
isFilterUserNames()
If turned on the Zone will apply the Words Filter to User names provided at login time
|
boolean |
isForceLogout()
If turned on it allows a User to connect from another location while another connection is already active.
|
boolean |
isGeoLocationEnabled()
Toggles geolocation for clients.
|
boolean |
isGroupEventSet(java.lang.String groupId,
SFSRoomEvents eventToCheck)
Checks whether a specific Room Event for the specified Group is active
|
boolean |
isGuestUserAllowed()
Check if the Zone allows guest users (those sending no name and no password).
|
boolean |
isHidden()
INTERNAL
|
boolean |
isSystemEventAllowed(java.lang.String eventID)
INTERNAL
|
boolean |
isUploadEnabled()
True if the Zone supports HTTP uploads.
|
User |
login(LoginData loginData)
|
void |
registerEventsForRoomGroup(java.lang.String groupId,
java.util.Set<SFSRoomEvents> flags) |
void |
removeAllUsers() |
void |
removeDisabledSystemEvent(java.lang.String eventID)
INTERNAL
|
void |
removeProperty(java.lang.Object key)
Remove a property.
|
void |
removeRoom(int roomId)
INTERNAL
Instead use
SFSApi.removeRoom(Room) |
void |
removeRoom(Room room)
INTERNAL
Instead use
SFSApi.removeRoom(Room) |
void |
removeRoom(java.lang.String name)
INTERNAL
Instead use
SFSApi.removeRoom(Room) |
void |
removeUser(int userId)
INTERNAL
Instead use
SFSApi.disconnectUser(User) |
void |
removeUser(ISession session)
INTERNAL
Instead use
SFSApi.disconnect(ISession) |
void |
removeUser(java.lang.String userName)
INTERNAL
Instead use
SFSApi.disconnectUser(User) |
void |
removeUser(User user)
INTERNAL
Instead use
SFSApi.disconnectUser(User) |
void |
removeUserFromRoom(User user,
Room room)
INTERNAL
Instead use
SFSApi.leaveRoom(User, Room) |
void |
resetSystemFilterChain()
Resets the whole SystemController Filter chain.
|
void |
setActive(boolean flag)
Changes the state of the Zone.
|
void |
setAllowInvitationsOnlyForBuddies(boolean allowInvitationsOnlyForBuddies)
Set to true if only buddies can be invited by a client side JoinRoomInvitationRequest, false otherwise.
|
void |
setBuddyListManager(BuddyListManager buddyListManager)
INTERNAL
|
void |
setClientAllowedToOverridRoomEvents(boolean flag) |
void |
setCustomLogin(boolean flag)
Set the Zone as Custom login.
|
void |
setDBManager(IDBManager manager)
INTERNAL
|
void |
setDefaultGroups(java.util.List<java.lang.String> groupIDs) |
void |
setDefaultPlayerIdGeneratorClassName(java.lang.String className) |
void |
setEncrypted(boolean value)
Toggles the protocol cryptography.
|
void |
setExtension(ISFSExtension extension)
INTERNAL
|
void |
setFilterBuddyMessages(boolean flag)
If turned on the Zone will apply the Words Filter to Buddy messages
|
void |
setFilterChain(SystemRequest requestId,
ISystemFilterChain chain)
Set a SystemFilterChain for a specific SystemController's Request.
|
void |
setFilterPrivateMessages(boolean flag)
Toggle the filtering of private messages via the Words Filter.
|
void |
setFilterRoomNames(boolean flag)
Toggle the filtering of Room names via the Words Filter.
|
void |
setFilterUserNames(boolean flag)
Toggle the filtering of User names via the Words Filter at login time.
|
void |
setForceLogout(boolean flag)
If turned on it allows a User to connect from another location while another connection is already active.
|
void |
setGeoLocationEnabled(boolean value)
Toggles geolocation for clients.
|
void |
setGuestUserAllowed(boolean flag)
Toggles the Zone guest users (login with no name and no password).
|
void |
setGuestUserNamePrefix(java.lang.String prefix)
Set the prefix used by the system to auto-generate guest user names.
|
void |
setHidden(boolean flag)
INTERNAL
|
void |
setId(int id)
A numeric ID used by the AdminTool.
|
void |
setMaxAllowedRooms(int max)
Set the maximum number of Rooms that can be created in the Room.
|
void |
setMaxAllowedUsers(int max)
Set the maximum number of users allowed to join the Zone.
|
void |
setMaxFailedLogins(int value)
Set the max number of login attempts (in the same session) a user can fail before being disconnected.
|
void |
setMaxFindRoomResults(int value)
Set the max number of "FindRoom" results for a client request.
|
void |
setMaxFindUserResults(int value)
Set the max number of "FindUser" results for a client request.
|
void |
setMaxInvitationsPerRequest(int maxInvitationsPerRequest)
Set the max number of people that can be invited a by a single client side JoinRoomInvitationRequest
|
void |
setMaxRoomNameChars(int max)
Set the maximum number of characters allowed for a Room name
|
void |
setMaxRoomsCreatedPerUserLimit(int max)
Set the maximum number of Rooms that a User can create at once.
|
void |
setMaxRoomVariablesAllowed(int max)
Set the maximum number of Room variables allowed in the Room
|
void |
setMaxUserIdleTime(int seconds)
Set the max allowed idle time for a User.
|
void |
setMaxUserVariablesAllowed(int max)
Set the maximum number of User Variables allowed for each User.
|
void |
setMinRoomNameChars(int min)
Set the minimum number of characters allowed for a Room name
|
void |
setPrivilegeManager(PrivilegeManager privilegeManager) |
void |
setProperty(java.lang.Object key,
java.lang.Object value)
Properties are custom values that can be added or removed from the Zone at run-time.
|
void |
setPublicGroups(java.util.List<java.lang.String> groupIDs) |
void |
setUploadEnabled(boolean val)
Switches on/off the ability to upload data via HTTP.
|
void |
setUserCountChangeUpdateInterval(int interval)
Set the rate (in ms.) at which the UserCountUpdates events are fired to the clients.
|
void |
setUserReconnectionSeconds(int seconds)
Set the amount of seconds available for a User to reconnect to the system in case their socket connection goes
down.
|
void |
setZoneManager(com.smartfoxserver.v2.entities.managers.IZoneManager manager) |
void |
validateUserName(java.lang.String name) |
com.smartfoxserver.v2.entities.managers.IUserManager getUserManager()
boolean isActive()
void setActive(boolean flag)
flag
- the state of the Zoneboolean isHidden()
void setHidden(boolean flag)
void setId(int id)
id
- the idjava.lang.String getName()
int getId()
int getMaxAllowedUsers()
void setMaxAllowedUsers(int max)
max
- the max allowed Usersint getMaxAllowedRooms()
void setMaxAllowedRooms(int max)
max
- the maximum number of Rooms that can be created in the Room.int getMaxRoomsCreatedPerUserLimit()
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.
void setMaxRoomsCreatedPerUserLimit(int max)
max
- the maximum number of Rooms that a User can create at once.int getMaxUserVariablesAllowed()
void setMaxUserVariablesAllowed(int max)
max
- the maximum number of User Variables allowed for each User.int getMaxRoomVariablesAllowed()
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.
void setMaxRoomVariablesAllowed(int max)
max
- the maximum number of Room variables allowed in the 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.
int getMinRoomNameChars()
void setMinRoomNameChars(int min)
min
- the minimum number of characters allowed for Room nameint getMaxRoomNameChars()
void setMaxRoomNameChars(int max)
max
- the maximum number of characters allowed for a Room nameint getUserCountChangeUpdateInterval()
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
void setUserCountChangeUpdateInterval(int interval)
interval
- the interval in ms between each UserCountUpdate. Recommended range: 500-2000ms.int getMaxUserIdleTime()
void setMaxUserIdleTime(int seconds)
seconds
- the intervalboolean isCustomLogin()
SFSEvent
,
SFSEventType
boolean isForceLogout()
void setForceLogout(boolean flag)
flag
- void setCustomLogin(boolean flag)
flag
- SFSEvent
,
SFSEventType
boolean isGuestUserAllowed()
getGuestUserNamePrefix()
void setGuestUserAllowed(boolean flag)
flag
- getGuestUserNamePrefix()
boolean isFilterUserNames()
void setFilterUserNames(boolean flag)
flag
- boolean isFilterRoomNames()
void setFilterRoomNames(boolean flag)
flag
- a booleanboolean isFilterPrivateMessages()
void setFilterPrivateMessages(boolean flag)
flag
- boolean isFilterBuddyMessages()
void setFilterBuddyMessages(boolean flag)
flag
- int getUserReconnectionSeconds()
void setUserReconnectionSeconds(int seconds)
seconds
- the amount of seconds to reconnectjava.lang.String getGuestUserNamePrefix()
Example: by default the prefix is "Guest#"
At the end of the prefix it will be added the unique user id.
void setGuestUserNamePrefix(java.lang.String prefix)
Example: by default the prefix is "Guest#"
At the end of the prefix it will be added the unique user id.
prefix
- java.lang.String getDefaultPlayerIdGeneratorClassName()
void setDefaultPlayerIdGeneratorClassName(java.lang.String className)
boolean isUploadEnabled()
void setUploadEnabled(boolean val)
SFSEventType.FILE_UPLOAD
event to be fired
at Zone Level.boolean isGeoLocationEnabled()
void setGeoLocationEnabled(boolean value)
NOTE:IP address geolocation is done via a local database so the added performance cost is negligible.
value
- true to enable the geolocation service, false to turn it off. Default = falsejava.util.List<java.lang.String> getPublicGroups()
void setPublicGroups(java.util.List<java.lang.String> groupIDs)
java.util.List<java.lang.String> getGroups()
java.util.List<java.lang.String> getDefaultGroups()
SFSApi.subscribeRoomGroup(User, String)
void setDefaultGroups(java.util.List<java.lang.String> groupIDs)
PrivilegeManager getPrivilegeManager()
void setPrivilegeManager(PrivilegeManager privilegeManager)
int getUserCount()
int getTotalRoomCount()
int getGameRoomCount()
Room createRoom(CreateRoomSettings params) throws SFSCreateRoomException
SFSCreateRoomException
Room createRoom(CreateRoomSettings params, User user) throws SFSCreateRoomException
SFSCreateRoomException
boolean isClientAllowedToOverridRoomEvents()
void setClientAllowedToOverridRoomEvents(boolean flag)
void registerEventsForRoomGroup(java.lang.String groupId, java.util.Set<SFSRoomEvents> flags)
boolean isGroupEventSet(java.lang.String groupId, SFSRoomEvents eventToCheck)
groupId
- the group nameeventToCheck
- the type of event to checkjava.util.Set<SFSRoomEvents> getGroupEvents(java.lang.String groupId)
com.smartfoxserver.v2.entities.managers.IRoomManager getRoomManager()
boolean containsGroup(java.lang.String groupId)
boolean containsPublicGroup(java.lang.String groupId)
java.lang.Object getProperty(java.lang.Object key)
key
- the name of the propertyvoid setProperty(java.lang.Object key, java.lang.Object value)
key
- the name of the propertyvalue
- the value of the propertyboolean containsProperty(java.lang.Object key)
key
- the name of the propertyvoid removeProperty(java.lang.Object key)
key
- the name of the property.setProperty(Object, Object)
com.smartfoxserver.v2.entities.managers.IZoneManager getZoneManager()
void setZoneManager(com.smartfoxserver.v2.entities.managers.IZoneManager manager)
java.util.List<Room> getRoomList()
java.util.List<Room> getRoomListFromGroup(java.lang.String groupId)
groupId
- the id of the groupRoom getRoomById(int id)
id
- the Room idRoom getRoomByName(java.lang.String name)
name
- the Room namevoid addRoom(Room room) throws SFSTooManyRoomsException
Instead use SFSApi.createRoom(Zone, CreateRoomSettings, User)
SFSTooManyRoomsException
void removeRoom(Room room)
Instead use SFSApi.removeRoom(Room)
void removeRoom(int roomId)
Instead use SFSApi.removeRoom(Room)
void removeRoom(java.lang.String name)
Instead use SFSApi.removeRoom(Room)
void checkAndRemove(Room room)
void changeRoomName(Room room, java.lang.String newName) throws SFSRoomException
Instead use SFSApi.changeRoomName(User, Room, String)
SFSRoomException
void changeRoomPasswordState(Room room, java.lang.String password)
Instead use SFSApi.changeRoomPassword(User, Room, String)
void changeRoomCapacity(Room room, int newMaxUsers, int maxMaxSpect)
Instead use SFSApi.changeRoomCapacity(User, Room, int, int)
void validateUserName(java.lang.String name) throws SFSException
SFSException
User getUserById(int id)
id
- the User IDUser getUserByName(java.lang.String name)
name
- the User nameUser getUserBySession(ISession session)
session
- the Sessionjava.util.Collection<User> getUsersInGroup(java.lang.String groupId)
groupId
- a group Idjava.util.Collection<ISession> getSessionsInGroup(java.lang.String groupId)
groupId
- a group Idjava.util.Collection<ISession> getSessionsListeningToGroup(java.lang.String groupId)
groupId
- a group Idjava.util.Collection<ISession> getSessionList()
java.util.Collection<User> getUserList()
void removeAllUsers()
ISystemFilterChain getFilterChain(SystemRequest requestId)
requestId
- the request id associated with the filter chainISystemFilterChain
,
ISystemFilter
void setFilterChain(SystemRequest requestId, ISystemFilterChain chain)
requestId
- the SystemController request Idchain
- the filter chainSysControllerFilterChain
,
SysControllerFilter
boolean isFilterChainInited()
void resetSystemFilterChain()
void removeUser(int userId)
Instead use SFSApi.disconnectUser(User)
void removeUser(java.lang.String userName)
Instead use SFSApi.disconnectUser(User)
void removeUser(ISession session)
Instead use SFSApi.disconnect(ISession)
void removeUser(User user)
Instead use SFSApi.disconnectUser(User)
void removeUserFromRoom(User user, Room room)
Instead use SFSApi.leaveRoom(User, Room)
com.smartfoxserver.v2.util.IResponseThrottler getUCountThrottler()
IWordFilter getWordFilter()
IFloodFilter getFloodFilter()
ISFSExtension getExtension()
void setExtension(ISFSExtension extension)
IDBManager getDBManager()
SFSDBManager
void setDBManager(IDBManager manager)
void initRoomPersistence(RoomStorageMode mode, BaseStorageConfig config)
The Room Persistence API provides two different storage systems for Rooms:
config
- an optional config object. At the moment it is required only for DB_STORAGE mode only.RoomStorageMode
,
SFSDBManager
,
IRoomStorage
IRoomStorage getRoomPersistenceApi()
IMPORTANT: it is necessary to first initialize the Persistence system before accessing it. Failing this will return a null object.
initRoomPersistence(RoomStorageMode, BaseStorageConfig)
,
IRoomStorage
void addDisabledSystemEvent(java.lang.String eventID)
void removeDisabledSystemEvent(java.lang.String eventID)
boolean isSystemEventAllowed(java.lang.String eventID)
User login(LoginData loginData) throws SFSLoginException
Instead use SFSApi.login(ISession, String, String, String, com.smartfoxserver.v2.entities.data.ISFSObject)
SFSLoginException
ISFSArray getRoomListData()
ISFSArray getRoomListData(java.util.List<java.lang.String> groupIds)
BuddyListManager getBuddyListManager()
Instead use SFSBuddyApi
void setBuddyListManager(BuddyListManager buddyListManager)
boolean isEncrypted()
void setEncrypted(boolean value)
value
- toggles protocol cryptography.int getMaxInvitationsPerRequest()
void setMaxInvitationsPerRequest(int maxInvitationsPerRequest)
maxInvitationsPerRequest
- the max number of people that can be invited in each requestboolean isAllowInvitationsOnlyForBuddies()
void setAllowInvitationsOnlyForBuddies(boolean allowInvitationsOnlyForBuddies)
allowInvitationsOnlyForBuddies
- int getMaxFailedLogins()
void setMaxFailedLogins(int value)
value
- the max number of login attempts (in the same session) a user can fail before being disconnected.int getMaxFindUserResults()
the
- max number of results for "Find User" requests from client side.void setMaxFindUserResults(int value)
the
- max number of results for "FindUser" requests from client side.int getMaxFindRoomResults()
the
- max number of results for "FindRoom" requests from client side.void setMaxFindRoomResults(int value)
the
- max number of results for "FindRoom" requests from client side.java.lang.String getDump()