Instrument the UDP path of creating assets so that it triggers an asset post for users with different asset servers

0.8.0.3
Diva Canto 2014-07-04 15:56:09 -07:00 committed by Justin Clark-Casey
parent 12ce20a203
commit fe1ae9db1b
2 changed files with 11 additions and 5 deletions

View File

@ -31,6 +31,7 @@ using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using PermissionMask = OpenSim.Framework.PermissionMask;
@ -376,6 +377,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
m_Scene.AssetService.Store(m_asset);
m_transactions.RemoveXferUploader(m_transactionID);
m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(ourClient.AgentId, (AssetType)type, m_asset.FullID, m_asset.Name, 0);
}
/// <summary>
@ -421,6 +424,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
ourClient.SendAlertMessage("Unable to create inventory item");
m_transactions.RemoveXferUploader(m_transactionID);
m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(ourClient.AgentId, (AssetType)type, m_asset.FullID, m_asset.Name, 0);
}
}
}

View File

@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
base.AddRegion(scene);
m_assMapper = new HGAssetMapper(scene, m_HomeURI);
scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem;
scene.EventManager.OnNewInventoryItemUploadComplete += PostInventoryAsset;
scene.EventManager.OnTeleportStart += TeleportStart;
scene.EventManager.OnTeleportFail += TeleportFail;
@ -209,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
public void UploadInventoryItem(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel)
public void PostInventoryAsset(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel)
{
if (type == AssetType.Link)
return;
@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
UUID newAssetID = base.CapsUpdateInventoryItemAsset(remoteClient, itemID, data);
UploadInventoryItem(remoteClient.AgentId, AssetType.Unknown, newAssetID, "", 0);
PostInventoryAsset(remoteClient.AgentId, AssetType.Unknown, newAssetID, "", 0);
return newAssetID;
}
@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
if (base.UpdateInventoryItemAsset(ownerID, item, asset))
{
UploadInventoryItem(ownerID, (AssetType)asset.Type, asset.FullID, asset.Name, 0);
PostInventoryAsset(ownerID, (AssetType)asset.Type, asset.FullID, asset.Name, 0);
return true;
}
@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
protected override void ExportAsset(UUID agentID, UUID assetID)
{
if (!assetID.Equals(UUID.Zero))
UploadInventoryItem(agentID, AssetType.Unknown, assetID, "", 0);
PostInventoryAsset(agentID, AssetType.Unknown, assetID, "", 0);
else
m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
}