diff options
author | Mike Mazur | 2009-02-17 01:36:44 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-17 01:36:44 +0000 |
commit | 76c0935ec744f2d230489398f879eb7f42b11d37 (patch) | |
tree | a68253554e3899f10b6c341db369ce4a029dfaa5 /OpenSim | |
parent | Major change to how appearance is managed, including changes in login and use... (diff) | |
download | opensim-SC_OLD-76c0935ec744f2d230489398f879eb7f42b11d37.zip opensim-SC_OLD-76c0935ec744f2d230489398f879eb7f42b11d37.tar.gz opensim-SC_OLD-76c0935ec744f2d230489398f879eb7f42b11d37.tar.bz2 opensim-SC_OLD-76c0935ec744f2d230489398f879eb7f42b11d37.tar.xz |
- remove the Metadata property from AssetBase and return all previous
properties as before
- prefix private variables with m_ in AssetBase.cs
- related to Mantis #3122, as mentioned in
https://lists.berlios.de/pipermail/opensim-dev/2009-February/005088.html
- all services will likely need to be upgraded after this commit
Diffstat (limited to 'OpenSim')
38 files changed, 393 insertions, 358 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index 2996030..3475d32 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs | |||
@@ -212,12 +212,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
212 | 212 | ||
213 | rdata.writer.WriteStartElement(String.Empty,"Asset",String.Empty); | 213 | rdata.writer.WriteStartElement(String.Empty,"Asset",String.Empty); |
214 | 214 | ||
215 | rdata.writer.WriteAttributeString("id", asset.Metadata.ID); | 215 | rdata.writer.WriteAttributeString("id", asset.ID); |
216 | rdata.writer.WriteAttributeString("name", asset.Metadata.Name); | 216 | rdata.writer.WriteAttributeString("name", asset.Name); |
217 | rdata.writer.WriteAttributeString("desc", asset.Metadata.Description); | 217 | rdata.writer.WriteAttributeString("desc", asset.Description); |
218 | rdata.writer.WriteAttributeString("type", asset.Metadata.Type.ToString()); | 218 | rdata.writer.WriteAttributeString("type", asset.Type.ToString()); |
219 | rdata.writer.WriteAttributeString("local", asset.Metadata.Local.ToString()); | 219 | rdata.writer.WriteAttributeString("local", asset.Local.ToString()); |
220 | rdata.writer.WriteAttributeString("temporary", asset.Metadata.Temporary.ToString()); | 220 | rdata.writer.WriteAttributeString("temporary", asset.Temporary.ToString()); |
221 | 221 | ||
222 | rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length); | 222 | rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length); |
223 | 223 | ||
@@ -268,19 +268,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
268 | modified = (asset != null); | 268 | modified = (asset != null); |
269 | created = !modified; | 269 | created = !modified; |
270 | 270 | ||
271 | asset = new AssetBase(); | 271 | asset = new AssetBase(); |
272 | asset.Metadata.FullID = uuid; | 272 | asset.FullID = uuid; |
273 | asset.Metadata.Name = xml.GetAttribute("name"); | 273 | asset.Name = xml.GetAttribute("name"); |
274 | asset.Metadata.Description = xml.GetAttribute("desc"); | 274 | asset.Description = xml.GetAttribute("desc"); |
275 | asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type")); | 275 | asset.Type = SByte.Parse(xml.GetAttribute("type")); |
276 | asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0; | 276 | asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; |
277 | asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; | 277 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; |
278 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); | 278 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); |
279 | 279 | ||
280 | if (asset.Metadata.ID != rdata.Parameters[0]) | 280 | if (asset.ID != rdata.Parameters[0]) |
281 | { | 281 | { |
282 | Rest.Log.WarnFormat("{0} URI and payload disagree on UUID U:{1} vs P:{2}", | 282 | Rest.Log.WarnFormat("{0} URI and payload disagree on UUID U:{1} vs P:{2}", |
283 | MsgId, rdata.Parameters[0], asset.Metadata.ID); | 283 | MsgId, rdata.Parameters[0], asset.ID); |
284 | } | 284 | } |
285 | 285 | ||
286 | Rest.AssetServices.AddAsset(asset); | 286 | Rest.AssetServices.AddAsset(asset); |
@@ -294,14 +294,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
294 | 294 | ||
295 | if (created) | 295 | if (created) |
296 | { | 296 | { |
297 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); | 297 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID)); |
298 | rdata.Complete(Rest.HttpStatusCodeCreated); | 298 | rdata.Complete(Rest.HttpStatusCodeCreated); |
299 | } | 299 | } |
300 | else | 300 | else |
301 | { | 301 | { |
302 | if (modified) | 302 | if (modified) |
303 | { | 303 | { |
304 | rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); | 304 | rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID)); |
305 | rdata.Complete(Rest.HttpStatusCodeOK); | 305 | rdata.Complete(Rest.HttpStatusCodeOK); |
306 | } | 306 | } |
307 | else | 307 | else |
@@ -348,27 +348,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
348 | modified = (asset != null); | 348 | modified = (asset != null); |
349 | created = !modified; | 349 | created = !modified; |
350 | 350 | ||
351 | asset = new AssetBase(); | 351 | asset = new AssetBase(); |
352 | asset.Metadata.FullID = uuid; | 352 | asset.FullID = uuid; |
353 | asset.Metadata.Name = xml.GetAttribute("name"); | 353 | asset.Name = xml.GetAttribute("name"); |
354 | asset.Metadata.Description = xml.GetAttribute("desc"); | 354 | asset.Description = xml.GetAttribute("desc"); |
355 | asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type")); | 355 | asset.Type = SByte.Parse(xml.GetAttribute("type")); |
356 | asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0; | 356 | asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; |
357 | asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; | 357 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; |
358 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); | 358 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); |
359 | 359 | ||
360 | Rest.AssetServices.AddAsset(asset); | 360 | Rest.AssetServices.AddAsset(asset); |
361 | 361 | ||
362 | if (created) | 362 | if (created) |
363 | { | 363 | { |
364 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); | 364 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID)); |
365 | rdata.Complete(Rest.HttpStatusCodeCreated); | 365 | rdata.Complete(Rest.HttpStatusCodeCreated); |
366 | } | 366 | } |
367 | else | 367 | else |
368 | { | 368 | { |
369 | if (modified) | 369 | if (modified) |
370 | { | 370 | { |
371 | rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); | 371 | rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID)); |
372 | rdata.Complete(Rest.HttpStatusCodeOK); | 372 | rdata.Complete(Rest.HttpStatusCodeOK); |
373 | } | 373 | } |
374 | else | 374 | else |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 853b004..9935046 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | |||
@@ -488,12 +488,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
488 | foreach (AssetBase asset in entity.Assets) | 488 | foreach (AssetBase asset in entity.Assets) |
489 | { | 489 | { |
490 | Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", | 490 | Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", |
491 | MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.Name); | 491 | MsgId, asset.ID, asset.Type, asset.Name); |
492 | Rest.AssetServices.AddAsset(asset); | 492 | Rest.AssetServices.AddAsset(asset); |
493 | 493 | ||
494 | created = true; | 494 | created = true; |
495 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", | 495 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", |
496 | asset.Metadata.Name, asset.Metadata.ID)); | 496 | asset.Name, asset.ID)); |
497 | 497 | ||
498 | if (Rest.DEBUG && Rest.DumpAsset) | 498 | if (Rest.DEBUG && Rest.DumpAsset) |
499 | { | 499 | { |
@@ -691,14 +691,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
691 | foreach (AssetBase asset in entity.Assets) | 691 | foreach (AssetBase asset in entity.Assets) |
692 | { | 692 | { |
693 | Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", | 693 | Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", |
694 | MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.Name); | 694 | MsgId, asset.ID, asset.Type, asset.Name); |
695 | 695 | ||
696 | // The asset was validated during the collection process | 696 | // The asset was validated during the collection process |
697 | 697 | ||
698 | Rest.AssetServices.AddAsset(asset); | 698 | Rest.AssetServices.AddAsset(asset); |
699 | 699 | ||
700 | created = true; | 700 | created = true; |
701 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.ID)); | 701 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.ID)); |
702 | 702 | ||
703 | if (Rest.DEBUG && Rest.DumpAsset) | 703 | if (Rest.DEBUG && Rest.DumpAsset) |
704 | { | 704 | { |
@@ -1884,10 +1884,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1884 | 1884 | ||
1885 | asset = new AssetBase(uuid, name); | 1885 | asset = new AssetBase(uuid, name); |
1886 | 1886 | ||
1887 | asset.Metadata.Description = desc; | 1887 | asset.Description = desc; |
1888 | asset.Metadata.Type = type; // type == 0 == texture | 1888 | asset.Type = type; // type == 0 == texture |
1889 | asset.Metadata.Local = local; | 1889 | asset.Local = local; |
1890 | asset.Metadata.Temporary = temp; | 1890 | asset.Temporary = temp; |
1891 | 1891 | ||
1892 | b64string = ic.xml.ReadElementContentAsString(); | 1892 | b64string = ic.xml.ReadElementContentAsString(); |
1893 | 1893 | ||
@@ -2039,10 +2039,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
2039 | 2039 | ||
2040 | if (ic.Asset != null) | 2040 | if (ic.Asset != null) |
2041 | { | 2041 | { |
2042 | if (ic.Asset.Metadata.Name == String.Empty) | 2042 | if (ic.Asset.Name == String.Empty) |
2043 | ic.Asset.Metadata.Name = ic.Item.Name; | 2043 | ic.Asset.Name = ic.Item.Name; |
2044 | if (ic.Asset.Metadata.Description == String.Empty) | 2044 | if (ic.Asset.Description == String.Empty) |
2045 | ic.Asset.Metadata.Description = ic.Item.Description; | 2045 | ic.Asset.Description = ic.Item.Description; |
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | // Assign permissions | 2048 | // Assign permissions |
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 27deef7..0361a7d 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -132,12 +132,12 @@ namespace OpenSim.Data.MSSQL | |||
132 | { | 132 | { |
133 | AssetBase asset = new AssetBase(); | 133 | AssetBase asset = new AssetBase(); |
134 | // Region Main | 134 | // Region Main |
135 | asset.Metadata.FullID = new UUID((string)reader["id"]); | 135 | asset.FullID = new UUID((string)reader["id"]); |
136 | asset.Metadata.Name = (string)reader["name"]; | 136 | asset.Name = (string)reader["name"]; |
137 | asset.Metadata.Description = (string)reader["description"]; | 137 | asset.Description = (string)reader["description"]; |
138 | asset.Metadata.Type = Convert.ToSByte(reader["assetType"]); | 138 | asset.Type = Convert.ToSByte(reader["assetType"]); |
139 | asset.Metadata.Local = Convert.ToBoolean(reader["local"]); | 139 | asset.Local = Convert.ToBoolean(reader["local"]); |
140 | asset.Metadata.Temporary = Convert.ToBoolean(reader["temporary"]); | 140 | asset.Temporary = Convert.ToBoolean(reader["temporary"]); |
141 | asset.Data = (byte[])reader["data"]; | 141 | asset.Data = (byte[])reader["data"]; |
142 | return asset; | 142 | return asset; |
143 | } | 143 | } |
@@ -152,7 +152,7 @@ namespace OpenSim.Data.MSSQL | |||
152 | /// <param name="asset">the asset</param> | 152 | /// <param name="asset">the asset</param> |
153 | override public void CreateAsset(AssetBase asset) | 153 | override public void CreateAsset(AssetBase asset) |
154 | { | 154 | { |
155 | if (ExistsAsset(asset.Metadata.FullID)) | 155 | if (ExistsAsset(asset.FullID)) |
156 | { | 156 | { |
157 | return; | 157 | return; |
158 | } | 158 | } |
@@ -163,12 +163,12 @@ namespace OpenSim.Data.MSSQL | |||
163 | "(@id, @name, @description, @assetType, @local, @temporary, @create_time, @access_time, @data)")) | 163 | "(@id, @name, @description, @assetType, @local, @temporary, @create_time, @access_time, @data)")) |
164 | { | 164 | { |
165 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 165 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
166 | command.Parameters.Add(database.CreateParameter("id", asset.Metadata.FullID)); | 166 | command.Parameters.Add(database.CreateParameter("id", asset.FullID)); |
167 | command.Parameters.Add(database.CreateParameter("name", asset.Metadata.Name)); | 167 | command.Parameters.Add(database.CreateParameter("name", asset.Name)); |
168 | command.Parameters.Add(database.CreateParameter("description", asset.Metadata.Description)); | 168 | command.Parameters.Add(database.CreateParameter("description", asset.Description)); |
169 | command.Parameters.Add(database.CreateParameter("assetType", asset.Metadata.Type)); | 169 | command.Parameters.Add(database.CreateParameter("assetType", asset.Type)); |
170 | command.Parameters.Add(database.CreateParameter("local", asset.Metadata.Local)); | 170 | command.Parameters.Add(database.CreateParameter("local", asset.Local)); |
171 | command.Parameters.Add(database.CreateParameter("temporary", asset.Metadata.Temporary)); | 171 | command.Parameters.Add(database.CreateParameter("temporary", asset.Temporary)); |
172 | command.Parameters.Add(database.CreateParameter("access_time", now)); | 172 | command.Parameters.Add(database.CreateParameter("access_time", now)); |
173 | command.Parameters.Add(database.CreateParameter("create_time", now)); | 173 | command.Parameters.Add(database.CreateParameter("create_time", now)); |
174 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); | 174 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); |
@@ -192,14 +192,14 @@ namespace OpenSim.Data.MSSQL | |||
192 | "data = @data where " + | 192 | "data = @data where " + |
193 | "id = @keyId;")) | 193 | "id = @keyId;")) |
194 | { | 194 | { |
195 | command.Parameters.Add(database.CreateParameter("id", asset.Metadata.FullID)); | 195 | command.Parameters.Add(database.CreateParameter("id", asset.FullID)); |
196 | command.Parameters.Add(database.CreateParameter("name", asset.Metadata.Name)); | 196 | command.Parameters.Add(database.CreateParameter("name", asset.Name)); |
197 | command.Parameters.Add(database.CreateParameter("description", asset.Metadata.Description)); | 197 | command.Parameters.Add(database.CreateParameter("description", asset.Description)); |
198 | command.Parameters.Add(database.CreateParameter("assetType", asset.Metadata.Type)); | 198 | command.Parameters.Add(database.CreateParameter("assetType", asset.Type)); |
199 | command.Parameters.Add(database.CreateParameter("local", asset.Metadata.Local)); | 199 | command.Parameters.Add(database.CreateParameter("local", asset.Local)); |
200 | command.Parameters.Add(database.CreateParameter("temporary", asset.Metadata.Temporary)); | 200 | command.Parameters.Add(database.CreateParameter("temporary", asset.Temporary)); |
201 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); | 201 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); |
202 | command.Parameters.Add(database.CreateParameter("@keyId", asset.Metadata.FullID)); | 202 | command.Parameters.Add(database.CreateParameter("@keyId", asset.FullID)); |
203 | 203 | ||
204 | try | 204 | try |
205 | { | 205 | { |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 508e053..2211d4c 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -137,18 +137,18 @@ namespace OpenSim.Data.MySQL | |||
137 | { | 137 | { |
138 | asset = new AssetBase(); | 138 | asset = new AssetBase(); |
139 | asset.Data = (byte[]) dbReader["data"]; | 139 | asset.Data = (byte[]) dbReader["data"]; |
140 | asset.Metadata.Description = (string) dbReader["description"]; | 140 | asset.Description = (string) dbReader["description"]; |
141 | asset.Metadata.FullID = assetID; | 141 | asset.FullID = assetID; |
142 | try | 142 | try |
143 | { | 143 | { |
144 | asset.Metadata.Local = (bool)dbReader["local"]; | 144 | asset.Local = (bool)dbReader["local"]; |
145 | } | 145 | } |
146 | catch (InvalidCastException) | 146 | catch (InvalidCastException) |
147 | { | 147 | { |
148 | asset.Metadata.Local = false; | 148 | asset.Local = false; |
149 | } | 149 | } |
150 | asset.Metadata.Name = (string) dbReader["name"]; | 150 | asset.Name = (string) dbReader["name"]; |
151 | asset.Metadata.Type = (sbyte) dbReader["assetType"]; | 151 | asset.Type = (sbyte) dbReader["assetType"]; |
152 | } | 152 | } |
153 | dbReader.Close(); | 153 | dbReader.Close(); |
154 | cmd.Dispose(); | 154 | cmd.Dispose(); |
@@ -176,8 +176,8 @@ namespace OpenSim.Data.MySQL | |||
176 | { | 176 | { |
177 | lock (_dbConnection) | 177 | lock (_dbConnection) |
178 | { | 178 | { |
179 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.Metadata.FullID)); | 179 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); |
180 | if (ExistsAsset(asset.Metadata.FullID)) | 180 | if (ExistsAsset(asset.FullID)) |
181 | { | 181 | { |
182 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); | 182 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); |
183 | return; | 183 | return; |
@@ -198,12 +198,12 @@ namespace OpenSim.Data.MySQL | |||
198 | { | 198 | { |
199 | // create unix epoch time | 199 | // create unix epoch time |
200 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 200 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
201 | cmd.Parameters.AddWithValue("?id", asset.Metadata.ID); | 201 | cmd.Parameters.AddWithValue("?id", asset.ID); |
202 | cmd.Parameters.AddWithValue("?name", asset.Metadata.Name); | 202 | cmd.Parameters.AddWithValue("?name", asset.Name); |
203 | cmd.Parameters.AddWithValue("?description", asset.Metadata.Description); | 203 | cmd.Parameters.AddWithValue("?description", asset.Description); |
204 | cmd.Parameters.AddWithValue("?assetType", asset.Metadata.Type); | 204 | cmd.Parameters.AddWithValue("?assetType", asset.Type); |
205 | cmd.Parameters.AddWithValue("?local", asset.Metadata.Local); | 205 | cmd.Parameters.AddWithValue("?local", asset.Local); |
206 | cmd.Parameters.AddWithValue("?temporary", asset.Metadata.Temporary); | 206 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); |
207 | cmd.Parameters.AddWithValue("?create_time", now); | 207 | cmd.Parameters.AddWithValue("?create_time", now); |
208 | cmd.Parameters.AddWithValue("?access_time", now); | 208 | cmd.Parameters.AddWithValue("?access_time", now); |
209 | cmd.Parameters.AddWithValue("?data", asset.Data); | 209 | cmd.Parameters.AddWithValue("?data", asset.Data); |
@@ -216,7 +216,7 @@ namespace OpenSim.Data.MySQL | |||
216 | m_log.ErrorFormat( | 216 | m_log.ErrorFormat( |
217 | "[ASSETS DB]: " + | 217 | "[ASSETS DB]: " + |
218 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() | 218 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() |
219 | + Environment.NewLine + "Attempting reconnection", asset.Metadata.FullID, asset.Metadata.Name); | 219 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); |
220 | _dbConnection.Reconnect(); | 220 | _dbConnection.Reconnect(); |
221 | } | 221 | } |
222 | } | 222 | } |
@@ -239,7 +239,7 @@ namespace OpenSim.Data.MySQL | |||
239 | { | 239 | { |
240 | // create unix epoch time | 240 | // create unix epoch time |
241 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 241 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
242 | cmd.Parameters.AddWithValue("?id", asset.Metadata.ID); | 242 | cmd.Parameters.AddWithValue("?id", asset.ID); |
243 | cmd.Parameters.AddWithValue("?access_time", now); | 243 | cmd.Parameters.AddWithValue("?access_time", now); |
244 | cmd.ExecuteNonQuery(); | 244 | cmd.ExecuteNonQuery(); |
245 | cmd.Dispose(); | 245 | cmd.Dispose(); |
@@ -250,7 +250,7 @@ namespace OpenSim.Data.MySQL | |||
250 | m_log.ErrorFormat( | 250 | m_log.ErrorFormat( |
251 | "[ASSETS DB]: " + | 251 | "[ASSETS DB]: " + |
252 | "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() | 252 | "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() |
253 | + Environment.NewLine + "Attempting reconnection", asset.Metadata.FullID, asset.Metadata.Name); | 253 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); |
254 | _dbConnection.Reconnect(); | 254 | _dbConnection.Reconnect(); |
255 | } | 255 | } |
256 | } | 256 | } |
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index 8f4877d..95595db 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Data.NHibernate | |||
64 | 64 | ||
65 | private void Save(AssetBase asset) | 65 | private void Save(AssetBase asset) |
66 | { | 66 | { |
67 | AssetBase temp = (AssetBase)manager.Get(typeof(AssetBase), asset.Metadata.FullID); | 67 | AssetBase temp = (AssetBase)manager.Get(typeof(AssetBase), asset.FullID); |
68 | if (temp == null) | 68 | if (temp == null) |
69 | { | 69 | { |
70 | manager.Insert(asset); | 70 | manager.Insert(asset); |
@@ -73,13 +73,13 @@ namespace OpenSim.Data.NHibernate | |||
73 | 73 | ||
74 | override public void CreateAsset(AssetBase asset) | 74 | override public void CreateAsset(AssetBase asset) |
75 | { | 75 | { |
76 | m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.Metadata.FullID); | 76 | m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.FullID); |
77 | Save(asset); | 77 | Save(asset); |
78 | } | 78 | } |
79 | 79 | ||
80 | override public void UpdateAsset(AssetBase asset) | 80 | override public void UpdateAsset(AssetBase asset) |
81 | { | 81 | { |
82 | m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.Metadata.FullID); | 82 | m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.FullID); |
83 | manager.Update(asset); | 83 | manager.Update(asset); |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/OpenSim/Data/NHibernate/Resources/AssetBase.hbm.xml b/OpenSim/Data/NHibernate/Resources/AssetBase.hbm.xml index db400ea..cb8b36d 100644 --- a/OpenSim/Data/NHibernate/Resources/AssetBase.hbm.xml +++ b/OpenSim/Data/NHibernate/Resources/AssetBase.hbm.xml | |||
@@ -1,16 +1,14 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | 1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> | 2 | <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> |
3 | <class name="OpenSim.Framework.AssetBase, OpenSim.Framework" table="Assets" lazy="false"> | 3 | <class name="OpenSim.Framework.AssetBase, OpenSim.Framework" table="Assets" lazy="false"> |
4 | <id name="FullID" column="ID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate"> | 4 | <id name="FullID" column="ID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate"> |
5 | <generator class="assigned" /> | 5 | <generator class="assigned" /> |
6 | </id> | 6 | </id> |
7 | <property name="Type" type="OpenSim.Data.NHibernate.SByteType, OpenSim.Data.NHibernate" /> | ||
8 | <property name="Name" type="String" length="64" /> | ||
9 | <property name="Description" type="String" length="64" /> | ||
10 | <property name="Local" type="boolean" /> | ||
11 | <property name="Temporary" type="boolean" /> | ||
7 | <property name="Data" type="binary" /> | 12 | <property name="Data" type="binary" /> |
8 | <component name="Metadata"> | ||
9 | <property name="Type" type="OpenSim.Data.NHibernate.SByteType, OpenSim.Data.NHibernate" /> | ||
10 | <property name="Name" type="String" length="64" /> | ||
11 | <property name="Description" type="String" length="64" /> | ||
12 | <property name="Local" type="boolean" /> | ||
13 | <property name="Temporary" type="boolean" /> | ||
14 | </component> | ||
15 | </class> | 13 | </class> |
16 | </hibernate-mapping> | 14 | </hibernate-mapping> |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index f6f62a7..1b42198 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -125,8 +125,8 @@ namespace OpenSim.Data.SQLite | |||
125 | /// <param name="asset">Asset Base</param> | 125 | /// <param name="asset">Asset Base</param> |
126 | override public void CreateAsset(AssetBase asset) | 126 | override public void CreateAsset(AssetBase asset) |
127 | { | 127 | { |
128 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.Metadata.FullID)); | 128 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); |
129 | if (ExistsAsset(asset.Metadata.FullID)) | 129 | if (ExistsAsset(asset.FullID)) |
130 | { | 130 | { |
131 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); | 131 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); |
132 | } | 132 | } |
@@ -136,12 +136,12 @@ namespace OpenSim.Data.SQLite | |||
136 | { | 136 | { |
137 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) | 137 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) |
138 | { | 138 | { |
139 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.Metadata.FullID))); | 139 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); |
140 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Metadata.Name)); | 140 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); |
141 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Metadata.Description)); | 141 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); |
142 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Metadata.Type)); | 142 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
143 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Metadata.Local)); | 143 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
144 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Metadata.Temporary)); | 144 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
145 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 145 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
146 | 146 | ||
147 | cmd.ExecuteNonQuery(); | 147 | cmd.ExecuteNonQuery(); |
@@ -162,12 +162,12 @@ namespace OpenSim.Data.SQLite | |||
162 | { | 162 | { |
163 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) | 163 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) |
164 | { | 164 | { |
165 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.Metadata.FullID))); | 165 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); |
166 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Metadata.Name)); | 166 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); |
167 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Metadata.Description)); | 167 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); |
168 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Metadata.Type)); | 168 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
169 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Metadata.Local)); | 169 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
170 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Metadata.Temporary)); | 170 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
171 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 171 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
172 | 172 | ||
173 | cmd.ExecuteNonQuery(); | 173 | cmd.ExecuteNonQuery(); |
@@ -181,14 +181,14 @@ namespace OpenSim.Data.SQLite | |||
181 | /// <param name="asset"></param> | 181 | /// <param name="asset"></param> |
182 | private static void LogAssetLoad(AssetBase asset) | 182 | private static void LogAssetLoad(AssetBase asset) |
183 | { | 183 | { |
184 | string temporary = asset.Metadata.Temporary ? "Temporary" : "Stored"; | 184 | string temporary = asset.Temporary ? "Temporary" : "Stored"; |
185 | string local = asset.Metadata.Local ? "Local" : "Remote"; | 185 | string local = asset.Local ? "Local" : "Remote"; |
186 | 186 | ||
187 | int assetLength = (asset.Data != null) ? asset.Data.Length : 0; | 187 | int assetLength = (asset.Data != null) ? asset.Data.Length : 0; |
188 | 188 | ||
189 | m_log.Info("[ASSET DB]: " + | 189 | m_log.Info("[ASSET DB]: " + |
190 | string.Format("Loaded {6} {5} Asset: [{0}][{3}] \"{1}\":{2} ({7} bytes)", | 190 | string.Format("Loaded {6} {5} Asset: [{0}][{3}] \"{1}\":{2} ({7} bytes)", |
191 | asset.Metadata.FullID, asset.Metadata.Name, asset.Metadata.Description, asset.Metadata.Type, | 191 | asset.FullID, asset.Name, asset.Description, asset.Type, |
192 | temporary, local, assetLength)); | 192 | temporary, local, assetLength)); |
193 | } | 193 | } |
194 | 194 | ||
@@ -246,12 +246,12 @@ namespace OpenSim.Data.SQLite | |||
246 | // back out. Not enough time to figure it out yet. | 246 | // back out. Not enough time to figure it out yet. |
247 | AssetBase asset = new AssetBase(); | 247 | AssetBase asset = new AssetBase(); |
248 | 248 | ||
249 | asset.Metadata.FullID = new UUID((String) row["UUID"]); | 249 | asset.FullID = new UUID((String) row["UUID"]); |
250 | asset.Metadata.Name = (String) row["Name"]; | 250 | asset.Name = (String) row["Name"]; |
251 | asset.Metadata.Description = (String) row["Description"]; | 251 | asset.Description = (String) row["Description"]; |
252 | asset.Metadata.Type = Convert.ToSByte(row["Type"]); | 252 | asset.Type = Convert.ToSByte(row["Type"]); |
253 | asset.Metadata.Local = Convert.ToBoolean(row["Local"]); | 253 | asset.Local = Convert.ToBoolean(row["Local"]); |
254 | asset.Metadata.Temporary = Convert.ToBoolean(row["Temporary"]); | 254 | asset.Temporary = Convert.ToBoolean(row["Temporary"]); |
255 | asset.Data = (byte[]) row["Data"]; | 255 | asset.Data = (byte[]) row["Data"]; |
256 | return asset; | 256 | return asset; |
257 | } | 257 | } |
diff --git a/OpenSim/Data/Tests/BasicAssetTest.cs b/OpenSim/Data/Tests/BasicAssetTest.cs index 4d2bbc7..500b646 100644 --- a/OpenSim/Data/Tests/BasicAssetTest.cs +++ b/OpenSim/Data/Tests/BasicAssetTest.cs | |||
@@ -83,16 +83,16 @@ namespace OpenSim.Data.Tests | |||
83 | db.CreateAsset(a3); | 83 | db.CreateAsset(a3); |
84 | 84 | ||
85 | AssetBase a1a = db.FetchAsset(uuid1); | 85 | AssetBase a1a = db.FetchAsset(uuid1); |
86 | Assert.That(a1.Metadata.ID, Is.EqualTo(a1a.Metadata.ID)); | 86 | Assert.That(a1.ID, Is.EqualTo(a1a.ID)); |
87 | Assert.That(a1.Metadata.Name, Is.EqualTo(a1a.Metadata.Name)); | 87 | Assert.That(a1.Name, Is.EqualTo(a1a.Name)); |
88 | 88 | ||
89 | AssetBase a2a = db.FetchAsset(uuid2); | 89 | AssetBase a2a = db.FetchAsset(uuid2); |
90 | Assert.That(a2.Metadata.ID, Is.EqualTo(a2a.Metadata.ID)); | 90 | Assert.That(a2.ID, Is.EqualTo(a2a.ID)); |
91 | Assert.That(a2.Metadata.Name, Is.EqualTo(a2a.Metadata.Name)); | 91 | Assert.That(a2.Name, Is.EqualTo(a2a.Name)); |
92 | 92 | ||
93 | AssetBase a3a = db.FetchAsset(uuid3); | 93 | AssetBase a3a = db.FetchAsset(uuid3); |
94 | Assert.That(a3.Metadata.ID, Is.EqualTo(a3a.Metadata.ID)); | 94 | Assert.That(a3.ID, Is.EqualTo(a3a.ID)); |
95 | Assert.That(a3.Metadata.Name, Is.EqualTo(a3a.Metadata.Name)); | 95 | Assert.That(a3.Name, Is.EqualTo(a3a.Name)); |
96 | } | 96 | } |
97 | 97 | ||
98 | [Test] | 98 | [Test] |
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index dfe559e..f3dd70a 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs | |||
@@ -33,128 +33,166 @@ namespace OpenSim.Framework | |||
33 | [Serializable] | 33 | [Serializable] |
34 | public class AssetBase | 34 | public class AssetBase |
35 | { | 35 | { |
36 | private byte[] _data; | 36 | private byte[] m_data; |
37 | private AssetMetadata _metadata; | 37 | private AssetMetadata m_metadata; |
38 | 38 | ||
39 | public AssetBase() | 39 | public AssetBase() |
40 | { | 40 | { |
41 | Metadata = new AssetMetadata(); | 41 | m_metadata = new AssetMetadata(); |
42 | } | 42 | } |
43 | 43 | ||
44 | public AssetBase(UUID assetId, string name) | 44 | public AssetBase(UUID assetId, string name) |
45 | { | 45 | { |
46 | Metadata = new AssetMetadata(); | 46 | m_metadata = new AssetMetadata(); |
47 | Metadata.FullID = assetId; | 47 | m_metadata.FullID = assetId; |
48 | Metadata.Name = name; | 48 | m_metadata.Name = name; |
49 | } | 49 | } |
50 | 50 | ||
51 | public virtual byte[] Data | 51 | public virtual byte[] Data |
52 | { | 52 | { |
53 | get { return _data; } | 53 | get { return m_data; } |
54 | set { _data = value; } | 54 | set { m_data = value; } |
55 | } | 55 | } |
56 | 56 | ||
57 | public virtual AssetMetadata Metadata | 57 | public UUID FullID |
58 | { | 58 | { |
59 | get { return _metadata; } | 59 | get { return m_metadata.FullID; } |
60 | set { _metadata = value; } | 60 | set { m_metadata.FullID = value; } |
61 | } | 61 | } |
62 | 62 | ||
63 | // We expose FullID here because the NHibernate mappers require a | 63 | public string ID |
64 | // property on the AssetBase class for its primary key (see | 64 | { |
65 | // OpenSim/Data/NHibernate/Resources/AssetBase.hbm.xml). | 65 | get { return m_metadata.ID; } |
66 | public UUID FullID | 66 | set { m_metadata.ID = value; } |
67 | } | ||
68 | |||
69 | public string Name | ||
70 | { | ||
71 | get { return m_metadata.Name; } | ||
72 | set { m_metadata.Name = value; } | ||
73 | } | ||
74 | |||
75 | public string Description | ||
76 | { | ||
77 | get { return m_metadata.Description; } | ||
78 | set { m_metadata.Description = value; } | ||
79 | } | ||
80 | |||
81 | public sbyte Type | ||
67 | { | 82 | { |
68 | get { return Metadata.FullID; } | 83 | get { return m_metadata.Type; } |
69 | set { Metadata.FullID = value; } | 84 | set { m_metadata.Type = value; } |
85 | } | ||
86 | |||
87 | public bool Local | ||
88 | { | ||
89 | get { return m_metadata.Local; } | ||
90 | set { m_metadata.Local = value; } | ||
91 | } | ||
92 | |||
93 | public bool Temporary | ||
94 | { | ||
95 | get { return m_metadata.Temporary; } | ||
96 | set { m_metadata.Temporary = value; } | ||
97 | } | ||
98 | |||
99 | // We have methods here because properties are serialized, and we don't | ||
100 | // want that. | ||
101 | public virtual AssetMetadata getMetadata() | ||
102 | { | ||
103 | return m_metadata; | ||
104 | } | ||
105 | |||
106 | public virtual void setMetadata(AssetMetadata metadata) | ||
107 | { | ||
108 | m_metadata = metadata; | ||
70 | } | 109 | } |
71 | } | 110 | } |
72 | 111 | ||
73 | [Serializable] | ||
74 | public class AssetMetadata | 112 | public class AssetMetadata |
75 | { | 113 | { |
76 | private UUID _fullid; | 114 | private UUID m_fullid; |
77 | private string _name = String.Empty; | 115 | private string m_name = String.Empty; |
78 | private string _description = String.Empty; | 116 | private string m_description = String.Empty; |
79 | private DateTime _creation_date; | 117 | private DateTime m_creation_date; |
80 | private sbyte _type; | 118 | private sbyte m_type; |
81 | private string _content_type; | 119 | private string m_content_type; |
82 | private byte[] _sha1; | 120 | private byte[] m_sha1; |
83 | private bool _local = false; | 121 | private bool m_local = false; |
84 | private bool _temporary = false; | 122 | private bool m_temporary = false; |
85 | //private Dictionary<string, Uri> _methods = new Dictionary<string, Uri>(); | 123 | //private Dictionary<string, Uri> m_methods = new Dictionary<string, Uri>(); |
86 | //private OSDMap _extra_data; | 124 | //private OSDMap m_extra_data; |
87 | 125 | ||
88 | public UUID FullID | 126 | public UUID FullID |
89 | { | 127 | { |
90 | get { return _fullid; } | 128 | get { return m_fullid; } |
91 | set { _fullid = value; } | 129 | set { m_fullid = value; } |
92 | } | 130 | } |
93 | 131 | ||
94 | public string ID | 132 | public string ID |
95 | { | 133 | { |
96 | get { return _fullid.ToString(); } | 134 | get { return m_fullid.ToString(); } |
97 | set { _fullid = new UUID(value); } | 135 | set { m_fullid = new UUID(value); } |
98 | } | 136 | } |
99 | 137 | ||
100 | public string Name | 138 | public string Name |
101 | { | 139 | { |
102 | get { return _name; } | 140 | get { return m_name; } |
103 | set { _name = value; } | 141 | set { m_name = value; } |
104 | } | 142 | } |
105 | 143 | ||
106 | public string Description | 144 | public string Description |
107 | { | 145 | { |
108 | get { return _description; } | 146 | get { return m_description; } |
109 | set { _description = value; } | 147 | set { m_description = value; } |
110 | } | 148 | } |
111 | 149 | ||
112 | public DateTime CreationDate | 150 | public DateTime CreationDate |
113 | { | 151 | { |
114 | get { return _creation_date; } | 152 | get { return m_creation_date; } |
115 | set { _creation_date = value; } | 153 | set { m_creation_date = value; } |
116 | } | 154 | } |
117 | 155 | ||
118 | public sbyte Type | 156 | public sbyte Type |
119 | { | 157 | { |
120 | get { return _type; } | 158 | get { return m_type; } |
121 | set { _type = value; } | 159 | set { m_type = value; } |
122 | } | 160 | } |
123 | 161 | ||
124 | public string ContentType | 162 | public string ContentType |
125 | { | 163 | { |
126 | get { return _content_type; } | 164 | get { return m_content_type; } |
127 | set { _content_type = value; } | 165 | set { m_content_type = value; } |
128 | } | 166 | } |
129 | 167 | ||
130 | public byte[] SHA1 | 168 | public byte[] SHA1 |
131 | { | 169 | { |
132 | get { return _sha1; } | 170 | get { return m_sha1; } |
133 | set { _sha1 = value; } | 171 | set { m_sha1 = value; } |
134 | } | 172 | } |
135 | 173 | ||
136 | public bool Local | 174 | public bool Local |
137 | { | 175 | { |
138 | get { return _local; } | 176 | get { return m_local; } |
139 | set { _local = value; } | 177 | set { m_local = value; } |
140 | } | 178 | } |
141 | 179 | ||
142 | public bool Temporary | 180 | public bool Temporary |
143 | { | 181 | { |
144 | get { return _temporary; } | 182 | get { return m_temporary; } |
145 | set { _temporary = value; } | 183 | set { m_temporary = value; } |
146 | } | 184 | } |
147 | 185 | ||
148 | //public Dictionary<string, Uri> Methods | 186 | //public Dictionary<string, Uri> Methods |
149 | //{ | 187 | //{ |
150 | // get { return _methods; } | 188 | // get { return m_methods; } |
151 | // set { _methods = value; } | 189 | // set { m_methods = value; } |
152 | //} | 190 | //} |
153 | 191 | ||
154 | //public OSDMap ExtraData | 192 | //public OSDMap ExtraData |
155 | //{ | 193 | //{ |
156 | // get { return _extra_data; } | 194 | // get { return m_extra_data; } |
157 | // set { _extra_data = value; } | 195 | // set { m_extra_data = value; } |
158 | //} | 196 | //} |
159 | } | 197 | } |
160 | } | 198 | } |
diff --git a/OpenSim/Framework/AssetLandmark.cs b/OpenSim/Framework/AssetLandmark.cs index bbf25d8..d636d34 100644 --- a/OpenSim/Framework/AssetLandmark.cs +++ b/OpenSim/Framework/AssetLandmark.cs | |||
@@ -40,10 +40,10 @@ namespace OpenSim.Framework | |||
40 | public AssetLandmark(AssetBase a) | 40 | public AssetLandmark(AssetBase a) |
41 | { | 41 | { |
42 | Data = a.Data; | 42 | Data = a.Data; |
43 | Metadata.FullID = a.Metadata.FullID; | 43 | FullID = a.FullID; |
44 | Metadata.Type = a.Metadata.Type; | 44 | Type = a.Type; |
45 | Metadata.Name = a.Metadata.Name; | 45 | Name = a.Name; |
46 | Metadata.Description = a.Metadata.Description; | 46 | Description = a.Description; |
47 | InternData(); | 47 | InternData(); |
48 | } | 48 | } |
49 | 49 | ||
diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index 01cbfce..378eff5 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | |||
@@ -145,7 +145,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem | |||
145 | 145 | ||
146 | AssetBase newAsset = CreateAsset(assetIdStr, name, assetPath, false); | 146 | AssetBase newAsset = CreateAsset(assetIdStr, name, assetPath, false); |
147 | 147 | ||
148 | newAsset.Metadata.Type = type; | 148 | newAsset.Type = type; |
149 | assets.Add(newAsset); | 149 | assets.Add(newAsset); |
150 | } | 150 | } |
151 | } | 151 | } |
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 76c6045..0e1f948 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -341,11 +341,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
341 | /// <param name="asset"></param> | 341 | /// <param name="asset"></param> |
342 | public void AddAsset(AssetBase asset) | 342 | public void AddAsset(AssetBase asset) |
343 | { | 343 | { |
344 | if (!m_memcache.Contains(asset.Metadata.FullID)) | 344 | if (!m_memcache.Contains(asset.FullID)) |
345 | { | 345 | { |
346 | m_log.Info("[CACHE] Caching " + asset.Metadata.FullID + " for 24 hours from last access"); | 346 | m_log.Info("[CACHE] Caching " + asset.FullID + " for 24 hours from last access"); |
347 | // Use 24 hour rolling asset cache. | 347 | // Use 24 hour rolling asset cache. |
348 | m_memcache.AddOrUpdate(asset.Metadata.FullID, asset, TimeSpan.FromHours(24)); | 348 | m_memcache.AddOrUpdate(asset.FullID, asset, TimeSpan.FromHours(24)); |
349 | 349 | ||
350 | // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the | 350 | // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the |
351 | // information is stored locally. It could disappear, in which case we could send the | 351 | // information is stored locally. It could disappear, in which case we could send the |
@@ -365,7 +365,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
365 | // But for now, we're going to take the easy way out and store local assets globally. | 365 | // But for now, we're going to take the easy way out and store local assets globally. |
366 | // | 366 | // |
367 | // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView. | 367 | // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView. |
368 | if (!asset.Metadata.Temporary || asset.Metadata.Local) | 368 | if (!asset.Temporary || asset.Local) |
369 | { | 369 | { |
370 | m_assetServer.StoreAsset(asset); | 370 | m_assetServer.StoreAsset(asset); |
371 | } | 371 | } |
@@ -396,25 +396,25 @@ namespace OpenSim.Framework.Communications.Cache | |||
396 | { | 396 | { |
397 | 397 | ||
398 | AssetInfo assetInf = new AssetInfo(asset); | 398 | AssetInfo assetInf = new AssetInfo(asset); |
399 | if (!m_memcache.Contains(assetInf.Metadata.FullID)) | 399 | if (!m_memcache.Contains(assetInf.FullID)) |
400 | { | 400 | { |
401 | m_memcache.AddOrUpdate(assetInf.Metadata.FullID, assetInf, TimeSpan.FromHours(24)); | 401 | m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24)); |
402 | 402 | ||
403 | if (StatsManager.SimExtraStats != null) | 403 | if (StatsManager.SimExtraStats != null) |
404 | { | 404 | { |
405 | StatsManager.SimExtraStats.AddAsset(assetInf); | 405 | StatsManager.SimExtraStats.AddAsset(assetInf); |
406 | } | 406 | } |
407 | 407 | ||
408 | if (RequestedAssets.ContainsKey(assetInf.Metadata.FullID)) | 408 | if (RequestedAssets.ContainsKey(assetInf.FullID)) |
409 | { | 409 | { |
410 | AssetRequest req = RequestedAssets[assetInf.Metadata.FullID]; | 410 | AssetRequest req = RequestedAssets[assetInf.FullID]; |
411 | req.AssetInf = assetInf; | 411 | req.AssetInf = assetInf; |
412 | req.NumPackets = CalculateNumPackets(assetInf.Data); | 412 | req.NumPackets = CalculateNumPackets(assetInf.Data); |
413 | 413 | ||
414 | RequestedAssets.Remove(assetInf.Metadata.FullID); | 414 | RequestedAssets.Remove(assetInf.FullID); |
415 | // If it's a direct request for a script, drop it | 415 | // If it's a direct request for a script, drop it |
416 | // because it's a hacked client | 416 | // because it's a hacked client |
417 | if (req.AssetRequestSource != 2 || assetInf.Metadata.Type != 10) | 417 | if (req.AssetRequestSource != 2 || assetInf.Type != 10) |
418 | AssetRequests.Add(req); | 418 | AssetRequests.Add(req); |
419 | } | 419 | } |
420 | } | 420 | } |
@@ -424,8 +424,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
424 | 424 | ||
425 | lock (RequestLists) | 425 | lock (RequestLists) |
426 | { | 426 | { |
427 | if (RequestLists.TryGetValue(asset.Metadata.FullID, out reqList)) | 427 | if (RequestLists.TryGetValue(asset.FullID, out reqList)) |
428 | RequestLists.Remove(asset.Metadata.FullID); | 428 | RequestLists.Remove(asset.FullID); |
429 | } | 429 | } |
430 | 430 | ||
431 | if (reqList != null) | 431 | if (reqList != null) |
@@ -436,8 +436,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
436 | foreach (NewAssetRequest req in reqList.Requests) | 436 | foreach (NewAssetRequest req in reqList.Requests) |
437 | { | 437 | { |
438 | // Xantor 20080526 are we really calling all the callbacks if multiple queued for 1 request? -- Yes, checked | 438 | // Xantor 20080526 are we really calling all the callbacks if multiple queued for 1 request? -- Yes, checked |
439 | // m_log.DebugFormat("[ASSET CACHE]: Callback for asset {0}", asset.Metadata.FullID); | 439 | // m_log.DebugFormat("[ASSET CACHE]: Callback for asset {0}", asset.FullID); |
440 | req.Callback(asset.Metadata.FullID, asset); | 440 | req.Callback(asset.FullID, asset); |
441 | } | 441 | } |
442 | } | 442 | } |
443 | } | 443 | } |
@@ -545,7 +545,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
545 | } | 545 | } |
546 | 546 | ||
547 | // Scripts cannot be retrieved by direct request | 547 | // Scripts cannot be retrieved by direct request |
548 | if (transferRequest.TransferInfo.SourceType == 2 && asset.Metadata.Type == 10) | 548 | if (transferRequest.TransferInfo.SourceType == 2 && asset.Type == 10) |
549 | return; | 549 | return; |
550 | 550 | ||
551 | // The asset is knosn to exist and is in our cache, so add it to the AssetRequests list | 551 | // The asset is knosn to exist and is in our cache, so add it to the AssetRequests list |
@@ -631,10 +631,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
631 | public AssetInfo(AssetBase aBase) | 631 | public AssetInfo(AssetBase aBase) |
632 | { | 632 | { |
633 | Data = aBase.Data; | 633 | Data = aBase.Data; |
634 | Metadata.FullID = aBase.Metadata.FullID; | 634 | FullID = aBase.FullID; |
635 | Metadata.Type = aBase.Metadata.Type; | 635 | Type = aBase.Type; |
636 | Metadata.Name = aBase.Metadata.Name; | 636 | Name = aBase.Name; |
637 | Metadata.Description = aBase.Metadata.Description; | 637 | Description = aBase.Description; |
638 | } | 638 | } |
639 | } | 639 | } |
640 | 640 | ||
@@ -643,10 +643,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
643 | public TextureImage(AssetBase aBase) | 643 | public TextureImage(AssetBase aBase) |
644 | { | 644 | { |
645 | Data = aBase.Data; | 645 | Data = aBase.Data; |
646 | Metadata.FullID = aBase.Metadata.FullID; | 646 | FullID = aBase.FullID; |
647 | Metadata.Type = aBase.Metadata.Type; | 647 | Type = aBase.Type; |
648 | Metadata.Name = aBase.Metadata.Name; | 648 | Name = aBase.Name; |
649 | Metadata.Description = aBase.Metadata.Description; | 649 | Description = aBase.Description; |
650 | } | 650 | } |
651 | } | 651 | } |
652 | 652 | ||
diff --git a/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs b/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs index 0f4e8ac..f1c19fa 100644 --- a/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs | |||
@@ -441,17 +441,17 @@ namespace OpenSim.Framework.Communications.Cache | |||
441 | string salt = Convert.ToBase64String(rand); | 441 | string salt = Convert.ToBase64String(rand); |
442 | 442 | ||
443 | x.Data = UtilRijndael.Encrypt(x.Data, file.Secret, salt, "SHA1", 2, file.IVBytes, file.Keysize); | 443 | x.Data = UtilRijndael.Encrypt(x.Data, file.Secret, salt, "SHA1", 2, file.IVBytes, file.Keysize); |
444 | x.Metadata.Description = String.Format("ENCASS#:~:#{0}#:~:#{1}#:~:#{2}#:~:#{3}", | 444 | x.Description = String.Format("ENCASS#:~:#{0}#:~:#{1}#:~:#{2}#:~:#{3}", |
445 | "OPENSIM_AES_AF1", | 445 | "OPENSIM_AES_AF1", |
446 | file.AlsoKnownAs, | 446 | file.AlsoKnownAs, |
447 | salt, | 447 | salt, |
448 | x.Metadata.Description); | 448 | x.Description); |
449 | } | 449 | } |
450 | 450 | ||
451 | private bool DecryptAssetBase(AssetBase x) | 451 | private bool DecryptAssetBase(AssetBase x) |
452 | { | 452 | { |
453 | // Check it's encrypted first. | 453 | // Check it's encrypted first. |
454 | if (!x.Metadata.Description.Contains("ENCASS")) | 454 | if (!x.Description.Contains("ENCASS")) |
455 | return true; | 455 | return true; |
456 | 456 | ||
457 | // ENCASS:ALG:AKA:SALT:Description | 457 | // ENCASS:ALG:AKA:SALT:Description |
@@ -459,7 +459,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
459 | string[] splitchars = new string[1]; | 459 | string[] splitchars = new string[1]; |
460 | splitchars[0] = "#:~:#"; | 460 | splitchars[0] = "#:~:#"; |
461 | 461 | ||
462 | string[] meta = x.Metadata.Description.Split(splitchars, StringSplitOptions.None); | 462 | string[] meta = x.Description.Split(splitchars, StringSplitOptions.None); |
463 | if (meta.Length < 5) | 463 | if (meta.Length < 5) |
464 | { | 464 | { |
465 | m_log.Warn("[ENCASSETS] Recieved Encrypted Asset, but header is corrupt"); | 465 | m_log.Warn("[ENCASSETS] Recieved Encrypted Asset, but header is corrupt"); |
@@ -470,7 +470,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
470 | if (m_keyfiles.ContainsKey(meta[2])) | 470 | if (m_keyfiles.ContainsKey(meta[2])) |
471 | { | 471 | { |
472 | RjinKeyfile deckey = m_keyfiles[meta[2]]; | 472 | RjinKeyfile deckey = m_keyfiles[meta[2]]; |
473 | x.Metadata.Description = meta[4]; | 473 | x.Description = meta[4]; |
474 | switch (meta[1]) | 474 | switch (meta[1]) |
475 | { | 475 | { |
476 | case "OPENSIM_AES_AF1": | 476 | case "OPENSIM_AES_AF1": |
@@ -544,7 +544,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
544 | { | 544 | { |
545 | string assetUrl = _assetServerUrl + "/assets/"; | 545 | string assetUrl = _assetServerUrl + "/assets/"; |
546 | 546 | ||
547 | m_log.InfoFormat("[CRYPTO GRID ASSET CLIENT]: Sending store request for asset {0}", asset.Metadata.FullID); | 547 | m_log.InfoFormat("[CRYPTO GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID); |
548 | 548 | ||
549 | RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset); | 549 | RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset); |
550 | } | 550 | } |
diff --git a/OpenSim/Framework/Communications/Cache/FileAssetClient.cs b/OpenSim/Framework/Communications/Cache/FileAssetClient.cs index e6574a1..8d03f56 100644 --- a/OpenSim/Framework/Communications/Cache/FileAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/FileAssetClient.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
79 | 79 | ||
80 | public override void StoreAsset(AssetBase asset) | 80 | public override void StoreAsset(AssetBase asset) |
81 | { | 81 | { |
82 | byte[] idBytes = asset.Metadata.FullID.Guid.ToByteArray(); | 82 | byte[] idBytes = asset.FullID.Guid.ToByteArray(); |
83 | 83 | ||
84 | string cdir = m_dir + Path.DirectorySeparatorChar + idBytes[0] | 84 | string cdir = m_dir + Path.DirectorySeparatorChar + idBytes[0] |
85 | + Path.DirectorySeparatorChar + idBytes[1]; | 85 | + Path.DirectorySeparatorChar + idBytes[1]; |
@@ -90,7 +90,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
90 | if (!Directory.Exists(cdir)) | 90 | if (!Directory.Exists(cdir)) |
91 | Directory.CreateDirectory(cdir); | 91 | Directory.CreateDirectory(cdir); |
92 | 92 | ||
93 | FileStream x = new FileStream(cdir + Path.DirectorySeparatorChar + asset.Metadata.FullID + ".xml", FileMode.Create); | 93 | FileStream x = new FileStream(cdir + Path.DirectorySeparatorChar + asset.FullID + ".xml", FileMode.Create); |
94 | m_xs.Serialize(x, asset); | 94 | m_xs.Serialize(x, asset); |
95 | 95 | ||
96 | x.Flush(); | 96 | x.Flush(); |
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index 6522ad0..3b6dc52 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
126 | // rc.Request(s); | 126 | // rc.Request(s); |
127 | //m_log.InfoFormat("[ASSET]: Stored {0}", rc); | 127 | //m_log.InfoFormat("[ASSET]: Stored {0}", rc); |
128 | 128 | ||
129 | m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.Metadata.FullID); | 129 | m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID); |
130 | 130 | ||
131 | RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset); | 131 | RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset); |
132 | } | 132 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index b68083e..a4c847d 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -740,9 +740,9 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
740 | 740 | ||
741 | AssetBase asset; | 741 | AssetBase asset; |
742 | asset = new AssetBase(); | 742 | asset = new AssetBase(); |
743 | asset.Metadata.FullID = assetID; | 743 | asset.FullID = assetID; |
744 | asset.Metadata.Type = assType; | 744 | asset.Type = assType; |
745 | asset.Metadata.Name = assetName; | 745 | asset.Name = assetName; |
746 | asset.Data = data; | 746 | asset.Data = data; |
747 | m_assetCache.AddAsset(asset); | 747 | m_assetCache.AddAsset(asset); |
748 | 748 | ||
@@ -750,7 +750,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
750 | item.Owner = m_agentID; | 750 | item.Owner = m_agentID; |
751 | item.Creator = m_agentID; | 751 | item.Creator = m_agentID; |
752 | item.ID = inventoryItem; | 752 | item.ID = inventoryItem; |
753 | item.AssetID = asset.Metadata.FullID; | 753 | item.AssetID = asset.FullID; |
754 | item.Description = assetDescription; | 754 | item.Description = assetDescription; |
755 | item.Name = assetName; | 755 | item.Name = assetName; |
756 | item.AssetType = assType; | 756 | item.AssetType = assType; |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs index 8fa8474..dcacab2 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim | |||
61 | if (asset == null) ret = BackendResponse.NotFound; | 61 | if (asset == null) ret = BackendResponse.NotFound; |
62 | else | 62 | else |
63 | { | 63 | { |
64 | metadata = asset.Metadata; | 64 | metadata = asset.getMetadata(); |
65 | ret = BackendResponse.Success; | 65 | ret = BackendResponse.Success; |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs index e7e898b..890a6a0 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs | |||
@@ -97,7 +97,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
97 | public BackendResponse TryFetchDataMetadata(UUID assetID, out AssetBase asset) | 97 | public BackendResponse TryFetchDataMetadata(UUID assetID, out AssetBase asset) |
98 | { | 98 | { |
99 | asset = new AssetBase(); | 99 | asset = new AssetBase(); |
100 | AssetMetadata metadata = asset.Metadata; | 100 | AssetMetadata metadata = asset.getMetadata(); |
101 | 101 | ||
102 | string filename; | 102 | string filename; |
103 | BackendResponse ret; | 103 | BackendResponse ret; |
@@ -116,8 +116,8 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
116 | ret = BackendResponse.Failure; | 116 | ret = BackendResponse.Failure; |
117 | } | 117 | } |
118 | 118 | ||
119 | asset.Metadata.Type = (sbyte) Utils.ContentTypeToSLAssetType(asset.Metadata.ContentType); | 119 | asset.Type = (sbyte) Utils.ContentTypeToSLAssetType(metadata.ContentType); |
120 | asset.Metadata.Local = false; | 120 | asset.Local = false; |
121 | } | 121 | } |
122 | else | 122 | else |
123 | { | 123 | { |
@@ -139,11 +139,12 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
139 | public BackendResponse TryCreateAsset(AssetBase asset) | 139 | public BackendResponse TryCreateAsset(AssetBase asset) |
140 | { | 140 | { |
141 | BackendResponse ret; | 141 | BackendResponse ret; |
142 | AssetMetadata metadata = asset.getMetadata(); | ||
142 | 143 | ||
143 | string path; | 144 | string path; |
144 | string filename = String.Format("{0}.{1}", asset.FullID, Utils.ContentTypeToExtension(asset.Metadata.ContentType)); | 145 | string filename = String.Format("{0}.{1}", asset.FullID, Utils.ContentTypeToExtension(metadata.ContentType)); |
145 | 146 | ||
146 | if (asset.Metadata.Temporary) | 147 | if (asset.Temporary) |
147 | path = Path.Combine(TEMP_DATA_DIR, filename); | 148 | path = Path.Combine(TEMP_DATA_DIR, filename); |
148 | else | 149 | else |
149 | path = Path.Combine(DEFAULT_DATA_DIR, filename); | 150 | path = Path.Combine(DEFAULT_DATA_DIR, filename); |
@@ -154,10 +155,10 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
154 | lock (filenames) filenames[asset.FullID] = path; | 155 | lock (filenames) filenames[asset.FullID] = path; |
155 | 156 | ||
156 | // Set the creation date to right now | 157 | // Set the creation date to right now |
157 | asset.Metadata.CreationDate = DateTime.Now; | 158 | metadata.CreationDate = DateTime.Now; |
158 | 159 | ||
159 | lock (metadataStorage) | 160 | lock (metadataStorage) |
160 | metadataStorage[asset.FullID] = asset.Metadata; | 161 | metadataStorage[asset.FullID] = metadata; |
161 | 162 | ||
162 | ret = BackendResponse.Success; | 163 | ret = BackendResponse.Success; |
163 | } | 164 | } |
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs index ba62c55..1e01c44 100644 --- a/OpenSim/Grid/AssetServer/RestService.cs +++ b/OpenSim/Grid/AssetServer/RestService.cs | |||
@@ -140,7 +140,7 @@ namespace OpenSim.Grid.AssetServer | |||
140 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); | 140 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); |
141 | AssetBase asset = (AssetBase) xs.Deserialize(request); | 141 | AssetBase asset = (AssetBase) xs.Deserialize(request); |
142 | 142 | ||
143 | m_log.InfoFormat("[REST]: Creating asset {0}", asset.Metadata.FullID); | 143 | m_log.InfoFormat("[REST]: Creating asset {0}", asset.FullID); |
144 | m_assetProvider.CreateAsset(asset); | 144 | m_assetProvider.CreateAsset(asset); |
145 | 145 | ||
146 | return new byte[] {}; | 146 | return new byte[] {}; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3b8b48f..dd0f6ac 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -7679,7 +7679,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7679 | { | 7679 | { |
7680 | Transfer.TransferInfo.Params = new byte[20]; | 7680 | Transfer.TransferInfo.Params = new byte[20]; |
7681 | Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); | 7681 | Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); |
7682 | int assType = req.AssetInf.Metadata.Type; | 7682 | int assType = req.AssetInf.Type; |
7683 | Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); | 7683 | Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); |
7684 | } | 7684 | } |
7685 | else if (req.AssetRequestSource == 3) | 7685 | else if (req.AssetRequestSource == 3) |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs index f79f62e..697bbe6 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs | |||
@@ -198,13 +198,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
198 | private void Initialise(UUID fileID, string fileName) | 198 | private void Initialise(UUID fileID, string fileName) |
199 | { | 199 | { |
200 | m_asset = new AssetBase(); | 200 | m_asset = new AssetBase(); |
201 | m_asset.Metadata.FullID = fileID; | 201 | m_asset.FullID = fileID; |
202 | m_asset.Metadata.Type = type; | 202 | m_asset.Type = type; |
203 | m_asset.Data = new byte[0]; | 203 | m_asset.Data = new byte[0]; |
204 | m_asset.Metadata.Name = fileName; | 204 | m_asset.Name = fileName; |
205 | m_asset.Metadata.Description = "empty"; | 205 | m_asset.Description = "empty"; |
206 | m_asset.Metadata.Local = true; | 206 | m_asset.Local = true; |
207 | m_asset.Metadata.Temporary = true; | 207 | m_asset.Temporary = true; |
208 | mXferID = Util.GetNextXferID(); | 208 | mXferID = Util.GetNextXferID(); |
209 | } | 209 | } |
210 | 210 | ||
@@ -215,13 +215,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
215 | 215 | ||
216 | public void RequestStartXfer(IClientAPI pRemoteClient) | 216 | public void RequestStartXfer(IClientAPI pRemoteClient) |
217 | { | 217 | { |
218 | if (!String.IsNullOrEmpty(m_asset.Metadata.Name)) | 218 | if (!String.IsNullOrEmpty(m_asset.Name)) |
219 | { | 219 | { |
220 | pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, Utils.StringToBytes(m_asset.Metadata.Name)); | 220 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); |
221 | } | 221 | } |
222 | else | 222 | else |
223 | { | 223 | { |
224 | pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]); | 224 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
@@ -265,7 +265,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
265 | handlerUploadDone = UploadDone; | 265 | handlerUploadDone = UploadDone; |
266 | if (handlerUploadDone != null) | 266 | if (handlerUploadDone != null) |
267 | { | 267 | { |
268 | handlerUploadDone(m_asset.Metadata.Name, m_asset.Metadata.FullID, mXferID, m_asset.Data, remoteClient); | 268 | handlerUploadDone(m_asset.Name, m_asset.FullID, mXferID, m_asset.Data, remoteClient); |
269 | } | 269 | } |
270 | } | 270 | } |
271 | 271 | ||
@@ -274,7 +274,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
274 | handlerAbort = UploadAborted; | 274 | handlerAbort = UploadAborted; |
275 | if (handlerAbort != null) | 275 | if (handlerAbort != null) |
276 | { | 276 | { |
277 | handlerAbort(m_asset.Metadata.Name, m_asset.Metadata.FullID, mXferID, remoteClient); | 277 | handlerAbort(m_asset.Name, m_asset.FullID, mXferID, remoteClient); |
278 | } | 278 | } |
279 | } | 279 | } |
280 | } | 280 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 6efe3e1..23ed798 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs | |||
@@ -405,7 +405,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
405 | /// </summary> | 405 | /// </summary> |
406 | public UUID AssetId | 406 | public UUID AssetId |
407 | { | 407 | { |
408 | get { return m_asset_ref.Metadata.FullID; } | 408 | get { return m_asset_ref.FullID; } |
409 | } | 409 | } |
410 | 410 | ||
411 | /// <summary> | 411 | /// <summary> |
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs index 72c0f42..a61c07a 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs | |||
@@ -318,9 +318,9 @@ namespace OpenSim.Region.Communications.Hypergrid | |||
318 | //Console.WriteLine("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); | 318 | //Console.WriteLine("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); |
319 | byte[] imageData = OpenJPEG.EncodeFromImage(m, true); | 319 | byte[] imageData = OpenJPEG.EncodeFromImage(m, true); |
320 | AssetBase ass = new AssetBase(UUID.Random(), "region " + info.RegionID.ToString()); | 320 | AssetBase ass = new AssetBase(UUID.Random(), "region " + info.RegionID.ToString()); |
321 | info.RegionSettings.TerrainImageID = ass.Metadata.FullID; | 321 | info.RegionSettings.TerrainImageID = ass.FullID; |
322 | ass.Metadata.Type = (int)AssetType.Texture; | 322 | ass.Type = (int)AssetType.Texture; |
323 | ass.Metadata.Temporary = false; | 323 | ass.Temporary = false; |
324 | ass.Data = imageData; | 324 | ass.Data = imageData; |
325 | m_assetcache.AddAsset(ass); | 325 | m_assetcache.AddAsset(ass); |
326 | 326 | ||
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 0bf91e0..eefcfe8 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -172,10 +172,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
172 | "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", | 172 | "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", |
173 | item.Name, part.Name, transactionID); | 173 | item.Name, part.Name, transactionID); |
174 | 174 | ||
175 | asset.Metadata.Name = item.Name; | 175 | asset.Name = item.Name; |
176 | asset.Metadata.Description = item.Description; | 176 | asset.Description = item.Description; |
177 | asset.Metadata.Type = (sbyte)item.Type; | 177 | asset.Type = (sbyte)item.Type; |
178 | item.AssetID = asset.Metadata.FullID; | 178 | item.AssetID = asset.FullID; |
179 | 179 | ||
180 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); | 180 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); |
181 | 181 | ||
@@ -207,14 +207,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
207 | asset = GetTransactionAsset(transactionID); | 207 | asset = GetTransactionAsset(transactionID); |
208 | } | 208 | } |
209 | 209 | ||
210 | if (asset != null && asset.Metadata.FullID == assetID) | 210 | if (asset != null && asset.FullID == assetID) |
211 | { | 211 | { |
212 | // Assets never get updated, new ones get created | 212 | // Assets never get updated, new ones get created |
213 | asset.Metadata.FullID = UUID.Random(); | 213 | asset.FullID = UUID.Random(); |
214 | asset.Metadata.Name = item.Name; | 214 | asset.Name = item.Name; |
215 | asset.Metadata.Description = item.Description; | 215 | asset.Description = item.Description; |
216 | asset.Metadata.Type = (sbyte)item.AssetType; | 216 | asset.Type = (sbyte)item.AssetType; |
217 | item.AssetID = asset.Metadata.FullID; | 217 | item.AssetID = asset.FullID; |
218 | 218 | ||
219 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); | 219 | Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); |
220 | } | 220 | } |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 9af764f..b71c2a6 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -111,13 +111,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
111 | { | 111 | { |
112 | ourClient = remoteClient; | 112 | ourClient = remoteClient; |
113 | m_asset = new AssetBase(); | 113 | m_asset = new AssetBase(); |
114 | m_asset.Metadata.FullID = assetID; | 114 | m_asset.FullID = assetID; |
115 | m_asset.Metadata.Type = type; | 115 | m_asset.Type = type; |
116 | m_asset.Data = data; | 116 | m_asset.Data = data; |
117 | m_asset.Metadata.Name = "blank"; | 117 | m_asset.Name = "blank"; |
118 | m_asset.Metadata.Description = "empty"; | 118 | m_asset.Description = "empty"; |
119 | m_asset.Metadata.Local = storeLocal; | 119 | m_asset.Local = storeLocal; |
120 | m_asset.Metadata.Temporary = tempFile; | 120 | m_asset.Temporary = tempFile; |
121 | 121 | ||
122 | TransactionID = transaction; | 122 | TransactionID = transaction; |
123 | m_storeLocal = storeLocal; | 123 | m_storeLocal = storeLocal; |
@@ -138,12 +138,12 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
138 | protected void RequestStartXfer() | 138 | protected void RequestStartXfer() |
139 | { | 139 | { |
140 | XferID = Util.GetNextXferID(); | 140 | XferID = Util.GetNextXferID(); |
141 | ourClient.SendXferRequest(XferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]); | 141 | ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); |
142 | } | 142 | } |
143 | 143 | ||
144 | protected void SendCompleteMessage() | 144 | protected void SendCompleteMessage() |
145 | { | 145 | { |
146 | ourClient.SendAssetUploadCompleteMessage(m_asset.Metadata.Type, true, m_asset.Metadata.FullID); | 146 | ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); |
147 | 147 | ||
148 | m_finished = true; | 148 | m_finished = true; |
149 | if (m_createItem) | 149 | if (m_createItem) |
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
162 | DateTime now = DateTime.Now; | 162 | DateTime now = DateTime.Now; |
163 | string filename = | 163 | string filename = |
164 | String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, | 164 | String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, |
165 | now.Hour, now.Minute, now.Second, m_asset.Metadata.Name, m_asset.Metadata.Type); | 165 | now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type); |
166 | SaveAssetToFile(filename, m_asset.Data); | 166 | SaveAssetToFile(filename, m_asset.Data); |
167 | } | 167 | } |
168 | } | 168 | } |
@@ -194,9 +194,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
194 | this.invType = invType; | 194 | this.invType = invType; |
195 | this.wearableType = wearableType; | 195 | this.wearableType = wearableType; |
196 | nextPerm = nextOwnerMask; | 196 | nextPerm = nextOwnerMask; |
197 | m_asset.Metadata.Name = name; | 197 | m_asset.Name = name; |
198 | m_asset.Metadata.Description = description; | 198 | m_asset.Description = description; |
199 | m_asset.Metadata.Type = type; | 199 | m_asset.Type = type; |
200 | 200 | ||
201 | if (m_finished) | 201 | if (m_finished) |
202 | { | 202 | { |
@@ -223,7 +223,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
223 | item.Owner = ourClient.AgentId; | 223 | item.Owner = ourClient.AgentId; |
224 | item.Creator = ourClient.AgentId; | 224 | item.Creator = ourClient.AgentId; |
225 | item.ID = UUID.Random(); | 225 | item.ID = UUID.Random(); |
226 | item.AssetID = m_asset.Metadata.FullID; | 226 | item.AssetID = m_asset.FullID; |
227 | item.Description = m_description; | 227 | item.Description = m_description; |
228 | item.Name = m_name; | 228 | item.Name = m_name; |
229 | item.AssetType = type; | 229 | item.AssetType = type; |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs index dde8566..e02ea6d 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/TextureSender.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
54 | /// </summary> | 54 | /// </summary> |
55 | private AssetBase m_asset; | 55 | private AssetBase m_asset; |
56 | 56 | ||
57 | //public UUID assetID { get { return m_asset.Metadata.FullID; } } | 57 | //public UUID assetID { get { return m_asset.FullID; } } |
58 | 58 | ||
59 | // private bool m_cancel = false; | 59 | // private bool m_cancel = false; |
60 | 60 | ||
@@ -116,7 +116,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
116 | // See ITextureSender | 116 | // See ITextureSender |
117 | public bool SendTexturePacket() | 117 | public bool SendTexturePacket() |
118 | { | 118 | { |
119 | //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.Metadata.FullID); | 119 | //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID); |
120 | 120 | ||
121 | SendPacket(); | 121 | SendPacket(); |
122 | counter++; | 122 | counter++; |
@@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
153 | { | 153 | { |
154 | if (NumPackets == 0) | 154 | if (NumPackets == 0) |
155 | { | 155 | { |
156 | RequestUser.SendImageFirstPart(1, m_asset.Metadata.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); | 156 | RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); |
157 | PacketCounter++; | 157 | PacketCounter++; |
158 | } | 158 | } |
159 | else | 159 | else |
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
162 | Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); | 162 | Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); |
163 | 163 | ||
164 | RequestUser.SendImageFirstPart( | 164 | RequestUser.SendImageFirstPart( |
165 | (ushort)(NumPackets), m_asset.Metadata.FullID, (uint)m_asset.Data.Length, ImageData1, 2); | 165 | (ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2); |
166 | PacketCounter++; | 166 | PacketCounter++; |
167 | } | 167 | } |
168 | } | 168 | } |
@@ -178,11 +178,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
178 | catch (ArgumentOutOfRangeException) | 178 | catch (ArgumentOutOfRangeException) |
179 | { | 179 | { |
180 | m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + | 180 | m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + |
181 | m_asset.Metadata.ID); | 181 | m_asset.ID); |
182 | return; | 182 | return; |
183 | } | 183 | } |
184 | 184 | ||
185 | RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.Metadata.FullID, imageData); | 185 | RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData); |
186 | PacketCounter++; | 186 | PacketCounter++; |
187 | } | 187 | } |
188 | } | 188 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 7189e36..6b57ac5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
281 | 281 | ||
282 | AssetBase asset = new AssetBase(new UUID(uuid), "RandomName"); | 282 | AssetBase asset = new AssetBase(new UUID(uuid), "RandomName"); |
283 | 283 | ||
284 | asset.Metadata.Type = assetType; | 284 | asset.Type = assetType; |
285 | asset.Data = data; | 285 | asset.Data = data; |
286 | 286 | ||
287 | commsManager.AssetCache.AddAsset(asset); | 287 | commsManager.AssetCache.AddAsset(asset); |
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index d6f0713..a8f841b 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -231,21 +231,21 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
231 | 231 | ||
232 | // Create a new asset for user | 232 | // Create a new asset for user |
233 | AssetBase asset = new AssetBase(); | 233 | AssetBase asset = new AssetBase(); |
234 | asset.Metadata.FullID = UUID.Random(); | 234 | asset.FullID = UUID.Random(); |
235 | asset.Data = assetData; | 235 | asset.Data = assetData; |
236 | asset.Metadata.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); | 236 | asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); |
237 | asset.Metadata.Type = 0; | 237 | asset.Type = 0; |
238 | asset.Metadata.Description = "dynamic image"; | 238 | asset.Description = "dynamic image"; |
239 | asset.Metadata.Local = false; | 239 | asset.Local = false; |
240 | asset.Metadata.Temporary = true; | 240 | asset.Temporary = true; |
241 | scene.CommsManager.AssetCache.AddAsset(asset); | 241 | scene.CommsManager.AssetCache.AddAsset(asset); |
242 | 242 | ||
243 | LastAssetID = asset.Metadata.FullID; | 243 | LastAssetID = asset.FullID; |
244 | 244 | ||
245 | IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>(); | 245 | IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>(); |
246 | if (cacheLayerDecode != null) | 246 | if (cacheLayerDecode != null) |
247 | { | 247 | { |
248 | cacheLayerDecode.syncdecode(asset.Metadata.FullID, asset.Data); | 248 | cacheLayerDecode.syncdecode(asset.FullID, asset.Data); |
249 | } | 249 | } |
250 | cacheLayerDecode = null; | 250 | cacheLayerDecode = null; |
251 | 251 | ||
@@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
256 | UUID oldID = tmptex.DefaultTexture.TextureID; | 256 | UUID oldID = tmptex.DefaultTexture.TextureID; |
257 | scene.CommsManager.AssetCache.ExpireAsset(oldID); | 257 | scene.CommsManager.AssetCache.ExpireAsset(oldID); |
258 | 258 | ||
259 | tmptex.DefaultTexture.TextureID = asset.Metadata.FullID; | 259 | tmptex.DefaultTexture.TextureID = asset.FullID; |
260 | // I'm pretty sure we always want to force this to true | 260 | // I'm pretty sure we always want to force this to true |
261 | tmptex.DefaultTexture.Fullbright = true; | 261 | tmptex.DefaultTexture.Fullbright = true; |
262 | 262 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 43eccf3..f788433 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -326,8 +326,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
326 | 326 | ||
327 | UUID toID = new UUID(address.Substring(0, address.IndexOf("@"))); | 327 | UUID toID = new UUID(address.Substring(0, address.IndexOf("@"))); |
328 | 328 | ||
329 | String unused; | ||
330 | |||
331 | if (IsLocal(toID)) // TODO FIX check to see if it is local | 329 | if (IsLocal(toID)) // TODO FIX check to see if it is local |
332 | { | 330 | { |
333 | // object in this region | 331 | // object in this region |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 66fc43b..d7ab5fd 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
294 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 294 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
295 | 295 | ||
296 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); | 296 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); |
297 | asset.Metadata.Type = assetType; | 297 | asset.Type = assetType; |
298 | asset.Data = data; | 298 | asset.Data = data; |
299 | 299 | ||
300 | m_scene.CommsManager.AssetCache.AddAsset(asset); | 300 | m_scene.CommsManager.AssetCache.AddAsset(asset); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index b3286f6..abd90de 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs | |||
@@ -86,16 +86,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
86 | 86 | ||
87 | string extension = string.Empty; | 87 | string extension = string.Empty; |
88 | 88 | ||
89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type)) | 89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
90 | { | 90 | { |
91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type]; | 91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
92 | } | 92 | } |
93 | 93 | ||
94 | xtw.WriteElementString("filename", uuid.ToString() + extension); | 94 | xtw.WriteElementString("filename", uuid.ToString() + extension); |
95 | 95 | ||
96 | xtw.WriteElementString("name", asset.Metadata.Name); | 96 | xtw.WriteElementString("name", asset.Name); |
97 | xtw.WriteElementString("description", asset.Metadata.Description); | 97 | xtw.WriteElementString("description", asset.Description); |
98 | xtw.WriteElementString("asset-type", asset.Metadata.Type.ToString()); | 98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); |
99 | 99 | ||
100 | xtw.WriteEndElement(); | 100 | xtw.WriteEndElement(); |
101 | } | 101 | } |
@@ -123,15 +123,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
123 | 123 | ||
124 | string extension = string.Empty; | 124 | string extension = string.Empty; |
125 | 125 | ||
126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type)) | 126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
127 | { | 127 | { |
128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type]; | 128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
129 | } | 129 | } |
130 | else | 130 | else |
131 | { | 131 | { |
132 | m_log.ErrorFormat( | 132 | m_log.ErrorFormat( |
133 | "[ARCHIVER]: Unrecognized asset type {0} with uuid {1}. This asset will be saved but not reloaded", | 133 | "[ARCHIVER]: Unrecognized asset type {0} with uuid {1}. This asset will be saved but not reloaded", |
134 | asset.Metadata.Type, asset.Metadata.ID); | 134 | asset.Type, asset.ID); |
135 | } | 135 | } |
136 | 136 | ||
137 | archive.AddFile( | 137 | archive.AddFile( |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 743f9a1..cb267d7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | |||
@@ -157,8 +157,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
157 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); | 157 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); |
158 | 158 | ||
159 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); | 159 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); |
160 | asset.Metadata.Description = metadata.Description; | 160 | asset.Description = metadata.Description; |
161 | asset.Metadata.Type = metadata.AssetType; | 161 | asset.Type = metadata.AssetType; |
162 | asset.Data = data; | 162 | asset.Data = data; |
163 | 163 | ||
164 | m_cache.AddAsset(asset); | 164 | m_cache.AddAsset(asset); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs index 1f2d5db..93e79f0 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs | |||
@@ -54,13 +54,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
54 | { | 54 | { |
55 | 55 | ||
56 | m_asset = new AssetBase(); | 56 | m_asset = new AssetBase(); |
57 | m_asset.Metadata.FullID = UUID.Zero; | 57 | m_asset.FullID = UUID.Zero; |
58 | m_asset.Metadata.Type = type; | 58 | m_asset.Type = type; |
59 | m_asset.Data = new byte[0]; | 59 | m_asset.Data = new byte[0]; |
60 | m_asset.Metadata.Name = pClientFilename; | 60 | m_asset.Name = pClientFilename; |
61 | m_asset.Metadata.Description = "empty"; | 61 | m_asset.Description = "empty"; |
62 | m_asset.Metadata.Local = true; | 62 | m_asset.Local = true; |
63 | m_asset.Metadata.Temporary = true; | 63 | m_asset.Temporary = true; |
64 | 64 | ||
65 | } | 65 | } |
66 | 66 | ||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
72 | public void RequestStartXfer(IClientAPI pRemoteClient) | 72 | public void RequestStartXfer(IClientAPI pRemoteClient) |
73 | { | 73 | { |
74 | mXferID = Util.GetNextXferID(); | 74 | mXferID = Util.GetNextXferID(); |
75 | pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, Utils.StringToBytes(m_asset.Metadata.Name)); | 75 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); |
76 | } | 76 | } |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
114 | handlerTerrainUploadDone = TerrainUploadDone; | 114 | handlerTerrainUploadDone = TerrainUploadDone; |
115 | if (handlerTerrainUploadDone != null) | 115 | if (handlerTerrainUploadDone != null) |
116 | { | 116 | { |
117 | handlerTerrainUploadDone(m_asset.Metadata.Name, m_asset.Data, remoteClient); | 117 | handlerTerrainUploadDone(m_asset.Name, m_asset.Data, remoteClient); |
118 | } | 118 | } |
119 | } | 119 | } |
120 | } | 120 | } |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index e1c3d85..4f98e8b 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -985,14 +985,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
985 | m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; | 985 | m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; |
986 | 986 | ||
987 | AssetBase asset = new AssetBase(); | 987 | AssetBase asset = new AssetBase(); |
988 | asset.Metadata.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID; | 988 | asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID; |
989 | asset.Data = data; | 989 | asset.Data = data; |
990 | asset.Metadata.Name | 990 | asset.Name |
991 | = "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); | 991 | = "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); |
992 | asset.Metadata.Description = m_scene.RegionInfo.RegionName; | 992 | asset.Description = m_scene.RegionInfo.RegionName; |
993 | 993 | ||
994 | asset.Metadata.Type = 0; | 994 | asset.Type = 0; |
995 | asset.Metadata.Temporary = temporary; | 995 | asset.Temporary = temporary; |
996 | m_scene.CommsManager.AssetCache.AddAsset(asset); | 996 | m_scene.CommsManager.AssetCache.AddAsset(asset); |
997 | } | 997 | } |
998 | 998 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs index 1f01fa2..1a3c4c8 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs | |||
@@ -120,12 +120,12 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
120 | 120 | ||
121 | if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null)) | 121 | if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null)) |
122 | { | 122 | { |
123 | m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Metadata.Name + " " + assetID); | 123 | m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Name + " " + assetID); |
124 | // I think I need to store it in the asset DB too. | 124 | // I think I need to store it in the asset DB too. |
125 | // For now, let me just do it for textures and scripts | 125 | // For now, let me just do it for textures and scripts |
126 | if (((AssetType)asset.Metadata.Type == AssetType.Texture) || | 126 | if (((AssetType)asset.Type == AssetType.Texture) || |
127 | ((AssetType)asset.Metadata.Type == AssetType.LSLBytecode) || | 127 | ((AssetType)asset.Type == AssetType.LSLBytecode) || |
128 | ((AssetType)asset.Metadata.Type == AssetType.LSLText)) | 128 | ((AssetType)asset.Type == AssetType.LSLText)) |
129 | { | 129 | { |
130 | AssetBase asset1 = new AssetBase(); | 130 | AssetBase asset1 = new AssetBase(); |
131 | Copy(asset, asset1); | 131 | Copy(asset, asset1); |
@@ -149,7 +149,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
149 | if (asset1 != null) | 149 | if (asset1 != null) |
150 | { | 150 | { |
151 | // See long comment in AssetCache.AddAsset | 151 | // See long comment in AssetCache.AddAsset |
152 | if (!asset1.Metadata.Temporary || asset1.Metadata.Local) | 152 | if (!asset1.Temporary || asset1.Local) |
153 | { | 153 | { |
154 | // The asset cache returns instances of subclasses of AssetBase: | 154 | // The asset cache returns instances of subclasses of AssetBase: |
155 | // TextureImage or AssetInfo. So in passing them to the remote | 155 | // TextureImage or AssetInfo. So in passing them to the remote |
@@ -170,14 +170,14 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
170 | 170 | ||
171 | private void Copy(AssetBase from, AssetBase to) | 171 | private void Copy(AssetBase from, AssetBase to) |
172 | { | 172 | { |
173 | to.Data = from.Data; | 173 | to.Data = from.Data; |
174 | to.Metadata.Description = from.Metadata.Description; | 174 | to.Description = from.Description; |
175 | to.Metadata.FullID = from.Metadata.FullID; | 175 | to.FullID = from.FullID; |
176 | to.Metadata.ID = from.Metadata.ID; | 176 | to.ID = from.ID; |
177 | to.Metadata.Local = from.Metadata.Local; | 177 | to.Local = from.Local; |
178 | to.Metadata.Name = from.Metadata.Name; | 178 | to.Name = from.Name; |
179 | to.Metadata.Temporary = from.Metadata.Temporary; | 179 | to.Temporary = from.Temporary; |
180 | to.Metadata.Type = from.Metadata.Type; | 180 | to.Type = from.Type; |
181 | 181 | ||
182 | } | 182 | } |
183 | 183 | ||
@@ -235,7 +235,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
235 | private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset) | 235 | private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset) |
236 | { | 236 | { |
237 | Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>(); | 237 | Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>(); |
238 | if ((asset != null) && ((AssetType)asset.Metadata.Type == AssetType.Object)) | 238 | if ((asset != null) && ((AssetType)asset.Type == AssetType.Object)) |
239 | { | 239 | { |
240 | string ass_str = Utils.BytesToString(asset.Data); | 240 | string ass_str = Utils.BytesToString(asset.Data); |
241 | SceneObjectGroup sog = new SceneObjectGroup(ass_str, true); | 241 | SceneObjectGroup sog = new SceneObjectGroup(ass_str, true); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c98629b..2800e9e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -193,11 +193,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
193 | CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); | 193 | CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); |
194 | CommsManager.AssetCache.AddAsset(asset); | 194 | CommsManager.AssetCache.AddAsset(asset); |
195 | 195 | ||
196 | item.AssetID = asset.Metadata.FullID; | 196 | item.AssetID = asset.FullID; |
197 | userInfo.UpdateItem(item); | 197 | userInfo.UpdateItem(item); |
198 | 198 | ||
199 | // remoteClient.SendInventoryItemCreateUpdate(item); | 199 | // remoteClient.SendInventoryItemCreateUpdate(item); |
200 | return (asset.Metadata.FullID); | 200 | return (asset.FullID); |
201 | } | 201 | } |
202 | } | 202 | } |
203 | } | 203 | } |
@@ -285,7 +285,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
285 | } | 285 | } |
286 | 286 | ||
287 | // Update item with new asset | 287 | // Update item with new asset |
288 | item.AssetID = asset.Metadata.FullID; | 288 | item.AssetID = asset.FullID; |
289 | group.UpdateInventoryItem(item); | 289 | group.UpdateInventoryItem(item); |
290 | part.GetProperties(remoteClient); | 290 | part.GetProperties(remoteClient); |
291 | 291 | ||
@@ -688,7 +688,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
688 | { | 688 | { |
689 | if (newName != String.Empty) | 689 | if (newName != String.Empty) |
690 | { | 690 | { |
691 | asset.Metadata.Name = newName; | 691 | asset.Name = newName; |
692 | } | 692 | } |
693 | else | 693 | else |
694 | { | 694 | { |
@@ -728,10 +728,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
728 | private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) | 728 | private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) |
729 | { | 729 | { |
730 | AssetBase asset = new AssetBase(); | 730 | AssetBase asset = new AssetBase(); |
731 | asset.Metadata.Name = name; | 731 | asset.Name = name; |
732 | asset.Metadata.Description = description; | 732 | asset.Description = description; |
733 | asset.Metadata.Type = assetType; | 733 | asset.Type = assetType; |
734 | asset.Metadata.FullID = UUID.Random(); | 734 | asset.FullID = UUID.Random(); |
735 | asset.Data = (data == null) ? new byte[1] : data; | 735 | asset.Data = (data == null) ? new byte[1] : data; |
736 | 736 | ||
737 | return asset; | 737 | return asset; |
@@ -831,11 +831,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
831 | item.Owner = remoteClient.AgentId; | 831 | item.Owner = remoteClient.AgentId; |
832 | item.Creator = remoteClient.AgentId; | 832 | item.Creator = remoteClient.AgentId; |
833 | item.ID = UUID.Random(); | 833 | item.ID = UUID.Random(); |
834 | item.AssetID = asset.Metadata.FullID; | 834 | item.AssetID = asset.FullID; |
835 | item.Description = asset.Metadata.Description; | 835 | item.Description = asset.Description; |
836 | item.Name = name; | 836 | item.Name = name; |
837 | item.Flags = flags; | 837 | item.Flags = flags; |
838 | item.AssetType = asset.Metadata.Type; | 838 | item.AssetType = asset.Type; |
839 | item.InvType = invType; | 839 | item.InvType = invType; |
840 | item.Folder = folderID; | 840 | item.Folder = folderID; |
841 | item.CurrentPermissions = currentMask; | 841 | item.CurrentPermissions = currentMask; |
@@ -905,7 +905,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
905 | AssetBase asset = CreateAsset(name, description, assetType, data); | 905 | AssetBase asset = CreateAsset(name, description, assetType, data); |
906 | CommsManager.AssetCache.AddAsset(asset); | 906 | CommsManager.AssetCache.AddAsset(asset); |
907 | 907 | ||
908 | CreateNewInventoryItem(remoteClient, folderID, asset.Metadata.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); | 908 | CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); |
909 | } | 909 | } |
910 | else | 910 | else |
911 | { | 911 | { |
@@ -1553,7 +1553,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1553 | taskItem.Flags = itemBase.Flags; | 1553 | taskItem.Flags = itemBase.Flags; |
1554 | taskItem.PermsGranter = UUID.Zero; | 1554 | taskItem.PermsGranter = UUID.Zero; |
1555 | taskItem.PermsMask = 0; | 1555 | taskItem.PermsMask = 0; |
1556 | taskItem.AssetID = asset.Metadata.FullID; | 1556 | taskItem.AssetID = asset.FullID; |
1557 | 1557 | ||
1558 | part.Inventory.AddInventoryItem(taskItem, false); | 1558 | part.Inventory.AddInventoryItem(taskItem, false); |
1559 | part.GetProperties(remoteClient); | 1559 | part.GetProperties(remoteClient); |
@@ -1953,16 +1953,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1953 | (sbyte)AssetType.Object, | 1953 | (sbyte)AssetType.Object, |
1954 | Utils.StringToBytes(sceneObjectXml)); | 1954 | Utils.StringToBytes(sceneObjectXml)); |
1955 | CommsManager.AssetCache.AddAsset(asset); | 1955 | CommsManager.AssetCache.AddAsset(asset); |
1956 | assetID = asset.Metadata.FullID; | 1956 | assetID = asset.FullID; |
1957 | 1957 | ||
1958 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1958 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1959 | { | 1959 | { |
1960 | item.AssetID = asset.Metadata.FullID; | 1960 | item.AssetID = asset.FullID; |
1961 | userInfo.UpdateItem(item); | 1961 | userInfo.UpdateItem(item); |
1962 | } | 1962 | } |
1963 | else | 1963 | else |
1964 | { | 1964 | { |
1965 | item.AssetID = asset.Metadata.FullID; | 1965 | item.AssetID = asset.FullID; |
1966 | 1966 | ||
1967 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) | 1967 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) |
1968 | { | 1968 | { |
@@ -1995,9 +1995,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1995 | 1995 | ||
1996 | // TODO: add the new fields (Flags, Sale info, etc) | 1996 | // TODO: add the new fields (Flags, Sale info, etc) |
1997 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 1997 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
1998 | item.Description = asset.Metadata.Description; | 1998 | item.Description = asset.Description; |
1999 | item.Name = asset.Metadata.Name; | 1999 | item.Name = asset.Name; |
2000 | item.AssetType = asset.Metadata.Type; | 2000 | item.AssetType = asset.Type; |
2001 | 2001 | ||
2002 | userInfo.AddItem(item); | 2002 | userInfo.AddItem(item); |
2003 | 2003 | ||
@@ -2080,10 +2080,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2080 | Utils.StringToBytes(sceneObjectXml)); | 2080 | Utils.StringToBytes(sceneObjectXml)); |
2081 | CommsManager.AssetCache.AddAsset(asset); | 2081 | CommsManager.AssetCache.AddAsset(asset); |
2082 | 2082 | ||
2083 | item.AssetID = asset.Metadata.FullID; | 2083 | item.AssetID = asset.FullID; |
2084 | item.Description = asset.Metadata.Description; | 2084 | item.Description = asset.Description; |
2085 | item.Name = asset.Metadata.Name; | 2085 | item.Name = asset.Name; |
2086 | item.AssetType = asset.Metadata.Type; | 2086 | item.AssetType = asset.Type; |
2087 | item.InvType = (int)InventoryType.Object; | 2087 | item.InvType = (int)InventoryType.Object; |
2088 | item.Folder = foundFolder; | 2088 | item.Folder = foundFolder; |
2089 | 2089 | ||
@@ -2121,10 +2121,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2121 | item.Creator = grp.RootPart.CreatorID; | 2121 | item.Creator = grp.RootPart.CreatorID; |
2122 | item.Owner = remoteClient.AgentId; | 2122 | item.Owner = remoteClient.AgentId; |
2123 | item.ID = UUID.Random(); | 2123 | item.ID = UUID.Random(); |
2124 | item.AssetID = asset.Metadata.FullID; | 2124 | item.AssetID = asset.FullID; |
2125 | item.Description = asset.Metadata.Description; | 2125 | item.Description = asset.Description; |
2126 | item.Name = asset.Metadata.Name; | 2126 | item.Name = asset.Name; |
2127 | item.AssetType = asset.Metadata.Type; | 2127 | item.AssetType = asset.Type; |
2128 | item.InvType = (int)InventoryType.Object; | 2128 | item.InvType = (int)InventoryType.Object; |
2129 | 2129 | ||
2130 | item.Folder = UUID.Zero; // Objects folder! | 2130 | item.Folder = UUID.Zero; // Objects folder! |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5badd2d..1d2f37a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3555,10 +3555,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3555 | 3555 | ||
3556 | item.ID = UUID.Random(); | 3556 | item.ID = UUID.Random(); |
3557 | item.Owner = remoteClient.AgentId; | 3557 | item.Owner = remoteClient.AgentId; |
3558 | item.AssetID = asset.Metadata.FullID; | 3558 | item.AssetID = asset.FullID; |
3559 | item.Description = asset.Metadata.Description; | 3559 | item.Description = asset.Description; |
3560 | item.Name = asset.Metadata.Name; | 3560 | item.Name = asset.Name; |
3561 | item.AssetType = asset.Metadata.Type; | 3561 | item.AssetType = asset.Type; |
3562 | item.InvType = (int)InventoryType.Object; | 3562 | item.InvType = (int)InventoryType.Object; |
3563 | item.Folder = categoryID; | 3563 | item.Folder = categoryID; |
3564 | 3564 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e4ef236..eeef58b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1025,10 +1025,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1025 | 1025 | ||
1026 | // Create new asset | 1026 | // Create new asset |
1027 | AssetBase asset = new AssetBase(); | 1027 | AssetBase asset = new AssetBase(); |
1028 | asset.Metadata.Name = notecardName; | 1028 | asset.Name = notecardName; |
1029 | asset.Metadata.Description = "Script Generated Notecard"; | 1029 | asset.Description = "Script Generated Notecard"; |
1030 | asset.Metadata.Type = 7; | 1030 | asset.Type = 7; |
1031 | asset.Metadata.FullID = UUID.Random(); | 1031 | asset.FullID = UUID.Random(); |
1032 | string notecardData = ""; | 1032 | string notecardData = ""; |
1033 | 1033 | ||
1034 | for (int i = 0; i < contents.Length; i++) { | 1034 | for (int i = 0; i < contents.Length; i++) { |
@@ -1048,8 +1048,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1048 | taskItem.ResetIDs(m_host.UUID); | 1048 | taskItem.ResetIDs(m_host.UUID); |
1049 | taskItem.ParentID = m_host.UUID; | 1049 | taskItem.ParentID = m_host.UUID; |
1050 | taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); | 1050 | taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); |
1051 | taskItem.Name = asset.Metadata.Name; | 1051 | taskItem.Name = asset.Name; |
1052 | taskItem.Description = asset.Metadata.Description; | 1052 | taskItem.Description = asset.Description; |
1053 | taskItem.Type = 7; | 1053 | taskItem.Type = 7; |
1054 | taskItem.InvType = 7; | 1054 | taskItem.InvType = 7; |
1055 | taskItem.OwnerID = m_host.OwnerID; | 1055 | taskItem.OwnerID = m_host.OwnerID; |
@@ -1063,7 +1063,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1063 | taskItem.Flags = 0; | 1063 | taskItem.Flags = 0; |
1064 | taskItem.PermsGranter = UUID.Zero; | 1064 | taskItem.PermsGranter = UUID.Zero; |
1065 | taskItem.PermsMask = 0; | 1065 | taskItem.PermsMask = 0; |
1066 | taskItem.AssetID = asset.Metadata.FullID; | 1066 | taskItem.AssetID = asset.FullID; |
1067 | 1067 | ||
1068 | m_host.Inventory.AddInventoryItem(taskItem, false); | 1068 | m_host.Inventory.AddInventoryItem(taskItem, false); |
1069 | } | 1069 | } |