From 78c155cd129824dfb651127f37786404a5ecfed6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 4 Jul 2014 15:56:09 -0700 Subject: Instrument the UDP path of creating assets so that it triggers an asset post for users with different asset servers --- .../CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | 6 ++++++ .../Framework/InventoryAccess/HGInventoryAccessModule.cs | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 5e772e6..c598748 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -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); } /// @@ -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); } + } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 5e831cc..582b267 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -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"); } -- cgit v1.1