diff options
author | Tleiades Hax | 2007-10-26 11:46:27 +0000 |
---|---|---|
committer | Tleiades Hax | 2007-10-26 11:46:27 +0000 |
commit | 5e7dba726896fcb84882b53952651742926e6efb (patch) | |
tree | a396337e721912fd954e8a66e26d16c375d7bab4 /OpenSim/Framework/Data.MySQL | |
parent | add my set-eol-style script. Can be run on Linux (diff) | |
download | opensim-SC_OLD-5e7dba726896fcb84882b53952651742926e6efb.zip opensim-SC_OLD-5e7dba726896fcb84882b53952651742926e6efb.tar.gz opensim-SC_OLD-5e7dba726896fcb84882b53952651742926e6efb.tar.bz2 opensim-SC_OLD-5e7dba726896fcb84882b53952651742926e6efb.tar.xz |
Very early first implementation of grid based assets.
Run this on a major grid, and weep
Diffstat (limited to 'OpenSim/Framework/Data.MySQL')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs index a8f0fdb..0112474 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | |||
@@ -71,22 +71,24 @@ namespace OpenSim.Framework.Data.MySQL | |||
71 | public AssetBase FetchAsset(LLUUID assetID) | 71 | public AssetBase FetchAsset(LLUUID assetID) |
72 | { | 72 | { |
73 | AssetBase asset = null; | 73 | AssetBase asset = null; |
74 | 74 | lock (_dbConnection) | |
75 | MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection); | ||
76 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); | ||
77 | p.Value = assetID.GetBytes(); | ||
78 | using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow)) | ||
79 | { | 75 | { |
80 | if (dbReader.Read()) | 76 | MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection); |
77 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); | ||
78 | p.Value = assetID.GetBytes(); | ||
79 | using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow)) | ||
81 | { | 80 | { |
82 | asset = new AssetBase(); | 81 | if (dbReader.Read()) |
83 | asset.Data = (byte[])dbReader["data"]; | 82 | { |
84 | asset.Description = (string)dbReader["description"]; | 83 | asset = new AssetBase(); |
85 | asset.FullID = assetID; | 84 | asset.Data = (byte[])dbReader["data"]; |
86 | asset.InvType = (sbyte)dbReader["invType"]; | 85 | asset.Description = (string)dbReader["description"]; |
87 | asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false; | 86 | asset.FullID = assetID; |
88 | asset.Name = (string)dbReader["name"]; | 87 | asset.InvType = (sbyte)dbReader["invType"]; |
89 | asset.Type = (sbyte)dbReader["assetType"]; | 88 | asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false; |
89 | asset.Name = (string)dbReader["name"]; | ||
90 | asset.Type = (sbyte)dbReader["assetType"]; | ||
91 | } | ||
90 | } | 92 | } |
91 | } | 93 | } |
92 | return asset; | 94 | return asset; |