public interface ISFSBuddyApi
Modifier and Type | Method and Description |
---|---|
void |
addBuddy(User owner,
java.lang.String buddyName,
boolean isTemp,
boolean fireClientEvent,
boolean fireServerEvent)
Adds a new buddy to the BuddyList of the specified User.
|
void |
addBuddy(Zone zone,
java.lang.String ownerName,
java.lang.String buddyName,
boolean isTemp,
boolean fireClientEvent,
boolean fireServerEvent)
Adds a buddy to the User's buddy list even if the User is not online at the moment
This feature is not implemented yet.
|
void |
blockBuddy(User owner,
java.lang.String buddyName,
boolean isBlocked,
boolean fireClientEvent,
boolean fireServerEvent)
Block/Unblock a Buddy in the owner's BuddyList
Blocked buddies won't be able to see the owner online status and send him messages or updates
|
com.smartfoxserver.v2.api.ISFSBuddyResponseApi |
getResponseAPI() |
void |
goOnline(User user,
boolean online,
boolean fireServerEvent)
Activates/De-activates the Buddy ONLINE status of the User.
|
BuddyList |
initBuddyList(User user,
boolean fireServerEvent)
Initialize the buddy list for the requested User.
|
void |
removeBuddy(User owner,
java.lang.String buddyName,
boolean fireClientEvent,
boolean fireServerEvent)
Remove a Buddy from the owner's BuddyList
|
void |
removeBuddy(Zone zone,
java.lang.String ownerName,
java.lang.String buddyName,
boolean fireClientEvent,
boolean fireServerEvent)
Removes a Buddy from the owner's BuddyList even if the User is not online at the moment
This feature is not implemented yet.
|
void |
sendBuddyMessage(User sender,
User recipient,
java.lang.String message,
ISFSObject params)
Send a Buddy Message to any Buddy in your list.
|
void |
setBuddyVariables(User owner,
java.util.List<BuddyVariable> buddyVariables,
boolean fireClientEvent,
boolean fireServerEvent)
Set any number of BuddyVariables for the specified owner
|
com.smartfoxserver.v2.api.ISFSBuddyResponseApi getResponseAPI()
BuddyList initBuddyList(User user, boolean fireServerEvent) throws java.io.IOException
user
- the UserfireServerEvent
- if true fires a server side event (BUDDY_LIST_INIT)java.io.IOException
void goOnline(User user, boolean online, boolean fireServerEvent) throws SFSBuddyListException
user
- the Useronline
- the online statusfireServerEvent
- if true fires a server side event (BUDDY_ONLINE)SFSBuddyListException
void addBuddy(Zone zone, java.lang.String ownerName, java.lang.String buddyName, boolean isTemp, boolean fireClientEvent, boolean fireServerEvent) throws SFSBuddyListException
zone
- ownerName
- buddyName
- isTemp
- fireClientEvent
- fireServerEvent
- SFSBuddyListException
void addBuddy(User owner, java.lang.String buddyName, boolean isTemp, boolean fireClientEvent, boolean fireServerEvent) throws SFSBuddyListException
owner
- the owner UserbuddyName
- the name of the buddy to addisTemp
- if true, the Buddy is only temporary and will be lost when the user logs outfireClientEvent
- if true, send a client updatefireServerEvent
- if true, fire a server event (BUDDY_ADDED)SFSBuddyListException
- an error might occur if the BuddyList is full or the buddy was already addedvoid setBuddyVariables(User owner, java.util.List<BuddyVariable> buddyVariables, boolean fireClientEvent, boolean fireServerEvent) throws SFSBuddyListException
owner
- the owner UserbuddyVariables
- a list of variablesfireClientEvent
- if true, send a client updatefireServerEvent
- if true, fire a server event (BUDDY_VARIABLES_UPDATE)SFSBuddyListException
- an error might occur if the limit of variables allowed is exceededvoid removeBuddy(User owner, java.lang.String buddyName, boolean fireClientEvent, boolean fireServerEvent)
owner
- the ownerbuddyName
- the Buddy namefireClientEvent
- if true send a client updatefireServerEvent
- if true fire a server side event (BUDDY_REMOVED)void removeBuddy(Zone zone, java.lang.String ownerName, java.lang.String buddyName, boolean fireClientEvent, boolean fireServerEvent)
zone
- ownerName
- buddyName
- fireClientEvent
- fireServerEvent
- void blockBuddy(User owner, java.lang.String buddyName, boolean isBlocked, boolean fireClientEvent, boolean fireServerEvent)
owner
- the BuddyList ownerbuddyName
- the name of the Buddy to block/unblockisBlocked
- the 'blocked' flagfireClientEvent
- if true send a client updatefireServerEvent
- if true fire a server side event (BUDDY_BLOCK_UPDATE)void sendBuddyMessage(User sender, User recipient, java.lang.String message, ISFSObject params) throws SFSBuddyListException
sender
- the sender of the messagerecipient
- the recipient of the message (must be a Buddy in the sender's BuddyList)message
- the messageparams
- custom parametersSFSBuddyListException
- thrown if the Buddy is not in the sender's Buddy List or if the recipient has blocked the sender