mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
- IAssetProviderPlugin was changed to IAssetDataPlugin
- Use OpenSim.Data.DataPluginFactory to load data plugins
This commit is contained in:
@@ -38,6 +38,7 @@ using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Grid.AssetInventoryServer.Extensions;
|
||||
using OpenSim.Data;
|
||||
|
||||
namespace OpenSim.Grid.AssetInventoryServer.Plugins
|
||||
{
|
||||
@@ -46,7 +47,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
|
||||
const string EXTENSION_NAME = "OpenSimAssetStorage"; // Used in metrics reporting
|
||||
|
||||
private AssetInventoryServer server;
|
||||
private IAssetProviderPlugin m_assetProvider;
|
||||
private IAssetDataPlugin m_assetProvider;
|
||||
|
||||
public OpenSimAssetStoragePlugin()
|
||||
{
|
||||
@@ -315,7 +316,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
|
||||
|
||||
try
|
||||
{
|
||||
m_assetProvider = LoadDatabasePlugin("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null));
|
||||
m_assetProvider = DataPluginFactory.LoadAssetDataPlugin("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null));
|
||||
if (m_assetProvider == null)
|
||||
{
|
||||
Logger.Log.Error("[ASSET]: Failed to load a database plugin, server halting.");
|
||||
@@ -354,17 +355,5 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
|
||||
}
|
||||
|
||||
#endregion IPlugin implementation
|
||||
|
||||
private IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect)
|
||||
{
|
||||
PluginLoader<IAssetProviderPlugin> loader = new PluginLoader<IAssetProviderPlugin>(new AssetDataInitialiser(connect));
|
||||
|
||||
// Loader will try to load all providers (MySQL, MSSQL, etc)
|
||||
// unless it is constrainted to the correct "Provider" entry in the addin.xml
|
||||
loader.Add("/OpenSim/AssetData", new PluginProviderFilter (provider));
|
||||
loader.Load();
|
||||
|
||||
return loader.Plugin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<Addin id="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim" version="0.1">
|
||||
<Runtime>
|
||||
<Import assembly="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" />
|
||||
<Import assembly="OpenSim.Data.dll" />
|
||||
</Runtime>
|
||||
|
||||
<Dependencies>
|
||||
<Addin id="OpenSim.Grid.AssetInventoryServer" version="0.1" />
|
||||
</Dependencies>
|
||||
|
||||
<ExtensionPoint path = "/OpenSim/AssetData">
|
||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetProviderPlugin" />
|
||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" />
|
||||
</ExtensionPoint>
|
||||
|
||||
<Extension path="/OpenSim/AssetInventoryServer/StorageProvider">
|
||||
<Plugin id="OpenSimAssetStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.OpenSimAssetStoragePlugin" />
|
||||
</Extension>
|
||||
|
||||
@@ -799,6 +799,7 @@
|
||||
<Reference name="System" />
|
||||
<Reference name="System.Data" />
|
||||
<Reference name="OpenSim.Framework" />
|
||||
<Reference name="OpenSim.Data" />
|
||||
<Reference name="OpenSim.Grid.AssetInventoryServer" />
|
||||
<Reference name="OpenMetaverseTypes"/>
|
||||
<Reference name="OpenMetaverse.StructuredData2" />
|
||||
|
||||
Reference in New Issue
Block a user