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
This commit is contained in:
diva
2009-05-15 05:00:25 +00:00
parent 14c1e991c6
commit 5e4fc6e91e
56 changed files with 716 additions and 511 deletions

View File

@@ -47,6 +47,7 @@ using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.CoreModules.World.Terrain;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
namespace OpenSim.ApplicationPlugins.RemoteController
{
@@ -1421,7 +1422,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UICallback uic;
IInventoryServices iserv = m_app.CommunicationsManager.InventoryService;
IAssetCache aserv = m_app.CommunicationsManager.AssetCache;
IAssetService aserv = m_app.SceneManager.CurrentOrFirstScene.AssetService;
doc.LoadXml(File.ReadAllText(dafn));
@@ -1437,7 +1438,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
rass.Local = Boolean.Parse(GetStringAttribute(asset,"local",""));
rass.Temporary = Boolean.Parse(GetStringAttribute(asset,"temporary",""));
rass.Data = Convert.FromBase64String(asset.InnerText);
aserv.AddAsset(rass);
aserv.Store(rass);
}
avatars = doc.GetElementsByTagName("Avatar");

View File

@@ -34,6 +34,8 @@ using log4net;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Services.Interfaces;
using IUserService = OpenSim.Framework.Communications.IUserService;
namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
@@ -110,9 +112,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
get { return Comms.AvatarService; }
}
internal static IAssetCache AssetServices
internal static IAssetService AssetServices
{
get { return Comms.AssetCache; }
get { return main.SceneManager.CurrentOrFirstScene.AssetService; }
}
/// <summary>

View File

@@ -190,14 +190,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
private void DoGet(AssetRequestData rdata)
{
bool istexture = false;
Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method);
if (rdata.Parameters.Length == 1)
{
UUID uuid = new UUID(rdata.Parameters[0]);
AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture);
AssetBase asset = Rest.AssetServices.Get(uuid.ToString());
if (asset != null)
{
@@ -258,7 +256,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
UUID uuid = new UUID(rdata.Parameters[0]);
asset = Rest.AssetServices.GetAsset(uuid, false);
asset = Rest.AssetServices.Get(uuid.ToString());
modified = (asset != null);
created = !modified;
@@ -278,7 +276,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
MsgId, rdata.Parameters[0], asset.ID);
}
Rest.AssetServices.AddAsset(asset);
Rest.AssetServices.Store(asset);
}
else
@@ -338,7 +336,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
UUID uuid = new UUID(xml.GetAttribute("id"));
AssetBase asset = Rest.AssetServices.GetAsset(uuid, false);
AssetBase asset = Rest.AssetServices.Get(uuid.ToString());
modified = (asset != null);
created = !modified;
@@ -352,7 +350,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
Rest.AssetServices.AddAsset(asset);
Rest.AssetServices.Store(asset);
if (created)
{

View File

@@ -476,7 +476,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
MsgId, asset.ID, asset.Type, asset.Name);
Rest.AssetServices.AddAsset(asset);
Rest.AssetServices.Store(asset);
created = true;
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>",
@@ -682,7 +682,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// The asset was validated during the collection process
Rest.AssetServices.AddAsset(asset);
Rest.AssetServices.Store(asset);
created = true;
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.ID));