diff options
author | Sean Dague | 2009-02-09 21:47:55 +0000 |
---|---|---|
committer | Sean Dague | 2009-02-09 21:47:55 +0000 |
commit | 8088802c218d7eb4a47018b5b3bb70e7463a03b1 (patch) | |
tree | ac22b97c3dce09a91bae18b5840f8654813dcfc8 /OpenSim/Region/Application/OpenSimBase.cs | |
parent | Thank you kindly, TLaukkan (Tommil) for a patch that: (diff) | |
download | opensim-SC-8088802c218d7eb4a47018b5b3bb70e7463a03b1.zip opensim-SC-8088802c218d7eb4a47018b5b3bb70e7463a03b1.tar.gz opensim-SC-8088802c218d7eb4a47018b5b3bb70e7463a03b1.tar.bz2 opensim-SC-8088802c218d7eb4a47018b5b3bb70e7463a03b1.tar.xz |
From Alan Webb <awebb@linux.vnet.ibm.com>
These changes replace all direct references to the AssetCache with
IAssetCache. There is no change to functionality. Everything works as
before.
This is laying the groundwork for making it possible to register
alternative asset caching mechanisms without disrupting other parts of
OpenSim or their dependencies upon AssetCache functionality.
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 68 |
1 files changed, 42 insertions, 26 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index d032864..f2ea81d 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -309,37 +309,53 @@ namespace OpenSim | |||
309 | /// </summary> | 309 | /// </summary> |
310 | protected virtual void InitialiseAssetCache() | 310 | protected virtual void InitialiseAssetCache() |
311 | { | 311 | { |
312 | // If the assetcache is set to default, then use the grid asset service in grid mode and the local database | 312 | |
313 | // based asset service in standalone mode | 313 | IAssetServer assetServer = null; |
314 | 314 | string mode = m_configSettings.AssetStorage; | |
315 | IAssetServer assetServer; | 315 | |
316 | if (m_configSettings.AssetStorage == "grid" | 316 | if (m_configSettings.Standalone == false && |
317 | || (m_configSettings.AssetStorage == "default" && false == m_configSettings.Standalone)) | 317 | m_configSettings.AssetStorage == "default") |
318 | { | 318 | mode = "grid"; |
319 | assetServer = new GridAssetClient(m_networkServersInfo.AssetURL); | 319 | |
320 | } | 320 | switch (mode) |
321 | else if (m_configSettings.AssetStorage == "cryptogrid") // Decrypt-Only | ||
322 | { | 321 | { |
323 | assetServer = new CryptoGridAssetClient(m_networkServersInfo.AssetURL, | 322 | case "grid" : |
323 | assetServer = new GridAssetClient(m_networkServersInfo.AssetURL); | ||
324 | break; | ||
325 | case "cryptogrid" : | ||
326 | assetServer = new CryptoGridAssetClient(m_networkServersInfo.AssetURL, | ||
324 | Environment.CurrentDirectory, true); | 327 | Environment.CurrentDirectory, true); |
325 | } | 328 | break; |
326 | else if (m_configSettings.AssetStorage == "cryptogrid_eou") // Encrypts All Assets | 329 | case "cryptogrid_eou" : |
327 | { | 330 | assetServer = new CryptoGridAssetClient(m_networkServersInfo.AssetURL, |
328 | assetServer = new CryptoGridAssetClient(m_networkServersInfo.AssetURL, | ||
329 | Environment.CurrentDirectory, false); | 331 | Environment.CurrentDirectory, false); |
332 | break; | ||
333 | case "file" : | ||
334 | assetServer = new FileAssetClient(m_networkServersInfo.AssetURL); | ||
335 | break; | ||
336 | default : | ||
337 | if (!ResolveAssetServer(out assetServer)) | ||
338 | { | ||
339 | SQLAssetServer sqlAssetServer = new SQLAssetServer(m_configSettings.StandaloneAssetPlugin, m_configSettings.StandaloneAssetSource); | ||
340 | sqlAssetServer.LoadDefaultAssets(m_configSettings.AssetSetsXMLFile); | ||
341 | assetServer = sqlAssetServer; | ||
342 | } | ||
343 | break; | ||
330 | } | 344 | } |
331 | else if (m_configSettings.AssetStorage == "file") | ||
332 | { | ||
333 | assetServer = new FileAssetClient(m_networkServersInfo.AssetURL); | ||
334 | } | ||
335 | else | ||
336 | { | ||
337 | SQLAssetServer sqlAssetServer = new SQLAssetServer(m_configSettings.StandaloneAssetPlugin, m_configSettings.StandaloneAssetSource); | ||
338 | sqlAssetServer.LoadDefaultAssets(m_configSettings.AssetSetsXMLFile); | ||
339 | assetServer = sqlAssetServer; | ||
340 | } | ||
341 | 345 | ||
342 | m_assetCache = new AssetCache(assetServer); | 346 | m_assetCache = ResolveAssetCache(assetServer); |
347 | |||
348 | } | ||
349 | |||
350 | private bool ResolveAssetServer(out IAssetServer assetServer) | ||
351 | { | ||
352 | assetServer = null; | ||
353 | return false; | ||
354 | } | ||
355 | |||
356 | private IAssetCache ResolveAssetCache(IAssetServer assetServer) | ||
357 | { | ||
358 | return new AssetCache(assetServer); | ||
343 | } | 359 | } |
344 | 360 | ||
345 | public void ProcessLogin(bool LoginEnabled) | 361 | public void ProcessLogin(bool LoginEnabled) |