From 365cf8e4555e5105d669f3ebf11d3fb5b563f9a8 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 13 Feb 2008 00:30:51 +0000 Subject: * Refactor: Move last commit's refactor back to AgentAssetTransactionsManager * Push asset update (invoked when clothing is altered) down into AgentAssetTransactions from Scene.Inventory.cs to join others * I've tested that clothing creation and update still works, but please let me know if it suddently breaks for you. * Add/correct comments --- .../Region/Environment/Scenes/Scene.Inventory.cs | 49 +++------------------- 1 file changed, 6 insertions(+), 43 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 0dc3139..6800d5f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -253,6 +253,7 @@ namespace OpenSim.Region.Environment.Scenes if (userInfo != null && userInfo.RootFolder != null) { InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); + if (item != null) { if (LLUUID.Zero == transactionID) @@ -265,34 +266,8 @@ namespace OpenSim.Region.Environment.Scenes } else { - AgentAssetTransactions transactions - = CommsManager.TransactionsManager.GetUserTransactions(remoteClient.AgentId); - - if (transactions != null) - { - LLUUID assetID = LLUUID.Combine(transactionID, remoteClient.SecureSessionId); - AssetBase asset - = AssetCache.GetAsset( - assetID, (item.assetType == (int) AssetType.Texture ? true : false)); - - if (asset == null) - { - asset = transactions.GetTransactionAsset(transactionID); - } - - if (asset != null && asset.FullID == assetID) - { - asset.Name = item.inventoryName; - asset.Description = item.inventoryDescription; - asset.InvType = (sbyte) item.invType; - asset.Type = (sbyte) item.assetType; - item.assetID = asset.FullID; - - AssetCache.AddAsset(asset); - } - - userInfo.UpdateItem(remoteClient.AgentId, item); - } + CommsManager.TransactionsManager.HandleItemUpdateFromTransaction( + remoteClient, transactionID, item); } } else @@ -484,21 +459,9 @@ namespace OpenSim.Region.Environment.Scenes } else { - AgentAssetTransactions transactions - = CommsManager.TransactionsManager.GetUserTransactions(remoteClient.AgentId); - - if (transactions != null) - { - transactions.RequestCreateInventoryItem( - remoteClient, transactionID, folderID, callbackID, description, - name, invType, assetType, wearableType, nextOwnerMask); - } - else - { - m_log.ErrorFormat( - "Agent asset transactions for agent {0} uuid {1} in transaction uuid {2} unexpectedly null!", - remoteClient.Name, remoteClient.AgentId, transactionID); - } + CommsManager.TransactionsManager.HandleItemCreationFromTransaction( + remoteClient, transactionID, folderID, callbackID, description, + name, invType, assetType, wearableType, nextOwnerMask); } } -- cgit v1.1