OpenMetaverse Protocol Library Developers API Documentation
AvatarUpdateEventArgs Class
NamespacesOpenMetaverseAvatarUpdateEventArgs
Provides data for the AvatarUpdateevent
Declaration Syntax
C#
public 
class 
AvatarUpdateEventArgs : 
EventArgs
Members
All Members Constructors Properties



Icon Member Description
AvatarUpdateEventArgs(Simulator, Avatar, UInt16, Boolean)
Construct a new instance of the AvatarUpdateEventArgs class

Avatar
Get the Avatardata

IsNew
true if the Avatardid not exist in the dictionary before this update (always true if avatar tracking has been disabled)

Simulator
Get the simulator the object originated from

TimeDilation
Get the simulator time dilation

Remarks

The AvatarUpdateevent occurs when the simulator sends an ObjectUpdatePacketcontaining Avatar data

Note 1: The AvatarUpdateevent will not be raised when the object is an Avatar

Note 2: It is possible for the AvatarUpdateto be raised twice for the same avatar if for example the avatar moved to a new simulator, then returned to the current simulator

Examples
The following code example uses the Avatarproperty to make a request for the top picks using the RequestAvatarPicks(UUID)method in the AvatarManagerclass to display the names of our own agents picks listings on the Consolewindow.
  Copy imageCopy
// subscribe to the AvatarUpdate
event to get our information
Client.Objects.AvatarUpdate += Objects_AvatarUpdate;
Client.Avatars.AvatarPicksReply += Avatars_AvatarPicksReply;

private 
void Objects_AvatarUpdate(
object sender,
AvatarUpdateEventArgs e)
{
    
// we only want our own data
    
if (e.Avatar.LocalID ==
Client.Self.LocalID)
    {    
        
// Unsubscribe from the avatar
update event to prevent a loop
        
// where we continually request the
picks every time we get an update for ourselves
        Client.Objects.AvatarUpdate -= Objects_AvatarUpdate;
        
// make the top picks request
through AvatarManager
        Client.Avatars.RequestAvatarPicks(e.Avatar.ID);
    }
}

private 
void
Avatars_AvatarPicksReply(
object sender,
AvatarPicksReplyEventArgs e)
{
    
// we'll unsubscribe from the
AvatarPicksReply event since we now have the data 
    
// we were looking for
    Client.Avatars.AvatarPicksReply -= Avatars_AvatarPicksReply;
    
// loop through the dictionary and
extract the names of the top picks from our profile
    
foreach (
var pickName 
in e.Picks.Values)
    {
        Console.WriteLine(pickName);
    }
}
Inheritance Hierarchy
Object
EventArgs
  AvatarUpdateEventArgs
See Also

Assembly: OpenMetaverse(Module: OpenMetaverse.dll) Version: 0.9.3.3318 (0.9.3.3318)