Introduce UseOsgridFormat config to select the OSGrid specific path name

generator
LSLKeyTest
Melanie Thielker 2016-03-05 01:26:28 +01:00
parent 74c2113bce
commit 15b9601393
1 changed files with 24 additions and 19 deletions

View File

@ -76,6 +76,7 @@ namespace OpenSim.Services.FSAssetService
protected int m_missingAssets = 0;
protected int m_missingAssetsFS = 0;
protected string m_FSBase;
protected bool m_useOsgridFormat = false;
private static bool m_Initialized;
private bool m_MainInstance;
@ -183,6 +184,8 @@ namespace OpenSim.Services.FSAssetService
throw new Exception("Configuration error");
}
m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat);
if (m_MainInstance)
{
string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty);
@ -357,15 +360,16 @@ namespace OpenSim.Services.FSAssetService
if (hash == null || hash.Length < 10)
return "junkyard";
if (m_useOsgridFormat)
{
/*
* The code below is the OSGrid code.
* This should probably become a config option.
*/
/*
return Path.Combine(hash.Substring(0, 3),
Path.Combine(hash.Substring(3, 3)));
*/
}
else
{
/*
* The below is what core would normally use.
* This is modified to work in OSGrid, as seen
@ -377,6 +381,7 @@ namespace OpenSim.Services.FSAssetService
Path.Combine(hash.Substring(4, 2),
hash.Substring(6, 4))));
}
}
private bool AssetExists(string hash)
{