From 5e4fc6e91e5edffd1dc23af4f583d6294f394a3d Mon Sep 17 00:00:00 2001 From: diva Date: Fri, 15 May 2009 05:00:25 +0000 Subject: 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 --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 14 ++++++++++---- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9020ff9..d4fc2d1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3782,8 +3782,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api World.RegionInfo.RegionLocY * Constants.RegionSize, 0); - World.CommsManager.AssetCache.GetAsset(item.AssetID, - delegate(UUID i, AssetBase a) + World.AssetService.Get(item.AssetID.ToString(), this, + delegate(string i, object sender, AssetBase a) { AssetLandmark lm = new AssetLandmark(a); @@ -3795,7 +3795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands. DataserverPlugin.DataserverReply(i.ToString(), reply); - }, false); + }); // ScriptSleep(1000); return tid.ToString(); @@ -9311,7 +9311,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public delegate void AssetRequestCallback(UUID assetID, AssetBase asset); private void WithNotecard(UUID assetID, AssetRequestCallback cb) { - World.CommsManager.AssetCache.GetAsset(assetID, delegate(UUID i, AssetBase a) { cb(i, a); }, false); + World.AssetService.Get(assetID.ToString(), this, + delegate(string i, object sender, AssetBase a) + { + UUID uuid = UUID.Zero; + UUID.TryParse(i, out uuid); + cb(uuid, a); + }); } public LSL_String llGetNumberOfNotecardLines(string name) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e5c59aa..fbae9c8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1341,7 +1341,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api + textLength.ToString() + "\n" + notecardData + "}\n"; asset.Data = Encoding.ASCII.GetBytes(notecardData); - World.CommsManager.AssetCache.AddAsset(asset); + World.AssetService.Store(asset); // Create Task Entry TaskInventoryItem taskItem=new TaskInventoryItem(); @@ -1402,7 +1402,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!NotecardCache.IsCached(assetID)) { - AssetBase a = World.CommsManager.AssetCache.GetAsset(assetID, false); + AssetBase a = World.AssetService.Get(assetID.ToString()); if (a != null) { System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); @@ -1455,7 +1455,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!NotecardCache.IsCached(assetID)) { - AssetBase a = World.CommsManager.AssetCache.GetAsset(assetID, false); + AssetBase a = World.AssetService.Get(assetID.ToString()); if (a != null) { System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); @@ -1512,7 +1512,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!NotecardCache.IsCached(assetID)) { - AssetBase a = World.CommsManager.AssetCache.GetAsset(assetID, false); + AssetBase a = World.AssetService.Get(assetID.ToString()); if (a != null) { System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); -- cgit v1.1