Merge branch 'master' of /var/git/opensim/
commit
dcd5cf6bde
|
@ -111,6 +111,10 @@ namespace OpenSim.Framework
|
||||||
SetDefaultParams();
|
SetDefaultParams();
|
||||||
SetHeight();
|
SetHeight();
|
||||||
|
|
||||||
|
m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
|
||||||
|
for (int i = 0 ; i < AvatarWearable.MAX_WEARABLES ; i++ )
|
||||||
|
m_wearables[i] = new AvatarWearable();
|
||||||
|
|
||||||
m_attachments = new Dictionary<int, List<AvatarAttachment>>();
|
m_attachments = new Dictionary<int, List<AvatarAttachment>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,10 +176,11 @@ namespace OpenSim.Framework
|
||||||
m_serial = appearance.Serial;
|
m_serial = appearance.Serial;
|
||||||
m_owner = appearance.Owner;
|
m_owner = appearance.Owner;
|
||||||
|
|
||||||
m_wearables = null;
|
m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
|
||||||
|
for (int i = 0 ; i < AvatarWearable.MAX_WEARABLES ; i++ )
|
||||||
|
m_wearables[i] = new AvatarWearable();
|
||||||
if (appearance.Wearables != null)
|
if (appearance.Wearables != null)
|
||||||
{
|
{
|
||||||
m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES]; //should be 15 of these
|
|
||||||
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
|
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
|
||||||
SetWearable(i,appearance.Wearables[i]);
|
SetWearable(i,appearance.Wearables[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace OpenSim.Framework
|
||||||
public static readonly int UNDERPANTS = 11;
|
public static readonly int UNDERPANTS = 11;
|
||||||
public static readonly int SKIRT = 12;
|
public static readonly int SKIRT = 12;
|
||||||
public static readonly int ALPHA = 13;
|
public static readonly int ALPHA = 13;
|
||||||
public static readonly int TATTOO = 15;
|
public static readonly int TATTOO = 14;
|
||||||
|
|
||||||
public static readonly int MAX_WEARABLES = 15;
|
public static readonly int MAX_WEARABLES = 15;
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,6 @@ namespace OpenSim.Services.AvatarService
|
||||||
m_log.Debug("[AVATAR SERVICE]: Starting avatar service");
|
m_log.Debug("[AVATAR SERVICE]: Starting avatar service");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get|SetAppearance should preserve existing semantics
|
|
||||||
// until AvatarData can be removed completely
|
|
||||||
public AvatarAppearance GetAppearance(UUID principalID)
|
public AvatarAppearance GetAppearance(UUID principalID)
|
||||||
{
|
{
|
||||||
AvatarData avatar = GetAvatar(principalID);
|
AvatarData avatar = GetAvatar(principalID);
|
||||||
|
@ -68,12 +66,15 @@ namespace OpenSim.Services.AvatarService
|
||||||
public AvatarData GetAvatar(UUID principalID)
|
public AvatarData GetAvatar(UUID principalID)
|
||||||
{
|
{
|
||||||
AvatarBaseData[] av = m_Database.Get("PrincipalID", principalID.ToString());
|
AvatarBaseData[] av = m_Database.Get("PrincipalID", principalID.ToString());
|
||||||
if (av.Length == 0)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
AvatarData ret = new AvatarData();
|
AvatarData ret = new AvatarData();
|
||||||
ret.Data = new Dictionary<string,string>();
|
ret.Data = new Dictionary<string,string>();
|
||||||
|
|
||||||
|
if (av.Length == 0)
|
||||||
|
{
|
||||||
|
ret.AvatarType = 1; // SL avatar
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (AvatarBaseData b in av)
|
foreach (AvatarBaseData b in av)
|
||||||
{
|
{
|
||||||
if (b.Data["Name"] == "AvatarType")
|
if (b.Data["Name"] == "AvatarType")
|
||||||
|
|
|
@ -190,60 +190,75 @@ namespace OpenSim.Services.Interfaces
|
||||||
AvatarAppearance appearance = new AvatarAppearance(owner);
|
AvatarAppearance appearance = new AvatarAppearance(owner);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
appearance.Serial = Int32.Parse(Data["Serial"]);
|
if (Data.ContainsKey("Serial"))
|
||||||
|
appearance.Serial = Int32.Parse(Data["Serial"]);
|
||||||
|
|
||||||
// Wearables
|
// Wearables
|
||||||
appearance.Wearables[AvatarWearable.BODY].Wear(
|
if (Data.ContainsKey("BodyItem"))
|
||||||
UUID.Parse(Data["BodyItem"]),
|
appearance.Wearables[AvatarWearable.BODY].Wear(
|
||||||
UUID.Parse(Data["BodyAsset"]));
|
UUID.Parse(Data["BodyItem"]),
|
||||||
|
UUID.Parse(Data["BodyAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.SKIN].Wear(
|
if (Data.ContainsKey("SkinItem"))
|
||||||
UUID.Parse(Data["SkinItem"]),
|
appearance.Wearables[AvatarWearable.SKIN].Wear(
|
||||||
UUID.Parse(Data["SkinAsset"]));
|
UUID.Parse(Data["SkinItem"]),
|
||||||
|
UUID.Parse(Data["SkinAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.HAIR].Wear(
|
if (Data.ContainsKey("HairItem"))
|
||||||
UUID.Parse(Data["HairItem"]),
|
appearance.Wearables[AvatarWearable.HAIR].Wear(
|
||||||
UUID.Parse(Data["HairAsset"]));
|
UUID.Parse(Data["HairItem"]),
|
||||||
|
UUID.Parse(Data["HairAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.EYES].Wear(
|
if (Data.ContainsKey("EyesItem"))
|
||||||
UUID.Parse(Data["EyesItem"]),
|
appearance.Wearables[AvatarWearable.EYES].Wear(
|
||||||
UUID.Parse(Data["EyesAsset"]));
|
UUID.Parse(Data["EyesItem"]),
|
||||||
|
UUID.Parse(Data["EyesAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.SHIRT].Wear(
|
if (Data.ContainsKey("ShirtItem"))
|
||||||
UUID.Parse(Data["ShirtItem"]),
|
appearance.Wearables[AvatarWearable.SHIRT].Wear(
|
||||||
UUID.Parse(Data["ShirtAsset"]));
|
UUID.Parse(Data["ShirtItem"]),
|
||||||
|
UUID.Parse(Data["ShirtAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.PANTS].Wear(
|
if (Data.ContainsKey("PantsItem"))
|
||||||
UUID.Parse(Data["PantsItem"]),
|
appearance.Wearables[AvatarWearable.PANTS].Wear(
|
||||||
UUID.Parse(Data["PantsAsset"]));
|
UUID.Parse(Data["PantsItem"]),
|
||||||
|
UUID.Parse(Data["PantsAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.SHOES].Wear(
|
if (Data.ContainsKey("ShoesItem"))
|
||||||
UUID.Parse(Data["ShoesItem"]),
|
appearance.Wearables[AvatarWearable.SHOES].Wear(
|
||||||
UUID.Parse(Data["ShoesAsset"]));
|
UUID.Parse(Data["ShoesItem"]),
|
||||||
|
UUID.Parse(Data["ShoesAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.SOCKS].Wear(
|
if (Data.ContainsKey("SocksItem"))
|
||||||
UUID.Parse(Data["SocksItem"]),
|
appearance.Wearables[AvatarWearable.SOCKS].Wear(
|
||||||
UUID.Parse(Data["SocksAsset"]));
|
UUID.Parse(Data["SocksItem"]),
|
||||||
|
UUID.Parse(Data["SocksAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.JACKET].Wear(
|
if (Data.ContainsKey("JacketItem"))
|
||||||
UUID.Parse(Data["JacketItem"]),
|
appearance.Wearables[AvatarWearable.JACKET].Wear(
|
||||||
UUID.Parse(Data["JacketAsset"]));
|
UUID.Parse(Data["JacketItem"]),
|
||||||
|
UUID.Parse(Data["JacketAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.GLOVES].Wear(
|
if (Data.ContainsKey("GlovesItem"))
|
||||||
UUID.Parse(Data["GlovesItem"]),
|
appearance.Wearables[AvatarWearable.GLOVES].Wear(
|
||||||
UUID.Parse(Data["GlovesAsset"]));
|
UUID.Parse(Data["GlovesItem"]),
|
||||||
|
UUID.Parse(Data["GlovesAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear(
|
if (Data.ContainsKey("UnderShirtItem"))
|
||||||
UUID.Parse(Data["UnderShirtItem"]),
|
appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear(
|
||||||
UUID.Parse(Data["UnderShirtAsset"]));
|
UUID.Parse(Data["UnderShirtItem"]),
|
||||||
|
UUID.Parse(Data["UnderShirtAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.UNDERPANTS].Wear(
|
if (Data.ContainsKey("UnderPantsItem"))
|
||||||
UUID.Parse(Data["UnderPantsItem"]),
|
appearance.Wearables[AvatarWearable.UNDERPANTS].Wear(
|
||||||
UUID.Parse(Data["UnderPantsAsset"]));
|
UUID.Parse(Data["UnderPantsItem"]),
|
||||||
|
UUID.Parse(Data["UnderPantsAsset"]));
|
||||||
|
|
||||||
|
if (Data.ContainsKey("SkirtItem"))
|
||||||
|
appearance.Wearables[AvatarWearable.SKIRT].Wear(
|
||||||
|
UUID.Parse(Data["SkirtItem"]),
|
||||||
|
UUID.Parse(Data["SkirtAsset"]));
|
||||||
|
|
||||||
appearance.Wearables[AvatarWearable.SKIRT].Wear(
|
|
||||||
UUID.Parse(Data["SkirtItem"]),
|
|
||||||
UUID.Parse(Data["SkirtAsset"]));
|
|
||||||
|
|
||||||
// Attachments
|
// Attachments
|
||||||
Dictionary<string, string> attchs = new Dictionary<string, string>();
|
Dictionary<string, string> attchs = new Dictionary<string, string>();
|
||||||
|
|
Loading…
Reference in New Issue