diff options
author | Sean Dague | 2008-04-23 20:57:18 +0000 |
---|---|---|
committer | Sean Dague | 2008-04-23 20:57:18 +0000 |
commit | 3f95804911d1a1bc4b50518c047f073120306d72 (patch) | |
tree | 7e9b5e5ef5537676783c40a407e9d6c670b0b490 | |
parent | allow for Inventory database source to be specified in main (diff) | |
download | opensim-SC_OLD-3f95804911d1a1bc4b50518c047f073120306d72.zip opensim-SC_OLD-3f95804911d1a1bc4b50518c047f073120306d72.tar.gz opensim-SC_OLD-3f95804911d1a1bc4b50518c047f073120306d72.tar.bz2 opensim-SC_OLD-3f95804911d1a1bc4b50518c047f073120306d72.tar.xz |
add a database_connect field for the asset server config
which will let you specify a connection string. Required
for Nhibernate, optional for sqlite (there is a sane default),
ignored for mysql and mssql until someone implements the
Iniatialise(string) method.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/AssetConfig.cs | 10 | ||||
-rw-r--r-- | OpenSim/Grid/AssetServer/Main.cs | 6 |
2 files changed, 12 insertions, 4 deletions
diff --git a/OpenSim/Framework/AssetConfig.cs b/OpenSim/Framework/AssetConfig.cs index 6f43693..85dbaa6 100644 --- a/OpenSim/Framework/AssetConfig.cs +++ b/OpenSim/Framework/AssetConfig.cs | |||
@@ -38,7 +38,9 @@ namespace OpenSim.Framework | |||
38 | 38 | ||
39 | public string DatabaseProvider = String.Empty; | 39 | public string DatabaseProvider = String.Empty; |
40 | 40 | ||
41 | public static uint DefaultHttpPort = 8003; | 41 | public string DatabaseConnect = String.Empty; |
42 | |||
43 | public const uint DefaultHttpPort = 8003; | ||
42 | public uint HttpPort = DefaultHttpPort; | 44 | public uint HttpPort = DefaultHttpPort; |
43 | 45 | ||
44 | private ConfigurationMember configMember; | 46 | private ConfigurationMember configMember; |
@@ -59,6 +61,9 @@ namespace OpenSim.Framework | |||
59 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 61 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |
60 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); | 62 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); |
61 | 63 | ||
64 | configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
65 | "Database connection string", "", false); | ||
66 | |||
62 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | 67 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, |
63 | "Http Listener port", DefaultHttpPort.ToString(), false); | 68 | "Http Listener port", DefaultHttpPort.ToString(), false); |
64 | } | 69 | } |
@@ -73,6 +78,9 @@ namespace OpenSim.Framework | |||
73 | case "database_provider": | 78 | case "database_provider": |
74 | DatabaseProvider = (string) configuration_result; | 79 | DatabaseProvider = (string) configuration_result; |
75 | break; | 80 | break; |
81 | case "database_connect": | ||
82 | DatabaseConnect = (string) configuration_result; | ||
83 | break; | ||
76 | case "http_port": | 84 | case "http_port": |
77 | HttpPort = (uint) configuration_result; | 85 | HttpPort = (uint) configuration_result; |
78 | break; | 86 | break; |
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 5a013b9..26f4bc8 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs | |||
@@ -116,7 +116,7 @@ namespace OpenSim.Grid.AssetServer | |||
116 | return null; | 116 | return null; |
117 | } | 117 | } |
118 | 118 | ||
119 | public IAssetProvider LoadDatabasePlugin(string FileName) | 119 | public IAssetProvider LoadDatabasePlugin(string FileName, string connect) |
120 | { | 120 | { |
121 | m_log.Info("[ASSET SERVER]: LoadDatabasePlugin: Attempting to load " + FileName); | 121 | m_log.Info("[ASSET SERVER]: LoadDatabasePlugin: Attempting to load " + FileName); |
122 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 122 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
@@ -132,7 +132,7 @@ namespace OpenSim.Grid.AssetServer | |||
132 | IAssetProvider plug = | 132 | IAssetProvider plug = |
133 | (IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 133 | (IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
134 | assetPlugin = plug; | 134 | assetPlugin = plug; |
135 | assetPlugin.Initialise(); | 135 | assetPlugin.Initialise(connect); |
136 | 136 | ||
137 | m_log.Info("[ASSET SERVER]: Added " + assetPlugin.Name + " " + assetPlugin.Version); | 137 | m_log.Info("[ASSET SERVER]: Added " + assetPlugin.Name + " " + assetPlugin.Version); |
138 | break; | 138 | break; |
@@ -150,7 +150,7 @@ namespace OpenSim.Grid.AssetServer | |||
150 | { | 150 | { |
151 | try | 151 | try |
152 | { | 152 | { |
153 | m_assetProvider = LoadDatabasePlugin(config.DatabaseProvider); | 153 | m_assetProvider = LoadDatabasePlugin(config.DatabaseProvider, config.DatabaseConnect); |
154 | if (m_assetProvider == null) | 154 | if (m_assetProvider == null) |
155 | { | 155 | { |
156 | m_log.Error("[ASSET]: Failed to load a database plugin, server halting"); | 156 | m_log.Error("[ASSET]: Failed to load a database plugin, server halting"); |