Made the check for texture assets asynchronous. This is one part of

a bigger clean up that needs to happen around locks on appearance.
viewer-2-initial-appearance
Master ScienceSim 2010-10-26 12:53:15 -07:00
parent 6e58c3d563
commit 9132e251aa
1 changed files with 10 additions and 7 deletions

View File

@ -84,6 +84,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// client.OnAvatarNowWearing -= AvatarIsWearing; // client.OnAvatarNowWearing -= AvatarIsWearing;
} }
public void CheckBakedTextureAssets(IClientAPI client, UUID textureID, int idx)
{
if (m_scene.AssetService.Get(textureID.ToString()) == null)
{
m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",textureID,idx,client.Name);
client.SendRebakeAvatarTextures(textureID);
}
}
/// <summary> /// <summary>
/// Set appearance data (textureentry and slider settings) received from the client /// Set appearance data (textureentry and slider settings) received from the client
/// </summary> /// </summary>
@ -133,13 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
Primitive.TextureEntryFace face = textureEntry.FaceTextures[j]; Primitive.TextureEntryFace face = textureEntry.FaceTextures[j];
if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
{ Util.FireAndForget(delegate(object o) { CheckBakedTextureAssets(client,face.TextureID,j); });
if (m_scene.AssetService.Get(face.TextureID.ToString()) == null)
{
m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",face.TextureID,j,client.Name);
client.SendRebakeAvatarTextures(face.TextureID);
}
}
} }
changed = sp.Appearance.SetTextureEntries(textureEntry); changed = sp.Appearance.SetTextureEntries(textureEntry);