From 5a1e896edcb3e5e8341e9d3fb5b3e323c7ec3210 Mon Sep 17 00:00:00 2001 From: Tleiades Hax Date: Sat, 13 Oct 2007 12:35:37 +0000 Subject: OpenSimMain now respects the asset_plugin paramter, and storing of assets will *not* throw an exception --- OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Data.MySQL/MySQLAssetData.cs') diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs index 70e04b6..79f87e0 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs @@ -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) -- cgit v1.1