From 23d902be42fd6d554a9098936d501609fc6e5315 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 18 May 2009 23:18:04 +0000 Subject: Remove the old asset cache and local services and the configurations for them --- OpenSim/Region/Application/ConfigurationLoader.cs | 16 +-- OpenSim/Region/Application/HGCommands.cs | 4 +- OpenSim/Region/Application/OpenSimBase.cs | 164 +--------------------- 3 files changed, 4 insertions(+), 180 deletions(-) (limited to 'OpenSim/Region/Application') 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 config.Set("startup_console_commands_file", String.Empty); config.Set("shutdown_console_commands_file", String.Empty); config.Set("DefaultScriptEngine", "XEngine"); - config.Set("asset_database", "default"); config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); // life doesn't really work without this config.Set("EventQueue", true); @@ -237,11 +236,7 @@ namespace OpenSim config.Set("inventory_source", ""); config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); config.Set("user_source", ""); - config.Set("asset_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("asset_source", "URI=file:Asset.db,version=3"); config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); - config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar)); - config.Set("dump_assets_to_file", false); } { @@ -292,10 +287,6 @@ namespace OpenSim = startupConfig.GetString("storage_connection_string"); m_configSettings.EstateConnectionString = startupConfig.GetString("estate_connection_string", m_configSettings.StorageConnectionString); - m_configSettings.AssetStorage - = startupConfig.GetString("asset_database"); - m_configSettings.AssetCache - = startupConfig.GetString("AssetCache", "OpenSim.Framework.Communications.Cache.AssetCache"); m_configSettings.ClientstackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); } @@ -310,16 +301,11 @@ namespace OpenSim m_configSettings.StandaloneInventorySource = standaloneConfig.GetString("inventory_source"); m_configSettings.StandaloneUserPlugin = standaloneConfig.GetString("userDatabase_plugin"); m_configSettings.StandaloneUserSource = standaloneConfig.GetString("user_source"); - m_configSettings.StandaloneAssetPlugin = standaloneConfig.GetString("asset_plugin"); - m_configSettings.StandaloneAssetSource = standaloneConfig.GetString("asset_source"); m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile"); - m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile"); - - m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); } m_networkServersInfo.loadFromConfiguration(m_config.Source); } } -} \ No newline at end of file +} 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 return new HGScene( regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager, - m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, + m_moduleLoader, false, m_configSettings.PhysicalPrim, m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); } @@ -270,4 +270,4 @@ namespace OpenSim } } -} \ No newline at end of file +} 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 // Called from base.StartUp() m_httpServerPort = m_networkServersInfo.HttpListenerPort; - InitialiseAssetCache(); m_sceneManager.OnRestartSim += handleRestartRegion; } @@ -296,167 +295,6 @@ namespace OpenSim /// returns an IAssetCache implementation, if possible. This is a virtual /// method. /// - protected virtual void InitialiseAssetCache() - { - LegacyAssetClientPluginInitialiser linit = null; - CryptoAssetClientPluginInitialiser cinit = null; - AssetClientPluginInitialiser init = null; - - IAssetServer assetServer = null; - string mode = m_configSettings.AssetStorage; - - if (mode == null | mode == String.Empty) - mode = "default"; - - // If "default" is specified, then the value is adjusted - // according to whether or not the server is running in - // standalone mode. - if (mode.ToLower() == "default") - { - if (m_configSettings.Standalone == false) - mode = "grid"; - else - mode = "local"; - } - - switch (mode.ToLower()) - { - // If grid is specified then the grid server is chose regardless - // of whether the server is standalone. - case "grid": - linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); - assetServer = loadAssetServer("Grid", linit); - break; - - // If cryptogrid is specified then the cryptogrid server is chose regardless - // of whether the server is standalone. - case "cryptogrid": - cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, - Environment.CurrentDirectory, true); - assetServer = loadAssetServer("Crypto", cinit); - break; - - // If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless - // of whether the server is standalone. - case "cryptogrid_eou": - cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, - Environment.CurrentDirectory, false); - assetServer = loadAssetServer("Crypto", cinit); - break; - - // If file is specified then the file server is chose regardless - // of whether the server is standalone. - case "file": - linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); - assetServer = loadAssetServer("File", linit); - break; - - // If local is specified then we're going to use the local SQL server - // implementation. We drop through, because that will be the fallback - // for the following default clause too. - case "local": - break; - - // If the asset_database value is none of the previously mentioned strings, then we - // try to load a turnkey plugin that matches this value. If not we drop through to - // a local default. - default: - try - { - init = new AssetClientPluginInitialiser(m_configSettings); - assetServer = loadAssetServer(m_configSettings.AssetStorage, init); - break; - } - catch - { - } - m_log.Info("[OPENSIMBASE]: Default assetserver will be used"); - break; - } - - // Open the local SQL-based database asset server - if (assetServer == null) - { - init = new AssetClientPluginInitialiser(m_configSettings); - SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init); - sqlAssetServer.LoadDefaultAssets(m_configSettings.AssetSetsXMLFile); - assetServer = sqlAssetServer; - } - - // Initialize the asset cache, passing a reference to the selected - // asset server interface. - m_assetCache = ResolveAssetCache(assetServer); - - assetServer.Start(); - } - - // This method loads the identified asset server, passing an approrpiately - // initialized Initialise wrapper. There should to be exactly one match, - // if not, then the first match is used. - private IAssetServer loadAssetServer(string id, PluginInitialiserBase pi) - { - if (id != null && id != String.Empty) - { - m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset server id={0}", id); - - try - { - PluginLoader loader = new PluginLoader(pi); - loader.AddFilter(PLUGIN_ASSET_SERVER_CLIENT, new PluginProviderFilter(id)); - loader.Load(PLUGIN_ASSET_SERVER_CLIENT); - - if (loader.Plugins.Count > 0) - { - m_log.DebugFormat("[OPENSIMBASE] Asset server {0} loaded", id); - return (IAssetServer) loader.Plugins[0]; - } - } - catch (Exception e) - { - m_log.DebugFormat("[OPENSIMBASE] Asset server {0} not loaded ({1})", id, e.Message); - } - } - return null; - } - - /// - /// Attempt to instantiate an IAssetCache implementation, using the - /// provided IAssetServer reference. - /// An asset cache implementation must provide a constructor that - /// accepts two parameters; - /// [1] A ConfigSettings reference. - /// [2] An IAssetServer reference. - /// The AssetCache value is obtained from the - /// [StartUp]/AssetCache value in the configuration file. - /// - protected virtual IAssetCache ResolveAssetCache(IAssetServer assetServer) - { - IAssetCache assetCache = null; - if (m_configSettings.AssetCache != null && m_configSettings.AssetCache != String.Empty) - { - m_log.DebugFormat("[OPENSIMBASE]: Attempting to load asset cache id = {0}", m_configSettings.AssetCache); - - try - { - PluginInitialiserBase init = new AssetCachePluginInitialiser(m_configSettings, assetServer); - PluginLoader loader = new PluginLoader(init); - loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache)); - - loader.Load(PLUGIN_ASSET_CACHE); - if (loader.Plugins.Count > 0) - assetCache = (IAssetCache) loader.Plugins[0]; - } - catch (Exception e) - { - m_log.Error("[OPENSIMBASE]: ResolveAssetCache failed"); - m_log.Error(e); - } - } - - // If everything else fails, we force load the built-in asset cache - return (IAssetCache) ((assetCache != null) ? assetCache : new AssetCache(assetServer)); - } - public void ProcessLogin(bool LoginEnabled) { if (LoginEnabled) @@ -755,7 +593,7 @@ namespace OpenSim return new Scene( regionInfo, circuitManager, m_commsManager, sceneGridService, - storageManager, m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, + storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); } -- cgit v1.1