From 3dd98a112f4308532d768943690b13c403dff68b Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 23 Apr 2008 20:48:23 +0000 Subject: allow for Inventory database source to be specified in main configs. This works with sqlite and nhibernate backends, and stays with default seperate ini files for mysql and mssql until someone writes those. --- .../Communications/InventoryServiceBase.cs | 4 +-- OpenSim/Framework/IInventoryData.cs | 2 +- OpenSim/Framework/InventoryConfig.cs | 42 ++++++++++++---------- 3 files changed, 27 insertions(+), 21 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 769c530..5cbfcf9 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -46,7 +46,7 @@ namespace OpenSim.Framework.Communications /// Adds a new user server plugin - plugins will be requested in the order they were loaded. /// /// The filename to the user server plugin DLL - public void AddPlugin(string FileName) + public void AddPlugin(string FileName, string connect) { if (!String.IsNullOrEmpty(FileName)) { @@ -63,7 +63,7 @@ namespace OpenSim.Framework.Communications { IInventoryData plug = (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(); + plug.Initialise(connect); m_plugins.Add(plug.getName(), plug); m_log.Info("[AGENTINVENTORY]: Added IInventoryData Interface"); } diff --git a/OpenSim/Framework/IInventoryData.cs b/OpenSim/Framework/IInventoryData.cs index d72231d..508099e 100644 --- a/OpenSim/Framework/IInventoryData.cs +++ b/OpenSim/Framework/IInventoryData.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework /// /// Initialises the interface /// - void Initialise(); + void Initialise(string connect); /// /// Closes the interface diff --git a/OpenSim/Framework/InventoryConfig.cs b/OpenSim/Framework/InventoryConfig.cs index 39a6930..1e22fe8 100644 --- a/OpenSim/Framework/InventoryConfig.cs +++ b/OpenSim/Framework/InventoryConfig.cs @@ -40,6 +40,7 @@ namespace OpenSim.Framework public string UserRecvKey = String.Empty; public string DatabaseProvider = String.Empty; + public string DatabaseConnect = String.Empty; public static uint DefaultHttpPort = 8004; public uint HttpPort = DefaultHttpPort; @@ -68,6 +69,8 @@ namespace OpenSim.Framework "Key to expect from user server", "null", false); configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.SQLite.dll", false); + configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + "Database Connect String", "", false); configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Http Listener port", DefaultHttpPort.ToString(), false); } @@ -76,24 +79,27 @@ namespace OpenSim.Framework { switch (configuration_key) { - case "default_startup_message": - DefaultStartupMsg = (string) configuration_result; - break; - case "default_user_server": - UserServerURL = (string) configuration_result; - break; - case "user_send_key": - UserSendKey = (string) configuration_result; - break; - case "user_recv_key": - UserRecvKey = (string) configuration_result; - break; - case "database_provider": - DatabaseProvider = (string) configuration_result; - break; - case "http_port": - HttpPort = (uint) configuration_result; - break; + case "default_startup_message": + DefaultStartupMsg = (string) configuration_result; + break; + case "default_user_server": + UserServerURL = (string) configuration_result; + break; + case "user_send_key": + UserSendKey = (string) configuration_result; + break; + case "user_recv_key": + UserRecvKey = (string) configuration_result; + break; + case "database_provider": + DatabaseProvider = (string) configuration_result; + break; + case "database_connect": + DatabaseConnect = (string) configuration_result; + break; + case "http_port": + HttpPort = (uint) configuration_result; + break; } return true; -- cgit v1.1