public interface User
Modifier and Type | Method and Description |
---|---|
void |
addCreatedRoom(Room room) |
void |
addJoinedRoom(Room room) |
void |
addPersistentRoomVarReference(Room target) |
boolean |
containsProperty(java.lang.Object key)
Checks whether a custom property exists or not
|
boolean |
containsVariable(java.lang.String varName)
Checks whether or not the User has a specific UserVariable
|
void |
disconnect(IDisconnectionReason reason) |
int |
getBadWordsWarnings() |
BuddyProperties |
getBuddyProperties()
Get the BuddyProperty object
|
Country |
getCountry()
If the geolocation service is enabled in the Zone it will return the location of the user
|
java.util.List<Room> |
getCreatedRooms()
Get a list of Rooms created by this User
|
MMORoom |
getCurrentMMORoom() |
java.lang.String |
getDump()
Return a full dump of the User properties, useful for debugging
|
int |
getFloodWarnings() |
int |
getId()
Get the unique user ID
|
java.lang.String |
getIpAddress()
Return the User IP address
|
java.util.List<Room> |
getJoinedRooms()
A list of Rooms currently joined by the User
|
Room |
getLastJoinedRoom()
A reference to the last Room that was joined by this User
|
java.util.List<BaseMMOItem> |
getLastMMOItemsList() |
java.util.List<User> |
getLastProxyList() |
long |
getLastRequestTime() |
long |
getLoginTime()
Get the user login time (Unix timestamp)
|
int |
getMaxAllowedVariables()
Get the maximum allowed User Variables for this User
|
java.lang.String |
getName()
Get the User name
|
int |
getOwnedRoomsCount()
Get the number of Rooms created by the User
|
java.util.Set<java.lang.Integer> |
getPersistentRoomVarReferences() |
int |
getPlayerId()
Get the playerId of the User (if applicable).
|
int |
getPlayerId(Room room)
Get the playerId for the User in a specific Room
|
java.util.Map<Room,java.lang.Integer> |
getPlayerIds()
Get a map of playerId(s) per Room
This method can be used when a player is currently engaged in multiple games at the same time |
short |
getPrivilegeId()
Return the Privilege ID of the User.
|
java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> |
getProperties()
Get the map with all User properties
|
java.lang.Object |
getProperty(java.lang.Object key)
Get any custom property attached to this User.
|
int |
getReconnectionSeconds() |
ISession |
getSession()
Get the session object linked to this User
|
java.util.List<java.lang.String> |
getSubscribedGroups()
Get a list of Room Groups subscribed by the User
|
ISFSArray |
getUserVariablesData() |
UserVariable |
getVariable(java.lang.String key)
Return a UserVariable.
|
java.util.List<UserVariable> |
getVariables()
Obtain the full list of UserVariables
|
int |
getVariablesCount()
Return the number of UserVariables for this User
|
Zone |
getZone()
Get the Zone where the User is currently logged in
|
boolean |
isBeingKicked() |
boolean |
isConnected()
Check if the User is connected
|
boolean |
isJoinedInRoom(Room room)
Check if a User is joined in a Room
|
boolean |
isJoining() |
boolean |
isLocal()
Returns true if the User is connected to the local cluster node
|
boolean |
isNpc()
Returns the NPC flag
|
boolean |
isPlayer()
Check if the User is a Player in the current Room (only for Game Rooms)
|
boolean |
isPlayer(Room room)
Check if the User is Player in a specific Room
|
boolean |
isSpectator()
Check if the User is a Spectator in the current Room (only for Game Rooms)
|
boolean |
isSpectator(Room room)
Check if the User is Spectator in a specific Room
|
boolean |
isSubscribedToGroup(java.lang.String groupId)
Check if the User is subscribed to a certain Room Group
|
boolean |
isSuperUser()
Check if the User has SuperUser capabilities (kicking/banning etc...)
|
void |
removeCreatedRoom(Room room) |
void |
removeJoinedRoom(Room room) |
void |
removeProperty(java.lang.Object key)
Removes a custom property
|
void |
removeVariable(java.lang.String varName) |
void |
setBadWordsWarnings(int count) |
void |
setBeingKicked(boolean flag) |
void |
setConnected(boolean flag) |
void |
setFloodWarnings(int count) |
void |
setJoining(boolean flag) |
void |
setLastLoginTime(long lastLoginTime) |
void |
setLastMMOItemsList(java.util.List<BaseMMOItem> mmoItemsList) |
void |
setLastProxyList(java.util.List<User> proxyList) |
void |
setLastRequestTime(long millis) |
void |
setMaxAllowedVariables(int max) |
void |
setName(java.lang.String name)
DO NOT use this method
User names cannot be changed at runtime: they are unique and decided at login time exclusively.
|
void |
setPlayerId(int id,
Room room) |
void |
setPrivilegeId(short id) |
void |
setProperty(java.lang.Object key,
java.lang.Object val)
Attach a custom (server-side only) property to the User object
|
void |
setReconnectionSeconds(int seconds) |
void |
setVariable(UserVariable userVariable) |
void |
setVariables(java.util.List<UserVariable> userVariables) |
void |
setZone(Zone zone) |
void |
subscribeGroup(java.lang.String groupId) |
ISFSArray |
toSFSArray() |
ISFSArray |
toSFSArray(Room room) |
void |
unsubscribeGroup(java.lang.String groupId) |
void |
updateLastRequestTime() |
int getId()
ISession getSession()
java.lang.String getIpAddress()
java.lang.String getName()
BuddyProperties getBuddyProperties()
void setName(java.lang.String name)
boolean isLocal()
boolean isNpc()
long getLoginTime()
void setLastLoginTime(long lastLoginTime)
Room getLastJoinedRoom()
java.util.List<Room> getJoinedRooms()
void addJoinedRoom(Room room)
void removeJoinedRoom(Room room)
boolean isJoinedInRoom(Room room)
room
- the Roomvoid addCreatedRoom(Room room)
void removeCreatedRoom(Room room)
java.util.List<Room> getCreatedRooms()
void subscribeGroup(java.lang.String groupId)
void unsubscribeGroup(java.lang.String groupId)
java.util.List<java.lang.String> getSubscribedGroups()
boolean isSubscribedToGroup(java.lang.String groupId)
groupId
- the id of the groupZone getZone()
void setZone(Zone zone)
int getPlayerId()
int getPlayerId(Room room)
room
- getPlayerId()
void setPlayerId(int id, Room room)
java.util.Map<Room,java.lang.Integer> getPlayerIds()
getPlayerId()
boolean isPlayer()
boolean isSpectator()
boolean isPlayer(Room room)
room
- the roomboolean isSpectator(Room room)
room
- the rooomboolean isJoining()
void setJoining(boolean flag)
boolean isConnected()
void setConnected(boolean flag)
boolean isSuperUser()
int getMaxAllowedVariables()
void setMaxAllowedVariables(int max)
java.lang.Object getProperty(java.lang.Object key)
key
- java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> getProperties()
void setProperty(java.lang.Object key, java.lang.Object val)
key
- the property nameval
- the property valueboolean containsProperty(java.lang.Object key)
key
- the name of the propertyvoid removeProperty(java.lang.Object key)
key
- the name of the propertyint getOwnedRoomsCount()
boolean isBeingKicked()
void setBeingKicked(boolean flag)
short getPrivilegeId()
void setPrivilegeId(short id)
UserVariable getVariable(java.lang.String key)
key
- the name of the variablejava.util.List<UserVariable> getVariables()
void setVariable(UserVariable userVariable) throws SFSVariableException
SFSVariableException
void setVariables(java.util.List<UserVariable> userVariables) throws SFSVariableException
SFSVariableException
void removeVariable(java.lang.String varName)
boolean containsVariable(java.lang.String varName)
varName
- the name of the variableint getVariablesCount()
int getBadWordsWarnings()
void setBadWordsWarnings(int count)
int getFloodWarnings()
void setFloodWarnings(int count)
long getLastRequestTime()
void setLastRequestTime(long millis)
void updateLastRequestTime()
ISFSArray getUserVariablesData()
ISFSArray toSFSArray()
void disconnect(IDisconnectionReason reason)
java.lang.String getDump()
int getReconnectionSeconds()
void setReconnectionSeconds(int seconds)
java.util.List<User> getLastProxyList()
void setLastProxyList(java.util.List<User> proxyList)
java.util.List<BaseMMOItem> getLastMMOItemsList()
void setLastMMOItemsList(java.util.List<BaseMMOItem> mmoItemsList)
MMORoom getCurrentMMORoom()
Country getCountry()
void addPersistentRoomVarReference(Room target)
java.util.Set<java.lang.Integer> getPersistentRoomVarReferences()