Package sfs2x.client.requests.buddylist
Class InitBuddyListRequest
- java.lang.Object
-
- sfs2x.client.requests.BaseRequest
-
- sfs2x.client.requests.buddylist.InitBuddyListRequest
-
- All Implemented Interfaces:
sfs2x.client.requests.IRequest
public class InitBuddyListRequest extends BaseRequest
Initializes the Buddy List system on the current client.Buddy List system initialization involves loading any previously stored buddy-specific data from the server, such as the current user's buddies list, his previous state and the persistent Buddy Variables. The initialization request is the first operation to be executed in order to be able to use the Buddy List system features. Once the initialization is completed, the buddyListInit event is fired and the user has access to all his previously set data and can start to interact with his buddies; if the initialization failed, a buddyError event is fired.
Example
The following example initializes the Buddy List system:private void someMethod() { sfs.addEventListener(SFSBuddyEvent.BUDDY_LIST_INIT, new IEventListener() { public void dispatch(BaseEvent evt) throws SFSException { System.out.println("Buddy List system initialized successfully"); // Retrieve my buddies list List
buddies = sfs.getBuddyManager().getBuddyList(); // Display the online buddies in a list component in the application interface ... } }); sfs.addEventListener(SFSBuddyEvent.BUDDY_ERROR, new IEventListener() { public void dispatch(BaseEvent evt) throws SFSException { System.out.println("The following error occurred while executing a buddy-related request:" + evt.getArguments().get("errorMessage")); } }); // Initialize the Buddy List system sfs.send(new InitBuddyListRequest()); }
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
KEY_BLIST
* API internal usage only *static java.lang.String
KEY_BUDDY_STATES
* API internal usage only *static java.lang.String
KEY_MY_VARS
* API internal usage only *-
Fields inherited from class sfs2x.client.requests.BaseRequest
AddBuddy, AdminMessage, AutoJoin, BanUser, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, ClusterInviteUsers, ClusterJoinOrCreate, CreateRoom, CreateSFSGame, FindRooms, FindUsers, GameServerConnectionRequired, GenericMessage, GetRoomList, GoOnline, Handshake, InitBuddyList, InvitationReply, InviteUser, JoinRoom, JoinRoomInvite, KEY_ERROR_CODE, KEY_ERROR_PARAMS, KickUser, LeaveRoom, Login, Logout, ManualDisconnection, ModeratorMessage, ObjectMessage, PingPong, PlayerToSpectator, PrivateMessage, PublicMessage, QuickJoinGame, QuickJoinOrCreateRoom, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserPosition, SetUserVariables, SpectatorToPlayer, SubscribeRoomGroup, UnsubscribeRoomGroup
-
-
Constructor Summary
Constructors Constructor Description InitBuddyListRequest()
Creates a new InitBuddyListRequest instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(ISmartFox sfs)
* API internal usage only *void
validate(ISmartFox sfs)
* API internal usage only *-
Methods inherited from class sfs2x.client.requests.BaseRequest
getId, getMessage, getTargetController, isEncrypted, setEncrypted, setId, setTargetController
-
-
-
-
Field Detail
-
KEY_BLIST
public static final java.lang.String KEY_BLIST
* API internal usage only *- See Also:
- Constant Field Values
-
KEY_BUDDY_STATES
public static final java.lang.String KEY_BUDDY_STATES
* API internal usage only *- See Also:
- Constant Field Values
-
KEY_MY_VARS
public static final java.lang.String KEY_MY_VARS
* API internal usage only *- See Also:
- Constant Field Values
-
-