diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index bba7b9c..59d0075 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -155,56 +155,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
155 | description, name, invType, type, wearableType, nextOwnerMask); | 155 | description, name, invType, type, wearableType, nextOwnerMask); |
156 | } | 156 | } |
157 | 157 | ||
158 | /// <summary> | ||
159 | /// Get an uploaded asset. If the data is successfully retrieved, | ||
160 | /// the transaction will be removed. | ||
161 | /// </summary> | ||
162 | /// <param name="transactionID"></param> | ||
163 | /// <returns>The asset if the upload has completed, null if it has not.</returns> | ||
164 | private AssetBase GetTransactionAsset(UUID transactionID) | ||
165 | { | ||
166 | lock (XferUploaders) | ||
167 | { | ||
168 | if (XferUploaders.ContainsKey(transactionID)) | ||
169 | { | ||
170 | AssetXferUploader uploader = XferUploaders[transactionID]; | ||
171 | AssetBase asset = uploader.GetAssetData(); | ||
172 | RemoveXferUploader(transactionID); | ||
173 | |||
174 | return asset; | ||
175 | } | ||
176 | } | ||
177 | |||
178 | return null; | ||
179 | } | ||
180 | |||
181 | public void RequestUpdateTaskInventoryItem(IClientAPI remoteClient, | 158 | public void RequestUpdateTaskInventoryItem(IClientAPI remoteClient, |
182 | SceneObjectPart part, UUID transactionID, | 159 | SceneObjectPart part, UUID transactionID, |
183 | TaskInventoryItem item) | 160 | TaskInventoryItem item) |
184 | { | 161 | { |
185 | AssetBase asset = GetTransactionAsset(transactionID); | 162 | AssetXferUploader uploader = RequestXferUploader(transactionID); |
186 | |||
187 | // Only legacy viewers use this, and they prefer CAPS, which | ||
188 | // we have, so this really never runs. | ||
189 | // Allow it, but only for "safe" types. | ||
190 | if ((InventoryType)item.InvType != InventoryType.Notecard && | ||
191 | (InventoryType)item.InvType != InventoryType.LSL) | ||
192 | return; | ||
193 | 163 | ||
194 | if (asset != null) | 164 | uploader.RequestUpdateTaskInventoryItem(remoteClient, transactionID, item); |
195 | { | ||
196 | // m_log.DebugFormat( | ||
197 | // "[AGENT ASSETS TRANSACTIONS]: Updating item {0} in {1} for transaction {2}", | ||
198 | // item.Name, part.Name, transactionID); | ||
199 | |||
200 | asset.FullID = UUID.Random(); | ||
201 | asset.Name = item.Name; | ||
202 | asset.Description = item.Description; | ||
203 | asset.Type = (sbyte)item.Type; | ||
204 | item.AssetID = asset.FullID; | ||
205 | |||
206 | m_Scene.AssetService.Store(asset); | ||
207 | } | ||
208 | } | 165 | } |
209 | 166 | ||
210 | public void RequestUpdateInventoryItem(IClientAPI remoteClient, | 167 | public void RequestUpdateInventoryItem(IClientAPI remoteClient, |