28 using System.Collections.Generic;
29 using System.Reflection;
32 using OpenSim.Framework;
34 using OpenSim.Region.Framework.Scenes;
35 using OpenSim.Services.Interfaces;
36 using OpenSim.Region.Framework.Interfaces;
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 private bool m_dumpAssetsToFile;
49 private Scene m_Scene;
50 private Dictionary<UUID, AssetXferUploader> XferUploaders =
new Dictionary<UUID, AssetXferUploader>();
54 bool dumpAssetsToFile)
57 m_dumpAssetsToFile = dumpAssetsToFile;
75 if (!XferUploaders.ContainsKey(transactionID))
77 uploader =
new AssetXferUploader(
this, m_Scene, transactionID, m_dumpAssetsToFile);
82 XferUploaders.Add(transactionID, uploader);
86 uploader = XferUploaders[transactionID];
93 public void HandleXfer(ulong xferID, uint packetID, byte[] data)
105 if (uploader.
XferID == xferID)
107 foundUploader = uploader;
113 if (foundUploader != null)
119 foundUploader.HandleXferPacket(xferID, packetID, data);
125 if (estateModule != null)
132 "[AGENT ASSET TRANSACTIONS]: Could not find uploader for xfer id {0}, packet id {1}, data length {2}",
133 xferID, packetID, data.Length);
141 bool removed = XferUploaders.Remove(transactionID);
145 "[AGENT ASSET TRANSACTIONS]: Received request to remove xfer uploader with transaction ID {0} but none found",
156 UUID transactionID, UUID folderID, uint callbackID,
157 string description,
string name, sbyte invType,
158 sbyte type, byte wearableType, uint nextOwnerMask)
162 uploader.RequestCreateInventoryItem(
163 remoteClient, folderID, callbackID,
164 description, name, invType, type, wearableType, nextOwnerMask);
177 if (item.
Type == (
int)AssetType.Bodypart ||
178 item.
Type == (
int)AssetType.Clothing ||
181 AssetBase oldAsset = m_Scene.AssetService.Get(item.AssetID.ToString());
182 if (oldAsset != null)
183 uploader.SetOldData(oldAsset.Data);
186 uploader.RequestUpdateTaskInventoryItem(remoteClient, item);
196 if (item.
AssetType == (
int)AssetType.Bodypart ||
197 item.
AssetType == (
int)AssetType.Clothing ||
200 AssetBase oldAsset = m_Scene.AssetService.Get(item.AssetID.ToString());
201 if (oldAsset != null)
202 uploader.SetOldData(oldAsset.Data);
205 uploader.RequestUpdateInventoryItem(remoteClient, item);
void RequestUpdateTaskInventoryItem(IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item)
AssetXferUploader RequestXferUploader(UUID transactionID)
Return the xfer uploader for the given transaction.
bool RemoveXferUploader(UUID transactionID)
Represents an item in a task inventory
AgentAssetTransactions(UUID agentID, Scene scene, bool dumpAssetsToFile)
void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item)
Asset class. All Assets are reference by this class or a class derived from this class ...
Inventory Item - contains all the properties associated with an individual inventory piece...
Interactive OpenSim region server
bool IsTerrainXfer(ulong xferID)
Returns whether the transfer ID is being used for a terrain transfer.
void HandleXfer(ulong xferID, uint packetID, byte[] data)
bool RequestCreateInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask)
Manage asset transactions for a single agent.