/*
* Copyright (c) 2006, Second Life Reverse Engineering Team
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the Second Life Reverse Engineering Team nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Timers;
using System.Net;
using System.Collections.Generic;
using libsecondlife.Packets;
namespace libsecondlife
{
///
/// Represents an avatar in Second Life (other than your own)
///
public class Avatar : LLObject
{
#region Avatar Structs
///
/// Positive and negative ratings
///
public struct Statistics
{
/// Positive ratings for Behavior
public int BehaviorPositive;
/// Negative ratings for Behavior
public int BehaviorNegative;
/// Positive ratings for Appearance
public int AppearancePositive;
/// Negative ratings for Appearance
public int AppearanceNegative;
/// Positive ratings for Building
public int BuildingPositive;
/// Negative ratings for Building
public int BuildingNegative;
/// Positive ratings given by this avatar
public int GivenPositive;
/// Negative ratings given by this avatar
public int GivenNegative;
}
///
/// Avatar properties including about text, profile URL, image IDs and
/// publishing settings
///
public struct AvatarProperties
{
/// Should this profile be published on the web
public bool AllowPublish;
/// First Life about text
public string FirstLifeText;
/// First Life image ID
public LLUUID FirstLifeImage;
///
public LLUUID Partner;
///
public string AboutText;
///
public string BornOn;
///
public string CharterMember;
/// Profile image ID
public LLUUID ProfileImage;
/// Is this a mature profile
public bool MaturePublish;
///
public bool Identified;
///
public bool Transacted;
/// Web URL for this profile
public string ProfileURL;
}
///
/// Avatar interests including spoken languages, skills, and "want to"
/// choices
///
public struct Interests
{
/// Languages profile field
public string LanguagesText;
///
public uint SkillsMask;
///
public string SkillsText;
///
public uint WantToMask;
///
public string WantToText;
}
#endregion Avatar Structs
#region Public Members
/// Groups that this avatar is a member of
public List Groups = new List();
/// Online status
public bool Online = false;
/// Positive and negative ratings
public Statistics ProfileStatistics = new Statistics();
/// Avatar properties including about text, profile URL, image IDs and
/// publishing settings
public AvatarProperties ProfileProperties = new AvatarProperties();
/// Avatar interests including spoken languages, skills, and "want to"
/// choices
public Interests ProfileInterests = new Interests();
/// Simulator the avatar is in
public Simulator CurrentSim = null;
#endregion Public Members
/// Full name
public string Name
{
get
{
if (name.Length > 0)
return name;
else if (NameValues.ContainsKey("FirstName") && NameValues.ContainsKey("LastName"))
return (string)NameValues["FirstName"].Value + " " + (string)NameValues["LastName"].Value;
else
return String.Empty;
}
// FIXME: Get rid of this when an AvatarManager is built in to libsl
set { name = value; }
}
/// Active group
public string GroupName
{
get
{
if (NameValues.ContainsKey("Title"))
return (string)NameValues["Title"].Value;
else
return String.Empty;
}
}
/// Gets the local ID of the prim the avatar is sitting on,
/// zero if the avatar is not currently sitting
public uint SittingOn { get { return sittingOn; } }
internal string name = String.Empty;
internal uint sittingOn = 0;
///
/// Default constructor
///
public Avatar()
{
}
}
}