From 5f7446e3ee3e8348024d15bf37ba3c65df2633d7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 9 Aug 2021 14:49:46 +0100 Subject: [PATCH] flotsam cache: do not expire baked textures in use --- .../CoreModules/Asset/FlotsamAssetCache.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 8fa1acbfd1..0e294dbe74 100755 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -1233,6 +1233,34 @@ namespace OpenSim.Region.CoreModules.Asset cooldown = 0; } } + else if( entity is ScenePresence) + { + ScenePresence sp = entity as ScenePresence; + if (sp == null || sp.IsChildAgent || sp.IsDeleted || sp.Appearance == null) + continue; + + Primitive.TextureEntry Texture = sp.Appearance.Texture; + if (Texture == null) + continue; + + Primitive.TextureEntryFace[] FaceTextures = Texture.FaceTextures; + if (FaceTextures == null) + continue; + + for (int it = 0; it < AvatarAppearance.BAKE_INDICES.Length; it++) + { + int idx = AvatarAppearance.BAKE_INDICES[it]; + if(idx < FaceTextures.Length) + { + Primitive.TextureEntryFace face = FaceTextures[idx]; + if (face == null) + continue; + if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE) + continue; + gatherer.AddGathered(face.TextureID, (sbyte)AssetType.Texture); + } + } + } } entities = null; if (!m_cleanupRunning)