aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLAssetData.cs
diff options
context:
space:
mode:
authorAlexRa2010-05-19 21:30:16 +0300
committerAlexRa2010-05-19 21:50:32 +0300
commit64fe823b9255f0314277f80926435d5525039a2d (patch)
treea6ba590230a9edd5c333b3c7628302ce0764400c /OpenSim/Data/MySQL/MySQLAssetData.cs
parentMySQL: added CreatorID, moved asset_flag to migration script (diff)
downloadopensim-SC-64fe823b9255f0314277f80926435d5525039a2d.zip
opensim-SC-64fe823b9255f0314277f80926435d5525039a2d.tar.gz
opensim-SC-64fe823b9255f0314277f80926435d5525039a2d.tar.bz2
opensim-SC-64fe823b9255f0314277f80926435d5525039a2d.tar.xz
MySQLAssetData.cs now supports asset_flags, CreatorID
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index ec18c28..fe5152a 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Data.MySQL
112 dbcon.Open(); 112 dbcon.Open();
113 113
114 using (MySqlCommand cmd = new MySqlCommand( 114 using (MySqlCommand cmd = new MySqlCommand(
115 "SELECT name, description, assetType, local, temporary, asset_flags, data FROM assets WHERE id=?id", 115 "SELECT name, description, assetType, local, temporary, asset_flags, CreatorID, data FROM assets WHERE id=?id",
116 dbcon)) 116 dbcon))
117 { 117 {
118 cmd.Parameters.AddWithValue("?id", assetID.ToString()); 118 cmd.Parameters.AddWithValue("?id", assetID.ToString());
@@ -123,7 +123,7 @@ namespace OpenSim.Data.MySQL
123 { 123 {
124 if (dbReader.Read()) 124 if (dbReader.Read())
125 { 125 {
126 asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"], UUID.Zero.ToString()); 126 asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"], dbReader["CreatorID"].ToString());
127 asset.Data = (byte[])dbReader["data"]; 127 asset.Data = (byte[])dbReader["data"];
128 asset.Description = (string)dbReader["description"]; 128 asset.Description = (string)dbReader["description"];
129 129
@@ -163,8 +163,8 @@ namespace OpenSim.Data.MySQL
163 163
164 MySqlCommand cmd = 164 MySqlCommand cmd =
165 new MySqlCommand( 165 new MySqlCommand(
166 "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, data)" + 166 "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, CreatorID, data)" +
167 "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?data)", 167 "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?CreatorID, ?data)",
168 dbcon); 168 dbcon);
169 169
170 string assetName = asset.Name; 170 string assetName = asset.Name;
@@ -196,6 +196,7 @@ namespace OpenSim.Data.MySQL
196 cmd.Parameters.AddWithValue("?temporary", asset.Temporary); 196 cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
197 cmd.Parameters.AddWithValue("?create_time", now); 197 cmd.Parameters.AddWithValue("?create_time", now);
198 cmd.Parameters.AddWithValue("?access_time", now); 198 cmd.Parameters.AddWithValue("?access_time", now);
199 cmd.Parameters.AddWithValue("?CreatorID", asset.Metadata.CreatorID);
199 cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags); 200 cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
200 cmd.Parameters.AddWithValue("?data", asset.Data); 201 cmd.Parameters.AddWithValue("?data", asset.Data);
201 cmd.ExecuteNonQuery(); 202 cmd.ExecuteNonQuery();
@@ -305,7 +306,7 @@ namespace OpenSim.Data.MySQL
305 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 306 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
306 { 307 {
307 dbcon.Open(); 308 dbcon.Open();
308 MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags FROM assets LIMIT ?start, ?count", dbcon); 309 MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags,CreatorID FROM assets LIMIT ?start, ?count", dbcon);
309 cmd.Parameters.AddWithValue("?start", start); 310 cmd.Parameters.AddWithValue("?start", start);
310 cmd.Parameters.AddWithValue("?count", count); 311 cmd.Parameters.AddWithValue("?count", count);
311 312
@@ -322,6 +323,7 @@ namespace OpenSim.Data.MySQL
322 metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. 323 metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
323 metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]); 324 metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
324 metadata.FullID = DBGuid.FromDB(dbReader["id"]); 325 metadata.FullID = DBGuid.FromDB(dbReader["id"]);
326 metadata.CreatorID = dbReader["CreatorID"].ToString();
325 327
326 // Current SHA1s are not stored/computed. 328 // Current SHA1s are not stored/computed.
327 metadata.SHA1 = new byte[] { }; 329 metadata.SHA1 = new byte[] { };