2008-08-16 02:04:20 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using OpenMetaverse;
|
|
|
|
|
using OpenMetaverse.Packets;
|
|
|
|
|
|
|
|
|
|
namespace Simian
|
|
|
|
|
{
|
2009-03-12 23:02:42 +00:00
|
|
|
public class AgentInfo
|
2008-08-16 02:04:20 +00:00
|
|
|
{
|
2008-09-24 14:55:52 +00:00
|
|
|
// Account
|
2009-03-12 23:02:42 +00:00
|
|
|
public UUID ID;
|
2008-08-18 04:40:05 +00:00
|
|
|
public string FirstName;
|
|
|
|
|
public string LastName;
|
2008-09-24 14:55:52 +00:00
|
|
|
public string PasswordHash;
|
|
|
|
|
public uint CreationTime;
|
|
|
|
|
public uint LastLoginTime;
|
|
|
|
|
public string AccessLevel;
|
|
|
|
|
public int GodLevel;
|
2008-08-19 08:23:25 +00:00
|
|
|
public int Balance;
|
2008-09-24 14:55:52 +00:00
|
|
|
|
|
|
|
|
// Inventory
|
|
|
|
|
public UUID InventoryRoot;
|
|
|
|
|
public UUID InventoryLibraryRoot;
|
|
|
|
|
public UUID InventoryLibraryOwner;
|
|
|
|
|
|
|
|
|
|
// Location
|
|
|
|
|
public ulong HomeRegionHandle;
|
|
|
|
|
public Vector3 HomePosition;
|
|
|
|
|
public Vector3 HomeLookAt;
|
|
|
|
|
|
|
|
|
|
// Profile
|
|
|
|
|
public UUID PartnerID;
|
|
|
|
|
public int ProfileCanDo;
|
|
|
|
|
public int ProfileWantDo;
|
|
|
|
|
public string ProfileAboutText;
|
|
|
|
|
public string ProfileFirstText;
|
2008-10-01 00:12:59 +00:00
|
|
|
public string ProfileBornOn;
|
|
|
|
|
public string ProfileURL;
|
2008-09-24 14:55:52 +00:00
|
|
|
public UUID ProfileImage;
|
|
|
|
|
public UUID ProfileFirstImage;
|
2008-10-01 00:12:59 +00:00
|
|
|
public ProfileFlags ProfileFlags;
|
2008-09-24 14:55:52 +00:00
|
|
|
|
|
|
|
|
// Appearance
|
|
|
|
|
public byte[] VisualParams;
|
2008-10-01 00:12:59 +00:00
|
|
|
//public byte[] Texture;
|
2008-09-24 14:55:52 +00:00
|
|
|
public float Height;
|
|
|
|
|
public UUID ShapeItem;
|
|
|
|
|
public UUID SkinItem;
|
|
|
|
|
public UUID HairItem;
|
|
|
|
|
public UUID EyesItem;
|
|
|
|
|
public UUID ShirtItem;
|
|
|
|
|
public UUID PantsItem;
|
|
|
|
|
public UUID ShoesItem;
|
|
|
|
|
public UUID SocksItem;
|
|
|
|
|
public UUID JacketItem;
|
|
|
|
|
public UUID GlovesItem;
|
|
|
|
|
public UUID UndershirtItem;
|
|
|
|
|
public UUID UnderpantsItem;
|
|
|
|
|
public UUID SkirtItem;
|
2009-03-12 23:02:42 +00:00
|
|
|
}
|
2008-09-24 14:55:52 +00:00
|
|
|
|
2009-03-12 23:02:42 +00:00
|
|
|
public class Agent
|
|
|
|
|
{
|
|
|
|
|
public AgentInfo Info;
|
2009-03-03 21:01:57 +00:00
|
|
|
public SimulationObject Avatar;
|
2008-09-24 14:55:52 +00:00
|
|
|
public UUID SessionID;
|
|
|
|
|
public UUID SecureSessionID;
|
|
|
|
|
public uint CircuitCode;
|
2008-08-20 03:46:11 +00:00
|
|
|
public bool Running;
|
2008-08-24 22:42:14 +00:00
|
|
|
public int TickFall;
|
|
|
|
|
public int TickJump;
|
2008-08-30 18:23:15 +00:00
|
|
|
public int TickLastPacketReceived;
|
2008-08-18 05:11:13 +00:00
|
|
|
public AgentManager.ControlFlags ControlFlags = AgentManager.ControlFlags.NONE;
|
2008-08-22 19:20:02 +00:00
|
|
|
public AnimationSet Animations = new AnimationSet();
|
2009-03-03 21:01:57 +00:00
|
|
|
public AgentState State;
|
|
|
|
|
public bool HideTitle;
|
2009-03-12 23:02:42 +00:00
|
|
|
public Uri SeedCapability;
|
|
|
|
|
public Vector3 CurrentLookAt;
|
|
|
|
|
public UUID RequestedSitTarget;
|
|
|
|
|
public Vector3 RequestedSitOffset;
|
2009-03-16 18:02:48 +00:00
|
|
|
public bool[] NeighborConnections = new bool[8];
|
2009-03-03 21:01:57 +00:00
|
|
|
|
|
|
|
|
public UUID ID
|
|
|
|
|
{
|
|
|
|
|
get { return Avatar.Prim.ID; }
|
|
|
|
|
}
|
2008-09-24 14:55:52 +00:00
|
|
|
|
|
|
|
|
public string FullName
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2009-03-12 23:02:42 +00:00
|
|
|
bool hasFirst = !String.IsNullOrEmpty(Info.FirstName);
|
|
|
|
|
bool hasLast = !String.IsNullOrEmpty(Info.LastName);
|
2008-09-24 14:55:52 +00:00
|
|
|
|
|
|
|
|
if (hasFirst && hasLast)
|
2009-03-12 23:02:42 +00:00
|
|
|
return String.Format("{0} {1}", Info.FirstName, Info.LastName);
|
2008-09-24 14:55:52 +00:00
|
|
|
else if (hasFirst)
|
2009-03-12 23:02:42 +00:00
|
|
|
return Info.FirstName;
|
2008-09-24 14:55:52 +00:00
|
|
|
else if (hasLast)
|
2009-03-12 23:02:42 +00:00
|
|
|
return Info.LastName;
|
2008-09-24 14:55:52 +00:00
|
|
|
else
|
|
|
|
|
return String.Empty;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-03-02 23:00:28 +00:00
|
|
|
|
2009-03-12 23:02:42 +00:00
|
|
|
public Agent(SimulationObject avatar, AgentInfo info)
|
2009-03-02 23:00:28 +00:00
|
|
|
{
|
2009-03-03 21:01:57 +00:00
|
|
|
Avatar = avatar;
|
2009-03-12 23:02:42 +00:00
|
|
|
Info = info;
|
2009-03-02 23:00:28 +00:00
|
|
|
}
|
2009-03-17 00:17:07 +00:00
|
|
|
|
|
|
|
|
public AvatarAppearancePacket BuildAppearancePacket()
|
|
|
|
|
{
|
|
|
|
|
AvatarAppearancePacket appearance = new AvatarAppearancePacket();
|
|
|
|
|
appearance.ObjectData.TextureEntry = this.Avatar.Prim.Textures.GetBytes();
|
|
|
|
|
appearance.Sender.ID = this.ID;
|
|
|
|
|
appearance.Sender.IsTrial = false;
|
|
|
|
|
|
|
|
|
|
int count = this.Info.VisualParams != null ? this.Info.VisualParams.Length : 0;
|
|
|
|
|
|
|
|
|
|
appearance.VisualParam = new AvatarAppearancePacket.VisualParamBlock[count];
|
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
|
{
|
|
|
|
|
appearance.VisualParam[i] = new AvatarAppearancePacket.VisualParamBlock();
|
|
|
|
|
appearance.VisualParam[i].ParamValue = this.Info.VisualParams[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (count != 218)
|
|
|
|
|
Logger.Log("Built an odd appearance packet with VisualParams.Length=" + count, Helpers.LogLevel.Warning);
|
|
|
|
|
|
|
|
|
|
return appearance;
|
|
|
|
|
}
|
2008-08-16 02:04:20 +00:00
|
|
|
}
|
|
|
|
|
}
|