From 1ff9709ea3d5e7c9ef21f6f59ae0dce62dd7b1c4 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Tue, 28 Oct 2008 21:31:23 +0000
Subject: * Possibly fix grey avatar appearance problems * And hopefully
rebaking all the time should no longer be necessary now * It turns out that
when the client baked the texture, the uploaded asset had the Temporary flag
to true (Temporary is actually deprecated). * It also had the StoreLocal flag
set to true, which signifies that the asset should be stored locally. If it
disappears we should reply to the asset request with ImageNotInDatabasePacket
* However, last time this was enabled some clients started crashing. This
may well no longer be the case and needs to be tested, but in the mean time
we will store the asset instead. * This needs to be resolved in a better way,
possibly by starting to send the ImageNotInDatabase packet again instead
---
OpenSim/Framework/AvatarAppearance.cs | 25 ++++++++++++++-----
OpenSim/Framework/AvatarWearable.cs | 10 ++++----
.../Framework/Communications/Cache/AssetCache.cs | 29 +++++++++++++++++++---
3 files changed, 50 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 0c0cfd5..e1d0bbe 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -28,8 +28,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Security.Permissions;
+using log4net;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenSim.Framework;
@@ -39,6 +41,9 @@ namespace OpenSim.Framework
[Serializable]
public class AvatarAppearance : ISerializable
{
+// private static readonly ILog m_log
+// = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
// these are guessed at by the list here -
// http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll
// correct them over time for when were are wrong.
@@ -258,7 +263,7 @@ namespace OpenSim.Framework
}
///
- ///
+ /// Set up appearance textures and avatar parameters, including a height calculation
///
///
///
@@ -266,7 +271,15 @@ namespace OpenSim.Framework
{
Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length);
m_texture = textureEnt;
-
+
+// m_log.DebugFormat("[APPEARANCE]: Setting an avatar appearance with {0} faces", m_texture.FaceTextures.Length);
+// for (int i = 0; i < m_texture.FaceTextures.Length; i++)
+// {
+// Primitive.TextureEntryFace face = m_texture.FaceTextures[i];
+// String textureIdString = (face != null ? face.TextureID.ToString() : "none");
+// m_log.DebugFormat("[APPEARANCE]: Texture {0} is {1}", i, textureIdString);
+// }
+
m_visualparams = visualParam.ToArray();
// Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters.
@@ -297,10 +310,10 @@ namespace OpenSim.Framework
public override String ToString()
{
String s = "[Wearables] =>";
- s += "Body Item: " + BodyItem.ToString() + ";";
- s += "Skin Item: " + SkinItem.ToString() + ";";
- s += "Shirt Item: " + ShirtItem.ToString() + ";";
- s += "Pants Item: " + PantsItem.ToString() + ";";
+ s += " Body Item: " + BodyItem.ToString() + ";";
+ s += " Skin Item: " + SkinItem.ToString() + ";";
+ s += " Shirt Item: " + ShirtItem.ToString() + ";";
+ s += " Pants Item: " + PantsItem.ToString() + ";";
return s;
}
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs
index 62971ea..52f162e 100644
--- a/OpenSim/Framework/AvatarWearable.cs
+++ b/OpenSim/Framework/AvatarWearable.cs
@@ -73,19 +73,19 @@ namespace OpenSim.Framework
}
// Body
- defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
- defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
+ defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
+ defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
// Skin
- defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9");
+ defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9");
defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb");
// Shirt
- defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000");
+ defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000");
defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110");
// Pants
- defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111");
+ defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111");
defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120");
return defaultWearables;
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 1a442ea..1ae7eb7 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -334,6 +334,10 @@ namespace OpenSim.Framework.Communications.Cache
///
public void AddAsset(AssetBase asset)
{
+// m_log.DebugFormat(
+// "[ASSET CACHE]: Uploaded asset {0}, temporary {1}, store local {2}",
+// asset.ID, asset.Temporary, asset.Local);
+
if (asset.Type == (int)AssetType.Texture)
{
if (!Textures.ContainsKey(asset.FullID))
@@ -344,11 +348,23 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddTexture(textur);
- if (!asset.Temporary)
+ // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the
+ // information is stored locally. It could disappear, in which case we could send the
+ // ImageNotInDatabase packet to tell the client this. However, when this was enabled in
+ // TextureNotFoundSender it ended up crashing clients - we need to go back and try this again.
+ //
+ // In the mean time, we're just going to push local assets to the permanent store instead.
+ // TODO: Need to come back and address this.
+ // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView.
+ if (!asset.Temporary || asset.Local)
{
m_assetServer.StoreAsset(asset);
}
}
+// else
+// {
+// m_log.DebugFormat("[ASSET CACHE]: Textures already contains {0}", asset.ID);
+// }
}
else
{
@@ -360,11 +376,16 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddAsset(assetInf);
- if (!asset.Temporary)
+ // See comment above.
+ if (!asset.Temporary || asset.Local)
{
m_assetServer.StoreAsset(asset);
}
}
+// else
+// {
+// m_log.DebugFormat("[ASSET CACHE]: Assets already contains {0}", asset.ID);
+// }
}
}
@@ -394,6 +415,8 @@ namespace OpenSim.Framework.Communications.Cache
// See IAssetReceiver
public void AssetReceived(AssetBase asset, bool IsTexture)
{
+// m_log.DebugFormat("[ASSET CACHE]: Received asset {0}", asset.ID);
+
//check if it is a texture or not
//then add to the correct cache list
//then check for waiting requests for this asset/texture (in the Requested lists)
@@ -464,7 +487,7 @@ namespace OpenSim.Framework.Communications.Cache
// See IAssetReceiver
public void AssetNotFound(UUID assetID, bool IsTexture)
{
- //m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID);
+// m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID);
if (IsTexture)
{
--
cgit v1.1