* 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
0.6.0-stable
Justin Clarke Casey 2008-10-28 21:31:23 +00:00
parent 247b806134
commit 1ff9709ea3
5 changed files with 58 additions and 17 deletions

View File

@ -28,8 +28,10 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Security.Permissions; using System.Security.Permissions;
using log4net;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenSim.Framework; using OpenSim.Framework;
@ -39,6 +41,9 @@ namespace OpenSim.Framework
[Serializable] [Serializable]
public class AvatarAppearance : ISerializable public class AvatarAppearance : ISerializable
{ {
// private static readonly ILog m_log
// = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// these are guessed at by the list here - // these are guessed at by the list here -
// http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll
// correct them over time for when were are wrong. // correct them over time for when were are wrong.
@ -258,7 +263,7 @@ namespace OpenSim.Framework
} }
/// <summary> /// <summary>
/// /// Set up appearance textures and avatar parameters, including a height calculation
/// </summary> /// </summary>
/// <param name="texture"></param> /// <param name="texture"></param>
/// <param name="visualParam"></param> /// <param name="visualParam"></param>
@ -266,7 +271,15 @@ namespace OpenSim.Framework
{ {
Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length); Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length);
m_texture = textureEnt; 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(); m_visualparams = visualParam.ToArray();
// Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters. // 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() public override String ToString()
{ {
String s = "[Wearables] =>"; String s = "[Wearables] =>";
s += "Body Item: " + BodyItem.ToString() + ";"; s += " Body Item: " + BodyItem.ToString() + ";";
s += "Skin Item: " + SkinItem.ToString() + ";"; s += " Skin Item: " + SkinItem.ToString() + ";";
s += "Shirt Item: " + ShirtItem.ToString() + ";"; s += " Shirt Item: " + ShirtItem.ToString() + ";";
s += "Pants Item: " + PantsItem.ToString() + ";"; s += " Pants Item: " + PantsItem.ToString() + ";";
return s; return s;
} }

View File

@ -73,19 +73,19 @@ namespace OpenSim.Framework
} }
// Body // 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 // 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"); defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb");
// Shirt // 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"); defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110");
// Pants // 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"); defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120");
return defaultWearables; return defaultWearables;

View File

@ -334,6 +334,10 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="asset"></param> /// <param name="asset"></param>
public void AddAsset(AssetBase asset) 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 (asset.Type == (int)AssetType.Texture)
{ {
if (!Textures.ContainsKey(asset.FullID)) if (!Textures.ContainsKey(asset.FullID))
@ -344,11 +348,23 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null) if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddTexture(textur); 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); m_assetServer.StoreAsset(asset);
} }
} }
// else
// {
// m_log.DebugFormat("[ASSET CACHE]: Textures already contains {0}", asset.ID);
// }
} }
else else
{ {
@ -360,11 +376,16 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null) if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddAsset(assetInf); StatsManager.SimExtraStats.AddAsset(assetInf);
if (!asset.Temporary) // See comment above.
if (!asset.Temporary || asset.Local)
{ {
m_assetServer.StoreAsset(asset); 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 // See IAssetReceiver
public void AssetReceived(AssetBase asset, bool IsTexture) 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 //check if it is a texture or not
//then add to the correct cache list //then add to the correct cache list
//then check for waiting requests for this asset/texture (in the Requested lists) //then check for waiting requests for this asset/texture (in the Requested lists)
@ -464,7 +487,7 @@ namespace OpenSim.Framework.Communications.Cache
// See IAssetReceiver // See IAssetReceiver
public void AssetNotFound(UUID assetID, bool IsTexture) 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) if (IsTexture)
{ {

View File

@ -2239,6 +2239,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
awb.AssetID = wearables[i].AssetID; awb.AssetID = wearables[i].AssetID;
awb.ItemID = wearables[i].ItemID; awb.ItemID = wearables[i].ItemID;
aw.WearableData[i] = awb; aw.WearableData[i] = awb;
// m_log.DebugFormat(
// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
// awb.ItemID, awb.AssetID, i, Name);
} }
OutPacket(aw, ThrottleOutPacketType.Task); OutPacket(aw, ThrottleOutPacketType.Task);
@ -4205,6 +4209,8 @@ Console.WriteLine(msgpack.ToString());
if (handlerRequestWearables != null) if (handlerRequestWearables != null)
{ {
m_log.DebugFormat("[APPEARANCE]: Wearables requested by {0}", Name);
handlerRequestWearables(); handlerRequestWearables();
} }
@ -7076,7 +7082,6 @@ Console.WriteLine(msgpack.ToString());
public void SendAsset(AssetRequestToClient req) public void SendAsset(AssetRequestToClient req)
{ {
//Console.WriteLine("sending asset " + req.RequestAssetID); //Console.WriteLine("sending asset " + req.RequestAssetID);
TransferInfoPacket Transfer = new TransferInfoPacket(); TransferInfoPacket Transfer = new TransferInfoPacket();
Transfer.TransferInfo.ChannelType = 2; Transfer.TransferInfo.ChannelType = 2;

View File

@ -1851,7 +1851,7 @@ namespace OpenSim.Region.Environment.Scenes
m_log.DebugFormat("[APPEARANCE]: Sending wearables to {0}", Name); m_log.DebugFormat("[APPEARANCE]: Sending wearables to {0}", Name);
ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
// ControllingClient.SendAppearance( //ControllingClient.SendAppearance(
// m_appearance.Owner, // m_appearance.Owner,
// m_appearance.VisualParams, // m_appearance.VisualParams,
// m_appearance.Texture.ToBytes() // m_appearance.Texture.ToBytes()
@ -1896,7 +1896,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
SendAppearanceToAllOtherAgents(); SendAppearanceToAllOtherAgents();
SendWearables(); //SendWearables();
} }
public void SetWearable(int wearableId, AvatarWearable wearable) public void SetWearable(int wearableId, AvatarWearable wearable)