aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-18 23:18:04 +0000
committerMelanie Thielker2009-05-18 23:18:04 +0000
commit23d902be42fd6d554a9098936d501609fc6e5315 (patch)
tree1830b906665ffa34b3f7c085e28d87ee16bf4c9f /OpenSim/Region
parentBug fix and config rename. (diff)
downloadopensim-SC_OLD-23d902be42fd6d554a9098936d501609fc6e5315.zip
opensim-SC_OLD-23d902be42fd6d554a9098936d501609fc6e5315.tar.gz
opensim-SC_OLD-23d902be42fd6d554a9098936d501609fc6e5315.tar.bz2
opensim-SC_OLD-23d902be42fd6d554a9098936d501609fc6e5315.tar.xz
Remove the old asset cache and local services and the configurations for them
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs16
-rw-r--r--OpenSim/Region/Application/HGCommands.cs4
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs164
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs1
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs18
5 files changed, 4 insertions, 199 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index fea3e94..467b099 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -219,7 +219,6 @@ namespace OpenSim
219 config.Set("startup_console_commands_file", String.Empty); 219 config.Set("startup_console_commands_file", String.Empty);
220 config.Set("shutdown_console_commands_file", String.Empty); 220 config.Set("shutdown_console_commands_file", String.Empty);
221 config.Set("DefaultScriptEngine", "XEngine"); 221 config.Set("DefaultScriptEngine", "XEngine");
222 config.Set("asset_database", "default");
223 config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); 222 config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
224 // life doesn't really work without this 223 // life doesn't really work without this
225 config.Set("EventQueue", true); 224 config.Set("EventQueue", true);
@@ -237,11 +236,7 @@ namespace OpenSim
237 config.Set("inventory_source", ""); 236 config.Set("inventory_source", "");
238 config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); 237 config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll");
239 config.Set("user_source", ""); 238 config.Set("user_source", "");
240 config.Set("asset_plugin", "OpenSim.Data.SQLite.dll");
241 config.Set("asset_source", "URI=file:Asset.db,version=3");
242 config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); 239 config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar));
243 config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar));
244 config.Set("dump_assets_to_file", false);
245 } 240 }
246 241
247 { 242 {
@@ -292,10 +287,6 @@ namespace OpenSim
292 = startupConfig.GetString("storage_connection_string"); 287 = startupConfig.GetString("storage_connection_string");
293 m_configSettings.EstateConnectionString 288 m_configSettings.EstateConnectionString
294 = startupConfig.GetString("estate_connection_string", m_configSettings.StorageConnectionString); 289 = startupConfig.GetString("estate_connection_string", m_configSettings.StorageConnectionString);
295 m_configSettings.AssetStorage
296 = startupConfig.GetString("asset_database");
297 m_configSettings.AssetCache
298 = startupConfig.GetString("AssetCache", "OpenSim.Framework.Communications.Cache.AssetCache");
299 m_configSettings.ClientstackDll 290 m_configSettings.ClientstackDll
300 = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); 291 = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
301 } 292 }
@@ -310,16 +301,11 @@ namespace OpenSim
310 m_configSettings.StandaloneInventorySource = standaloneConfig.GetString("inventory_source"); 301 m_configSettings.StandaloneInventorySource = standaloneConfig.GetString("inventory_source");
311 m_configSettings.StandaloneUserPlugin = standaloneConfig.GetString("userDatabase_plugin"); 302 m_configSettings.StandaloneUserPlugin = standaloneConfig.GetString("userDatabase_plugin");
312 m_configSettings.StandaloneUserSource = standaloneConfig.GetString("user_source"); 303 m_configSettings.StandaloneUserSource = standaloneConfig.GetString("user_source");
313 m_configSettings.StandaloneAssetPlugin = standaloneConfig.GetString("asset_plugin");
314 m_configSettings.StandaloneAssetSource = standaloneConfig.GetString("asset_source");
315 304
316 m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile"); 305 m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile");
317 m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile");
318
319 m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
320 } 306 }
321 307
322 m_networkServersInfo.loadFromConfiguration(m_config.Source); 308 m_networkServersInfo.loadFromConfiguration(m_config.Source);
323 } 309 }
324 } 310 }
325} \ No newline at end of file 311}
diff --git a/OpenSim/Region/Application/HGCommands.cs b/OpenSim/Region/Application/HGCommands.cs
index 07d3dcb..1786e54 100644
--- a/OpenSim/Region/Application/HGCommands.cs
+++ b/OpenSim/Region/Application/HGCommands.cs
@@ -57,7 +57,7 @@ namespace OpenSim
57 return 57 return
58 new HGScene( 58 new HGScene(
59 regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager, 59 regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager,
60 m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, 60 m_moduleLoader, false, m_configSettings.PhysicalPrim,
61 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 61 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
62 } 62 }
63 63
@@ -270,4 +270,4 @@ namespace OpenSim
270 } 270 }
271 271
272 } 272 }
273} \ No newline at end of file 273}
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index cc1f59a..14ae5f1 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -281,7 +281,6 @@ namespace OpenSim
281 // Called from base.StartUp() 281 // Called from base.StartUp()
282 282
283 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 283 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
284 InitialiseAssetCache();
285 m_sceneManager.OnRestartSim += handleRestartRegion; 284 m_sceneManager.OnRestartSim += handleRestartRegion;
286 } 285 }
287 286
@@ -296,167 +295,6 @@ namespace OpenSim
296 /// returns an IAssetCache implementation, if possible. This is a virtual 295 /// returns an IAssetCache implementation, if possible. This is a virtual
297 /// method. 296 /// method.
298 /// </summary> 297 /// </summary>
299 protected virtual void InitialiseAssetCache()
300 {
301 LegacyAssetClientPluginInitialiser linit = null;
302 CryptoAssetClientPluginInitialiser cinit = null;
303 AssetClientPluginInitialiser init = null;
304
305 IAssetServer assetServer = null;
306 string mode = m_configSettings.AssetStorage;
307
308 if (mode == null | mode == String.Empty)
309 mode = "default";
310
311 // If "default" is specified, then the value is adjusted
312 // according to whether or not the server is running in
313 // standalone mode.
314 if (mode.ToLower() == "default")
315 {
316 if (m_configSettings.Standalone == false)
317 mode = "grid";
318 else
319 mode = "local";
320 }
321
322 switch (mode.ToLower())
323 {
324 // If grid is specified then the grid server is chose regardless
325 // of whether the server is standalone.
326 case "grid":
327 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
328 assetServer = loadAssetServer("Grid", linit);
329 break;
330
331 // If cryptogrid is specified then the cryptogrid server is chose regardless
332 // of whether the server is standalone.
333 case "cryptogrid":
334 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
335 Environment.CurrentDirectory, true);
336 assetServer = loadAssetServer("Crypto", cinit);
337 break;
338
339 // If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless
340 // of whether the server is standalone.
341 case "cryptogrid_eou":
342 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
343 Environment.CurrentDirectory, false);
344 assetServer = loadAssetServer("Crypto", cinit);
345 break;
346
347 // If file is specified then the file server is chose regardless
348 // of whether the server is standalone.
349 case "file":
350 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
351 assetServer = loadAssetServer("File", linit);
352 break;
353
354 // If local is specified then we're going to use the local SQL server
355 // implementation. We drop through, because that will be the fallback
356 // for the following default clause too.
357 case "local":
358 break;
359
360 // If the asset_database value is none of the previously mentioned strings, then we
361 // try to load a turnkey plugin that matches this value. If not we drop through to
362 // a local default.
363 default:
364 try
365 {
366 init = new AssetClientPluginInitialiser(m_configSettings);
367 assetServer = loadAssetServer(m_configSettings.AssetStorage, init);
368 break;
369 }
370 catch
371 {
372 }
373 m_log.Info("[OPENSIMBASE]: Default assetserver will be used");
374 break;
375 }
376
377 // Open the local SQL-based database asset server
378 if (assetServer == null)
379 {
380 init = new AssetClientPluginInitialiser(m_configSettings);
381 SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init);
382 sqlAssetServer.LoadDefaultAssets(m_configSettings.AssetSetsXMLFile);
383 assetServer = sqlAssetServer;
384 }
385
386 // Initialize the asset cache, passing a reference to the selected
387 // asset server interface.
388 m_assetCache = ResolveAssetCache(assetServer);
389
390 assetServer.Start();
391 }
392
393 // This method loads the identified asset server, passing an approrpiately
394 // initialized Initialise wrapper. There should to be exactly one match,
395 // if not, then the first match is used.
396 private IAssetServer loadAssetServer(string id, PluginInitialiserBase pi)
397 {
398 if (id != null && id != String.Empty)
399 {
400 m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset server id={0}", id);
401
402 try
403 {
404 PluginLoader<IAssetServer> loader = new PluginLoader<IAssetServer>(pi);
405 loader.AddFilter(PLUGIN_ASSET_SERVER_CLIENT, new PluginProviderFilter(id));
406 loader.Load(PLUGIN_ASSET_SERVER_CLIENT);
407
408 if (loader.Plugins.Count > 0)
409 {
410 m_log.DebugFormat("[OPENSIMBASE] Asset server {0} loaded", id);
411 return (IAssetServer) loader.Plugins[0];
412 }
413 }
414 catch (Exception e)
415 {
416 m_log.DebugFormat("[OPENSIMBASE] Asset server {0} not loaded ({1})", id, e.Message);
417 }
418 }
419 return null;
420 }
421
422 /// <summary>
423 /// Attempt to instantiate an IAssetCache implementation, using the
424 /// provided IAssetServer reference.
425 /// An asset cache implementation must provide a constructor that
426 /// accepts two parameters;
427 /// [1] A ConfigSettings reference.
428 /// [2] An IAssetServer reference.
429 /// The AssetCache value is obtained from the
430 /// [StartUp]/AssetCache value in the configuration file.
431 /// </summary>
432 protected virtual IAssetCache ResolveAssetCache(IAssetServer assetServer)
433 {
434 IAssetCache assetCache = null;
435 if (m_configSettings.AssetCache != null && m_configSettings.AssetCache != String.Empty)
436 {
437 m_log.DebugFormat("[OPENSIMBASE]: Attempting to load asset cache id = {0}", m_configSettings.AssetCache);
438
439 try
440 {
441 PluginInitialiserBase init = new AssetCachePluginInitialiser(m_configSettings, assetServer);
442 PluginLoader<IAssetCache> loader = new PluginLoader<IAssetCache>(init);
443 loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache));
444
445 loader.Load(PLUGIN_ASSET_CACHE);
446 if (loader.Plugins.Count > 0)
447 assetCache = (IAssetCache) loader.Plugins[0];
448 }
449 catch (Exception e)
450 {
451 m_log.Error("[OPENSIMBASE]: ResolveAssetCache failed");
452 m_log.Error(e);
453 }
454 }
455
456 // If everything else fails, we force load the built-in asset cache
457 return (IAssetCache) ((assetCache != null) ? assetCache : new AssetCache(assetServer));
458 }
459
460 public void ProcessLogin(bool LoginEnabled) 298 public void ProcessLogin(bool LoginEnabled)
461 { 299 {
462 if (LoginEnabled) 300 if (LoginEnabled)
@@ -755,7 +593,7 @@ namespace OpenSim
755 593
756 return new Scene( 594 return new Scene(
757 regionInfo, circuitManager, m_commsManager, sceneGridService, 595 regionInfo, circuitManager, m_commsManager, sceneGridService,
758 storageManager, m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, 596 storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim,
759 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 597 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
760 } 598 }
761 599
diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
index 5c2fe33..e9e4e56 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
@@ -73,7 +73,6 @@ namespace OpenSim.Region.Communications.Hypergrid
73 m_interServiceInventoryService = inventoryService; 73 m_interServiceInventoryService = inventoryService;
74 inventoryService.UserProfileCache = UserProfileCacheService; 74 inventoryService.UserProfileCache = UserProfileCacheService;
75 75
76 m_assetCache = assetCache;
77 // Let's swap to always be secure access to inventory 76 // Let's swap to always be secure access to inventory
78 AddSecureInventoryService((ISecureInventoryService)inventoryService); 77 AddSecureInventoryService((ISecureInventoryService)inventoryService);
79 m_inventoryServices = null; 78 m_inventoryServices = null;
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
index 0adafd3..96271a3 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -70,24 +70,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
70 70
71 scene.EventManager.OnNewClient += NewClient; 71 scene.EventManager.OnNewClient += NewClient;
72 } 72 }
73
74 if (m_scene == null)
75 {
76 m_scene = scene;
77 if (config.Configs["StandAlone"] != null)
78 {
79 try
80 {
81 m_dumpAssetsToFile = config.Configs["StandAlone"].GetBoolean("dump_assets_to_file", false);
82 }
83 catch (Exception)
84 {
85 }
86 }
87 else
88 {
89 }
90 }
91 } 73 }
92 74
93 public void PostInitialise() 75 public void PostInitialise()