aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
diff options
context:
space:
mode:
authorMW2008-11-24 10:03:18 +0000
committerMW2008-11-24 10:03:18 +0000
commit0be9ff19490149509dec72898be3f9dfe84612af (patch)
tree9f8f22a0995d99d3b4315d083cd4ec37c839d681 /OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
parentThanks SachaMagne for a patch which adds the following console commands: (diff)
downloadopensim-SC_OLD-0be9ff19490149509dec72898be3f9dfe84612af.zip
opensim-SC_OLD-0be9ff19490149509dec72898be3f9dfe84612af.tar.gz
opensim-SC_OLD-0be9ff19490149509dec72898be3f9dfe84612af.tar.bz2
opensim-SC_OLD-0be9ff19490149509dec72898be3f9dfe84612af.tar.xz
Some refactoring from about a week ago that I forgot to commit, of AssetTransactionModule to cut down on number of classes and to work towards having a base AssetXferUploader class than can be shared with EstateTerrainXferHandler
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs68
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(