OpenSimMain now respects the asset_plugin paramter, and storing of assets will *not* throw an exception
parent
f6aeff6cc3
commit
5a1e896edc
|
@ -40,9 +40,28 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AssetBase FetchAsset(LLUUID uuid)
|
public AssetBase FetchAsset(LLUUID assetID)
|
||||||
{
|
{
|
||||||
throw new Exception("The method or operation is not implemented.");
|
AssetBase asset = null;
|
||||||
|
|
||||||
|
MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection);
|
||||||
|
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
|
||||||
|
p.Value = assetID.GetBytes();
|
||||||
|
using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
|
||||||
|
{
|
||||||
|
if (dbReader.Read())
|
||||||
|
{
|
||||||
|
asset = new AssetBase();
|
||||||
|
asset.Data = (byte[])dbReader["data"];
|
||||||
|
asset.Description = (string)dbReader["description"];
|
||||||
|
asset.FullID = assetID;
|
||||||
|
asset.InvType = (sbyte)dbReader["invType"];
|
||||||
|
asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false;
|
||||||
|
asset.Name = (string)dbReader["name"];
|
||||||
|
asset.Type = (sbyte)dbReader["assetType"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CreateAsset(AssetBase asset)
|
public void CreateAsset(AssetBase asset)
|
||||||
|
|
|
@ -2,8 +2,8 @@ CREATE TABLE `assets` (
|
||||||
`id` binary(16) NOT NULL,
|
`id` binary(16) NOT NULL,
|
||||||
`name` varchar(64) NOT NULL,
|
`name` varchar(64) NOT NULL,
|
||||||
`description` varchar(64) NOT NULL,
|
`description` varchar(64) NOT NULL,
|
||||||
`assetType` smallint(5) unsigned NOT NULL,
|
`assetType` tinyint(4) NOT NULL,
|
||||||
`invType` smallint(5) unsigned NOT NULL,
|
`invType` tinyint(4) NOT NULL,
|
||||||
`local` tinyint(1) NOT NULL,
|
`local` tinyint(1) NOT NULL,
|
||||||
`temporary` tinyint(1) NOT NULL,
|
`temporary` tinyint(1) NOT NULL,
|
||||||
`data` longblob NOT NULL,
|
`data` longblob NOT NULL,
|
||||||
|
|
|
@ -79,6 +79,7 @@ namespace OpenSim
|
||||||
private bool standaloneAuthenticate = false;
|
private bool standaloneAuthenticate = false;
|
||||||
private string standaloneWelcomeMessage = null;
|
private string standaloneWelcomeMessage = null;
|
||||||
private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
|
private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
|
||||||
|
private string standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll";
|
||||||
private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll";
|
private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll";
|
||||||
|
|
||||||
private string m_assetStorage = "db4o";
|
private string m_assetStorage = "db4o";
|
||||||
|
@ -132,7 +133,7 @@ namespace OpenSim
|
||||||
standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
|
standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
|
||||||
standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
|
standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
|
||||||
standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
|
standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
|
||||||
|
standaloneAssetPlugin = configSource.Configs["StandAlone"].GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
|
||||||
m_networkServersInfo.loadFromConfiguration(configSource);
|
m_networkServersInfo.loadFromConfiguration(configSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +284,7 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assetServer = new SQLAssetServer("OpenSim.Framework.Data.SQLite.dll");
|
assetServer = new SQLAssetServer(standaloneAssetPlugin);
|
||||||
}
|
}
|
||||||
assetServer.SetServerInfo(m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
|
assetServer.SetServerInfo(m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
|
||||||
m_assetCache = new AssetCache(assetServer);
|
m_assetCache = new AssetCache(assetServer);
|
||||||
|
|
Loading…
Reference in New Issue