C# Class OpenMetaverse.FriendsManager

This class is used to add and remove avatars from your friends list and to manage their permission.
Show file Open project: 3di/3di-viewer-rei-libs Class Usage Examples

Public Properties

Property Type Description
FriendList FriendInfo>.InternalDictionary
FriendRequests UUID>.InternalDictionary

Public Methods

Method Description
AcceptFriendship ( UUID fromAgentID, UUID imSessionID ) : void

Accept a friendship request

DeclineFriendship ( UUID fromAgentID, UUID imSessionID ) : void

Decline a friendship request

GrantRights ( UUID friendID, FriendRights rights ) : void

Change the rights of a friend avatar.

This method will implicitly set the rights to those passed in the rights parameter.

MapFriend ( UUID friendID ) : void

Use to map a friends location on the grid.

E:OnFriendFound

OfferFriendship ( UUID agentID ) : void

Offer friendship to an avatar.

OnFindAgentReplyHandler ( Packet packet, Simulator simulator ) : void

Handle friend location updates

TerminateFriendship ( UUID agentID ) : void

Terminate a friendship with an avatar

TrackFriend ( UUID friendID ) : void

Use to track a friends movement on the grid

Private Methods

Method Description
Avatars_OnAvatarNames ( string>.Dictionary names ) : void

This handles the asynchronous response of a RequestAvatarNames call.

ChangeUserRightsHandler ( Packet packet, Simulator simulator ) : void

Handle notifications sent when a friend rights change. This notification is also received when my own rights change.

FriendsManager ( GridClient client ) : System

Internal constructor

MainAvatar_InstantMessage ( InstantMessage im, Simulator simulator ) : void

Handles relevant messages from the server encapsulated in instant messages.

Network_OnConnect ( object sender ) : void

Called when a connection to the SL server is established. The list of friend avatars is populated from XML returned by the login server. That list contains the avatar's id and right, but no names. Here is where those names are requested.

Network_OnLoginResponse ( bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData ) : void
OfflineNotificationHandler ( Packet packet, Simulator simulator ) : void

Handle notifications sent when a friends has gone offline.

OnlineNotificationHandler ( Packet packet, Simulator simulator ) : void

Handle notifications sent when a friends has come online.

TerminateFriendshipHandler ( Packet packet, Simulator simulator ) : void

Fired when another friend terminates friendship. We need to remove them from our cached list.

Method Details

AcceptFriendship() public method

Accept a friendship request
public AcceptFriendship ( UUID fromAgentID, UUID imSessionID ) : void
fromAgentID UUID agentID of avatatar to form friendship with
imSessionID UUID imSessionID of the friendship request message
return void

DeclineFriendship() public method

Decline a friendship request
public DeclineFriendship ( UUID fromAgentID, UUID imSessionID ) : void
fromAgentID UUID of friend
imSessionID UUID imSessionID of the friendship request message
return void

GrantRights() public method

Change the rights of a friend avatar.
This method will implicitly set the rights to those passed in the rights parameter.
public GrantRights ( UUID friendID, FriendRights rights ) : void
friendID UUID the of the friend
rights FriendRights the new rights to give the friend
return void

MapFriend() public method

Use to map a friends location on the grid.
E:OnFriendFound
public MapFriend ( UUID friendID ) : void
friendID UUID Friends UUID to find
return void

OfferFriendship() public method

Offer friendship to an avatar.
public OfferFriendship ( UUID agentID ) : void
agentID UUID System ID of the avatar you are offering friendship to
return void

OnFindAgentReplyHandler() public method

Handle friend location updates
public OnFindAgentReplyHandler ( Packet packet, Simulator simulator ) : void
packet OpenMetaverse.Packets.Packet The Packet
simulator Simulator The Simulator
return void

TerminateFriendship() public method

Terminate a friendship with an avatar
public TerminateFriendship ( UUID agentID ) : void
agentID UUID System ID of the avatar you are terminating the friendship with
return void

TrackFriend() public method

Use to track a friends movement on the grid
public TrackFriend ( UUID friendID ) : void
friendID UUID Friends Key
return void

Property Details

FriendList public property

A dictionary of key/value pairs containing known friends of this avatar. The Key is the UUID of the friend, the value is a FriendInfo object that contains detailed information including permissions you have and have given to the friend
public InternalDictionary FriendList
return FriendInfo>.InternalDictionary

FriendRequests public property

A Dictionary of key/value pairs containing current pending frienship offers. The key is the UUID of the avatar making the request, the value is the UUID of the request which is used to accept or decline the friendship offer
public InternalDictionary FriendRequests
return UUID>.InternalDictionary