aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/FSAssetService
diff options
context:
space:
mode:
authorMelanie Thielker2016-03-05 01:26:28 +0100
committerMelanie Thielker2016-03-05 01:26:28 +0100
commit15b9601393738e3e8622480fe6716350700a00af (patch)
treea4a030f740af1893ea31e8d7b18af7b9e01c2fd6 /OpenSim/Services/FSAssetService
parentPort the safer database access and the cure for "Chicken Bones" which (diff)
downloadopensim-SC_OLD-15b9601393738e3e8622480fe6716350700a00af.zip
opensim-SC_OLD-15b9601393738e3e8622480fe6716350700a00af.tar.gz
opensim-SC_OLD-15b9601393738e3e8622480fe6716350700a00af.tar.bz2
opensim-SC_OLD-15b9601393738e3e8622480fe6716350700a00af.tar.xz
Introduce UseOsgridFormat config to select the OSGrid specific path name
generator
Diffstat (limited to 'OpenSim/Services/FSAssetService')
-rw-r--r--OpenSim/Services/FSAssetService/FSAssetService.cs43
1 files changed, 24 insertions, 19 deletions
diff --git a/OpenSim/Services/FSAssetService/FSAssetService.cs b/OpenSim/Services/FSAssetService/FSAssetService.cs
index bf7ddff..9ec2d00 100644
--- a/OpenSim/Services/FSAssetService/FSAssetService.cs
+++ b/OpenSim/Services/FSAssetService/FSAssetService.cs
@@ -76,6 +76,7 @@ namespace OpenSim.Services.FSAssetService
76 protected int m_missingAssets = 0; 76 protected int m_missingAssets = 0;
77 protected int m_missingAssetsFS = 0; 77 protected int m_missingAssetsFS = 0;
78 protected string m_FSBase; 78 protected string m_FSBase;
79 protected bool m_useOsgridFormat = false;
79 80
80 private static bool m_Initialized; 81 private static bool m_Initialized;
81 private bool m_MainInstance; 82 private bool m_MainInstance;
@@ -183,6 +184,8 @@ namespace OpenSim.Services.FSAssetService
183 throw new Exception("Configuration error"); 184 throw new Exception("Configuration error");
184 } 185 }
185 186
187 m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat);
188
186 if (m_MainInstance) 189 if (m_MainInstance)
187 { 190 {
188 string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty); 191 string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty);
@@ -357,25 +360,27 @@ namespace OpenSim.Services.FSAssetService
357 if (hash == null || hash.Length < 10) 360 if (hash == null || hash.Length < 10)
358 return "junkyard"; 361 return "junkyard";
359 362
360 /* 363 if (m_useOsgridFormat)
361 * The code below is the OSGrid code. 364 {
362 * This should probably become a config option. 365 /*
363 */ 366 * The code below is the OSGrid code.
364 /* 367 */
365 return Path.Combine(hash.Substring(0, 3), 368 return Path.Combine(hash.Substring(0, 3),
366 Path.Combine(hash.Substring(3, 3))); 369 Path.Combine(hash.Substring(3, 3)));
367 */ 370 }
368 371 else
369 /* 372 {
370 * The below is what core would normally use. 373 /*
371 * This is modified to work in OSGrid, as seen 374 * The below is what core would normally use.
372 * above, because the SRAS data is structured 375 * This is modified to work in OSGrid, as seen
373 * that way. 376 * above, because the SRAS data is structured
374 */ 377 * that way.
375 return Path.Combine(hash.Substring(0, 2), 378 */
376 Path.Combine(hash.Substring(2, 2), 379 return Path.Combine(hash.Substring(0, 2),
377 Path.Combine(hash.Substring(4, 2), 380 Path.Combine(hash.Substring(2, 2),
378 hash.Substring(6, 4)))); 381 Path.Combine(hash.Substring(4, 2),
382 hash.Substring(6, 4))));
383 }
379 } 384 }
380 385
381 private bool AssetExists(string hash) 386 private bool AssetExists(string hash)