aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
diff options
context:
space:
mode:
authorTleiades Hax2007-10-13 09:10:53 +0000
committerTleiades Hax2007-10-13 09:10:53 +0000
commite8c1de8e7298e6c210a89b2449d636493f516c5e (patch)
treec22b35960503372c0a49675b82651d3a2d06c29c /OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
parentAsset server implementation. Again one of these "plumbing" releases, where no... (diff)
downloadopensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.zip
opensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.tar.gz
opensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.tar.bz2
opensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.tar.xz
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/MySQLAssetData.cs')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLAssetData.cs23
1 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
index 70e04b6..5a169ac 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
@@ -40,9 +40,28 @@ namespace OpenSim.Framework.Data.MySQL
40 40
41 } 41 }
42 42
43 public AssetBase FetchAsset(LLUUID uuid) 43 public AssetBase FetchAsset(LLUUID assetID)
44 { 44 {
45 throw new Exception("The method or operation is not implemented."); 45 AssetBase asset = null;
46
47 MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection);
48 MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
49 p.Value = assetID.GetBytes();
50 using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
51 {
52 if (dbReader.Read())
53 {
54 asset = new AssetBase();
55 asset.Data = (byte[])dbReader["data"];
56 asset.Description = (string)dbReader["description"];
57 asset.FullID = assetID;
58 asset.InvType = (sbyte)dbReader["invType"];
59 asset.Local = ((sbyte)dbReader["local"])!=0?true:false;
60 asset.Name = (string)dbReader["name"];
61 asset.Type = (sbyte)dbReader["assetType"];
62 }
63 }
64 return asset;
46 } 65 }
47 66
48 public void CreateAsset(AssetBase asset) 67 public void CreateAsset(AssetBase asset)