make asset checker default inactive
parent
789d658f4a
commit
334039f22c
|
@ -22,7 +22,10 @@ namespace OpenSim.Modules.TextureFetcher
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
Scene m_scene = null;
|
Scene m_scene = null;
|
||||||
|
|
||||||
|
private IConfigSource m_config;
|
||||||
|
|
||||||
List<UUID> m_textureBlackList = new List<UUID>();
|
List<UUID> m_textureBlackList = new List<UUID>();
|
||||||
|
bool m_checkTexture = false;
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
|
@ -43,7 +46,12 @@ namespace OpenSim.Modules.TextureFetcher
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
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
|
public Type ReplaceableInterface
|
||||||
|
@ -140,17 +148,20 @@ namespace OpenSim.Modules.TextureFetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
//Remove not existing textures
|
//Remove not existing textures
|
||||||
String[] _assetIDs = new string[allTextures.Count];
|
if(m_checkTexture == true)
|
||||||
for (int i = 0; i < allTextures.Count; i++)
|
{
|
||||||
_assetIDs[i] = allTextures[i].ToString();
|
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);
|
bool[] existing = m_scene.AssetService.AssetsExist(_assetIDs);
|
||||||
for (int i = 0; i < existing.Length; i++)
|
for (int i = 0; i < existing.Length; i++)
|
||||||
if (existing[i] == false)
|
if (existing[i] == false)
|
||||||
{
|
{
|
||||||
m_textureBlackList.Add(allTextures[i]);
|
m_textureBlackList.Add(allTextures[i]);
|
||||||
allTextures[i] = UUID.Zero;
|
allTextures[i] = UUID.Zero;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Convert texture uuid list to inventar items.
|
//Convert texture uuid list to inventar items.
|
||||||
foreach (UUID texture in allTextures)
|
foreach (UUID texture in allTextures)
|
||||||
|
|
Loading…
Reference in New Issue