From 334039f22c492affaa80a8e22987d5fe063c7073 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sun, 28 Jun 2020 16:15:29 +0200 Subject: [PATCH] make asset checker default inactive --- src/TextureFetcher.cs | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/TextureFetcher.cs b/src/TextureFetcher.cs index da2205a..4bb67dd 100644 --- a/src/TextureFetcher.cs +++ b/src/TextureFetcher.cs @@ -22,7 +22,10 @@ namespace OpenSim.Modules.TextureFetcher private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); Scene m_scene = null; + private IConfigSource m_config; + List m_textureBlackList = new List(); + bool m_checkTexture = false; public string Name { @@ -43,7 +46,12 @@ namespace OpenSim.Modules.TextureFetcher public void Initialise(IConfigSource source) { + m_config = source; + if (m_config.Configs["Startup"] != null) + { + m_checkTexture = m_config.Configs["Startup"].GetBoolean("TextureFetcherCheckAssets", m_checkTexture); + } } public Type ReplaceableInterface @@ -140,17 +148,20 @@ namespace OpenSim.Modules.TextureFetcher } //Remove not existing textures - String[] _assetIDs = new string[allTextures.Count]; - for (int i = 0; i < allTextures.Count; i++) - _assetIDs[i] = allTextures[i].ToString(); + if(m_checkTexture == true) + { + String[] _assetIDs = new string[allTextures.Count]; + for (int i = 0; i < allTextures.Count; i++) + _assetIDs[i] = allTextures[i].ToString(); - bool[] existing = m_scene.AssetService.AssetsExist(_assetIDs); - for (int i = 0; i < existing.Length; i++) - if (existing[i] == false) - { - m_textureBlackList.Add(allTextures[i]); - allTextures[i] = UUID.Zero; - } + bool[] existing = m_scene.AssetService.AssetsExist(_assetIDs); + for (int i = 0; i < existing.Length; i++) + if (existing[i] == false) + { + m_textureBlackList.Add(allTextures[i]); + allTextures[i] = UUID.Zero; + } + } //Convert texture uuid list to inventar items. foreach (UUID texture in allTextures)