diff options
author | Mike Mazur | 2009-02-03 05:20:44 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-03 05:20:44 +0000 |
commit | d259238c748aafe366fd1d04e0248ef23116fd28 (patch) | |
tree | ec85d8863cffedda47d396d007459b5499bd8162 /OpenSim/Grid | |
parent | - move OpenSim/Framework/IUserData.cs to OpenSim/Data/IUserData.cs (diff) | |
download | opensim-SC_OLD-d259238c748aafe366fd1d04e0248ef23116fd28.zip opensim-SC_OLD-d259238c748aafe366fd1d04e0248ef23116fd28.tar.gz opensim-SC_OLD-d259238c748aafe366fd1d04e0248ef23116fd28.tar.bz2 opensim-SC_OLD-d259238c748aafe366fd1d04e0248ef23116fd28.tar.xz |
- moved data plugin loading code from various places to
OpenSim/Data/DataPluginFactory.cs
- removed dependencies on a few executable assemblies in
bin/OpenSim.Data.addin.xml
- trim trailing whitespace
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/AssetServer/Main.cs | 15 | ||||
-rw-r--r-- | OpenSim/Grid/GridServer/GridManager.cs | 43 |
2 files changed, 19 insertions, 39 deletions
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 07fe0a4..060c473 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs | |||
@@ -112,24 +112,11 @@ namespace OpenSim.Grid.AssetServer | |||
112 | return null; | 112 | return null; |
113 | } | 113 | } |
114 | 114 | ||
115 | public IAssetDataPlugin LoadDatabasePlugin(string provider, string connect) | ||
116 | { | ||
117 | PluginLoader<IAssetDataPlugin> loader = | ||
118 | new PluginLoader<IAssetDataPlugin> (new AssetDataInitialiser (connect)); | ||
119 | |||
120 | // loader will try to load all providers (MySQL, MSSQL, etc) | ||
121 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | ||
122 | loader.Add ("/OpenSim/AssetData", new PluginProviderFilter (provider)); | ||
123 | loader.Load(); | ||
124 | |||
125 | return loader.Plugin; | ||
126 | } | ||
127 | |||
128 | public void setupDB(AssetConfig config) | 115 | public void setupDB(AssetConfig config) |
129 | { | 116 | { |
130 | try | 117 | try |
131 | { | 118 | { |
132 | m_assetProvider = LoadDatabasePlugin(config.DatabaseProvider, config.DatabaseConnect); | 119 | m_assetProvider = DataPluginFactory.LoadAssetDataPlugin(config.DatabaseProvider, config.DatabaseConnect); |
133 | if (m_assetProvider == null) | 120 | if (m_assetProvider == null) |
134 | { | 121 | { |
135 | m_log.Error("[ASSET]: Failed to load a database plugin, server halting"); | 122 | m_log.Error("[ASSET]: Failed to load a database plugin, server halting"); |
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index daee729..3fc0393 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -53,12 +53,12 @@ namespace OpenSim.Grid.GridServer | |||
53 | private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>(); | 53 | private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>(); |
54 | 54 | ||
55 | public GridConfig Config; | 55 | public GridConfig Config; |
56 | 56 | ||
57 | /// <value> | 57 | /// <value> |
58 | /// Used to notify old regions as to which OpenSim version to upgrade to | 58 | /// Used to notify old regions as to which OpenSim version to upgrade to |
59 | /// </value> | 59 | /// </value> |
60 | private string m_opensimVersion; | 60 | private string m_opensimVersion; |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Constructor | 63 | /// Constructor |
64 | /// </summary> | 64 | /// </summary> |
@@ -71,27 +71,20 @@ namespace OpenSim.Grid.GridServer | |||
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. | 74 | /// Adds a list of grid and log data plugins, as described by |
75 | /// `provider' and `connect', to `_plugins' and `_logplugins', | ||
76 | /// respectively. | ||
75 | /// </summary> | 77 | /// </summary> |
76 | /// <param name="provider">The name of the grid server plugin DLL</param> | 78 | /// <param name="provider"> |
79 | /// The filename of the inventory server plugin DLL. | ||
80 | /// </param> | ||
81 | /// <param name="connect"> | ||
82 | /// The connection string for the storage backend. | ||
83 | /// </param> | ||
77 | public void AddPlugin(string provider, string connect) | 84 | public void AddPlugin(string provider, string connect) |
78 | { | 85 | { |
79 | PluginLoader<IGridDataPlugin> gridloader = | 86 | _plugins = DataPluginFactory.LoadGridDataPlugins(provider, connect); |
80 | new PluginLoader<IGridDataPlugin> (new GridDataInitialiser (connect)); | 87 | _logplugins = DataPluginFactory.LoadLogDataPlugins(provider, connect); |
81 | |||
82 | PluginLoader<ILogDataPlugin> logloader = | ||
83 | new PluginLoader<ILogDataPlugin> (new LogDataInitialiser (connect)); | ||
84 | |||
85 | // loader will try to load all providers (MySQL, MSSQL, etc) | ||
86 | // unless it is constrainted to the correct "Provider" entry in the addin.xml | ||
87 | gridloader.Add ("/OpenSim/GridData", new PluginProviderFilter (provider)); | ||
88 | logloader.Add ("/OpenSim/LogData", new PluginProviderFilter (provider)); | ||
89 | |||
90 | gridloader.Load(); | ||
91 | logloader.Load(); | ||
92 | |||
93 | _plugins = gridloader.Plugins; | ||
94 | _logplugins = logloader.Plugins; | ||
95 | } | 88 | } |
96 | 89 | ||
97 | /// <summary> | 90 | /// <summary> |
@@ -389,8 +382,8 @@ namespace OpenSim.Grid.GridServer | |||
389 | m_log.Debug("[LOGIN PRELUDE]: Invalid login parameters, sending back error response."); | 382 | m_log.Debug("[LOGIN PRELUDE]: Invalid login parameters, sending back error response."); |
390 | return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString()); | 383 | return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString()); |
391 | } | 384 | } |
392 | 385 | ||
393 | m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName); | 386 | m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName); |
394 | 387 | ||
395 | if (!Config.AllowRegionRegistration) | 388 | if (!Config.AllowRegionRegistration) |
396 | { | 389 | { |
@@ -399,12 +392,12 @@ namespace OpenSim.Grid.GridServer | |||
399 | sim.regionName); | 392 | sim.regionName); |
400 | 393 | ||
401 | return ErrorResponse("This grid is currently not accepting region registrations."); | 394 | return ErrorResponse("This grid is currently not accepting region registrations."); |
402 | } | 395 | } |
403 | 396 | ||
404 | int majorInterfaceVersion = 0; | 397 | int majorInterfaceVersion = 0; |
405 | if (requestData.ContainsKey("major_interface_version")) | 398 | if (requestData.ContainsKey("major_interface_version")) |
406 | int.TryParse((string)requestData["major_interface_version"], out majorInterfaceVersion); | 399 | int.TryParse((string)requestData["major_interface_version"], out majorInterfaceVersion); |
407 | 400 | ||
408 | if (majorInterfaceVersion != VersionInfo.MajorInterfaceVersion) | 401 | if (majorInterfaceVersion != VersionInfo.MajorInterfaceVersion) |
409 | { | 402 | { |
410 | return ErrorResponse( | 403 | return ErrorResponse( |