diff options
author | diva | 2009-05-15 05:00:25 +0000 |
---|---|---|
committer | diva | 2009-05-15 05:00:25 +0000 |
commit | 5e4fc6e91e5edffd1dc23af4f583d6294f394a3d (patch) | |
tree | 497076db68193be2d14fc3788c1d80c74d8c977d /OpenSim/ApplicationPlugins/Rest | |
parent | some sculpted prim geometry accuracy and meshing speed improvements (diff) | |
download | opensim-SC_OLD-5e4fc6e91e5edffd1dc23af4f583d6294f394a3d.zip opensim-SC_OLD-5e4fc6e91e5edffd1dc23af4f583d6294f394a3d.tar.gz opensim-SC_OLD-5e4fc6e91e5edffd1dc23af4f583d6294f394a3d.tar.bz2 opensim-SC_OLD-5e4fc6e91e5edffd1dc23af4f583d6294f394a3d.tar.xz |
Heart surgery on asset service code bits. Affects OpenSim.ini configuration -- please see the example. Affects region servers only.
This may break a lot of things, but it needs to go in. It was tested in standalone and the UCI grid, but it needs a lot more testing.
Known problems:
* HG asset transfers are borked for now
* missing texture is missing
* 3 unit tests commented out for now
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest')
3 files changed, 11 insertions, 11 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs index 748f20a..5d58c6a 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs | |||
@@ -34,6 +34,8 @@ using log4net; | |||
34 | using Nini.Config; | 34 | using Nini.Config; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 36 | using OpenSim.Framework.Communications; |
37 | using OpenSim.Services.Interfaces; | ||
38 | using IUserService = OpenSim.Framework.Communications.IUserService; | ||
37 | 39 | ||
38 | namespace OpenSim.ApplicationPlugins.Rest.Inventory | 40 | namespace OpenSim.ApplicationPlugins.Rest.Inventory |
39 | { | 41 | { |
@@ -110,9 +112,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
110 | get { return Comms.AvatarService; } | 112 | get { return Comms.AvatarService; } |
111 | } | 113 | } |
112 | 114 | ||
113 | internal static IAssetCache AssetServices | 115 | internal static IAssetService AssetServices |
114 | { | 116 | { |
115 | get { return Comms.AssetCache; } | 117 | get { return main.SceneManager.CurrentOrFirstScene.AssetService; } |
116 | } | 118 | } |
117 | 119 | ||
118 | /// <summary> | 120 | /// <summary> |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index 77c14c6..cd2074a 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs | |||
@@ -190,14 +190,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
190 | 190 | ||
191 | private void DoGet(AssetRequestData rdata) | 191 | private void DoGet(AssetRequestData rdata) |
192 | { | 192 | { |
193 | bool istexture = false; | ||
194 | |||
195 | Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); | 193 | Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); |
196 | 194 | ||
197 | if (rdata.Parameters.Length == 1) | 195 | if (rdata.Parameters.Length == 1) |
198 | { | 196 | { |
199 | UUID uuid = new UUID(rdata.Parameters[0]); | 197 | UUID uuid = new UUID(rdata.Parameters[0]); |
200 | AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture); | 198 | AssetBase asset = Rest.AssetServices.Get(uuid.ToString()); |
201 | 199 | ||
202 | if (asset != null) | 200 | if (asset != null) |
203 | { | 201 | { |
@@ -258,7 +256,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
258 | } | 256 | } |
259 | 257 | ||
260 | UUID uuid = new UUID(rdata.Parameters[0]); | 258 | UUID uuid = new UUID(rdata.Parameters[0]); |
261 | asset = Rest.AssetServices.GetAsset(uuid, false); | 259 | asset = Rest.AssetServices.Get(uuid.ToString()); |
262 | 260 | ||
263 | modified = (asset != null); | 261 | modified = (asset != null); |
264 | created = !modified; | 262 | created = !modified; |
@@ -278,7 +276,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
278 | MsgId, rdata.Parameters[0], asset.ID); | 276 | MsgId, rdata.Parameters[0], asset.ID); |
279 | } | 277 | } |
280 | 278 | ||
281 | Rest.AssetServices.AddAsset(asset); | 279 | Rest.AssetServices.Store(asset); |
282 | 280 | ||
283 | } | 281 | } |
284 | else | 282 | else |
@@ -338,7 +336,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
338 | } | 336 | } |
339 | 337 | ||
340 | UUID uuid = new UUID(xml.GetAttribute("id")); | 338 | UUID uuid = new UUID(xml.GetAttribute("id")); |
341 | AssetBase asset = Rest.AssetServices.GetAsset(uuid, false); | 339 | AssetBase asset = Rest.AssetServices.Get(uuid.ToString()); |
342 | 340 | ||
343 | modified = (asset != null); | 341 | modified = (asset != null); |
344 | created = !modified; | 342 | created = !modified; |
@@ -352,7 +350,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
352 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; | 350 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; |
353 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); | 351 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); |
354 | 352 | ||
355 | Rest.AssetServices.AddAsset(asset); | 353 | Rest.AssetServices.Store(asset); |
356 | 354 | ||
357 | if (created) | 355 | if (created) |
358 | { | 356 | { |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 5de44b6..1a330b1 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | |||
@@ -476,7 +476,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
476 | { | 476 | { |
477 | Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", | 477 | Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", |
478 | MsgId, asset.ID, asset.Type, asset.Name); | 478 | MsgId, asset.ID, asset.Type, asset.Name); |
479 | Rest.AssetServices.AddAsset(asset); | 479 | Rest.AssetServices.Store(asset); |
480 | 480 | ||
481 | created = true; | 481 | created = true; |
482 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", | 482 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", |
@@ -682,7 +682,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
682 | 682 | ||
683 | // The asset was validated during the collection process | 683 | // The asset was validated during the collection process |
684 | 684 | ||
685 | Rest.AssetServices.AddAsset(asset); | 685 | Rest.AssetServices.Store(asset); |
686 | 686 | ||
687 | created = true; | 687 | created = true; |
688 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.ID)); | 688 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.ID)); |