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

@@ -32,6 +32,7 @@ using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
{
@@ -177,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
asset.Type = (sbyte)item.Type;
item.AssetID = asset.FullID;
Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
Manager.MyScene.AssetService.Store(asset);
if (part.Inventory.UpdateInventoryItem(item))
part.GetProperties(remoteClient);
@@ -198,9 +199,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
{
UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId);
AssetBase asset
= Manager.MyScene.CommsManager.AssetCache.GetAsset(
assetID, (item.AssetType == (int)AssetType.Texture ? true : false));
AssetBase asset = Manager.MyScene.AssetService.Get(assetID.ToString());
if (asset == null)
{
@@ -216,7 +215,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
asset.Type = (sbyte)item.AssetType;
item.AssetID = asset.FullID;
Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
Manager.MyScene.AssetService.Store(asset);
}
userInfo.UpdateItem(item);

View File

@@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
}
else if (m_storeLocal)
{
m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset);
m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
}
m_log.DebugFormat("[ASSET TRANSACTIONS]: Uploaded asset data for transaction {0}", TransactionID);
@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
private void DoCreateItem(uint callbackID)
{
m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset);
m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
CachedUserInfo userInfo =
m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(
ourClient.AgentId);

View File

@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
Caps caps
= new Caps(
m_scene.CommsManager.AssetCache, m_scene.CommsManager.HttpServer, m_scene.RegionInfo.ExternalHostName,
m_scene.AssetService, m_scene.CommsManager.HttpServer, m_scene.RegionInfo.ExternalHostName,
m_scene.CommsManager.HttpServer.Port,
capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);

View File

@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
@@ -152,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber);
m_textureSenders.Add(e.RequestedAssetID, requestHandler);
m_scene.CommsManager.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true);
m_scene.AssetService.Get(e.RequestedAssetID.ToString(), this, TextureReceived);
}
}
}
@@ -168,6 +169,12 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
}
}
protected void TextureReceived(string id, Object sender, AssetBase asset)
{
if (asset != null)
TextureCallback(asset.FullID, asset);
}
/// <summary>
/// The callback for the asset cache when a texture has been retrieved. This method queues the
/// texture sender for processing.