diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs | 68 |
1 files changed, 4 insertions, 64 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs index 3ef2e1f..6dcbe83 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -199,81 +199,21 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
199 | m_asset.Name = name; | 199 | m_asset.Name = name; |
200 | m_asset.Description = description; | 200 | m_asset.Description = description; |
201 | m_asset.Type = type; | 201 | m_asset.Type = type; |
202 | m_createItem = true; | 202 | |
203 | |||
204 | if (m_finished) | 203 | if (m_finished) |
205 | { | 204 | { |
206 | DoCreateItem(); | 205 | DoCreateItem(); |
207 | } | 206 | } |
208 | } | ||
209 | } | ||
210 | |||
211 | public void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, | ||
212 | InventoryItemBase item) | ||
213 | { | ||
214 | if (TransactionID == transactionID) | ||
215 | { | ||
216 | CachedUserInfo userInfo = | ||
217 | m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails( | ||
218 | remoteClient.AgentId); | ||
219 | |||
220 | if (userInfo != null) | ||
221 | { | ||
222 | UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId); | ||
223 | |||
224 | AssetBase asset | ||
225 | = m_userTransactions.Manager.MyScene.CommsManager.AssetCache.GetAsset( | ||
226 | assetID, (item.AssetType == (int) AssetType.Texture ? true : false)); | ||
227 | |||
228 | if (asset == null) | ||
229 | { | ||
230 | asset = m_userTransactions.GetTransactionAsset(transactionID); | ||
231 | } | ||
232 | |||
233 | if (asset != null && asset.FullID == assetID) | ||
234 | { | ||
235 | // Assets never get updated, new ones get created | ||
236 | asset.FullID = UUID.Random(); | ||
237 | asset.Name = item.Name; | ||
238 | asset.Description = item.Description; | ||
239 | asset.Type = (sbyte) item.AssetType; | ||
240 | item.AssetID = asset.FullID; | ||
241 | |||
242 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); | ||
243 | } | ||
244 | |||
245 | userInfo.UpdateItem(item); | ||
246 | } | ||
247 | else | 207 | else |
248 | { | 208 | { |
249 | m_log.ErrorFormat( | 209 | m_createItem = true; //set flag so the inventory item is created when upload is complete |
250 | "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item update", | 210 | } |
251 | remoteClient.AgentId); | ||
252 | } | ||
253 | } | 211 | } |
254 | } | 212 | } |
255 | 213 | ||
256 | public void RequestUpdateTaskInventoryItem( | ||
257 | IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item) | ||
258 | { | ||
259 | m_log.DebugFormat( | ||
260 | "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", | ||
261 | item.Name, part.Name, transactionID); | ||
262 | |||
263 | m_asset.Name = item.Name; | ||
264 | m_asset.Description = item.Description; | ||
265 | m_asset.Type = (sbyte) item.Type; | ||
266 | item.AssetID = m_asset.FullID; | ||
267 | |||
268 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); | ||
269 | |||
270 | if (part.Inventory.UpdateInventoryItem(item)) | ||
271 | part.GetProperties(remoteClient); | ||
272 | } | ||
273 | 214 | ||
274 | private void DoCreateItem() | 215 | private void DoCreateItem() |
275 | { | 216 | { |
276 | //really need to fix this call, if lbsa71 saw this he would die. | ||
277 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); | 217 | m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); |
278 | CachedUserInfo userInfo = | 218 | CachedUserInfo userInfo = |
279 | m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails( | 219 | m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails( |