diff options
author | Justin Clarke Casey | 2008-09-26 14:28:24 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-26 14:28:24 +0000 |
commit | 7ee1f3dff64144050cc0f0f5e9e89fe68ccc0ae0 (patch) | |
tree | aa4bd0710a0e892e40c3cb43c1a0f179a9283b31 /OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs | |
parent | And another file (diff) | |
download | opensim-SC_OLD-7ee1f3dff64144050cc0f0f5e9e89fe68ccc0ae0.zip opensim-SC_OLD-7ee1f3dff64144050cc0f0f5e9e89fe68ccc0ae0.tar.gz opensim-SC_OLD-7ee1f3dff64144050cc0f0f5e9e89fe68ccc0ae0.tar.bz2 opensim-SC_OLD-7ee1f3dff64144050cc0f0f5e9e89fe68ccc0ae0.tar.xz |
* Implment task inventory item asset update for the old non CAPS transaction system
* This means that saving notecards in prim inventories should now work.
* Not the nicest code in the world - the transactions system is pretty fugly right now
* PLEASE NOTE: Currently, the prim will not repersist until up to 15 seconds after it is unselected.
* What we really need is a proper mechanism so that any prim updates still waiting when the simulator is quit are performed before exit.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs index e6e27be..56ca1a1 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -61,11 +61,16 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
61 | wearableType, nextOwnerMask); | 61 | wearableType, nextOwnerMask); |
62 | } | 62 | } |
63 | 63 | ||
64 | public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, | 64 | public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item) |
65 | InventoryItemBase item) | ||
66 | { | 65 | { |
67 | m_transactionManager.HandleItemUpdateFromTransaction(remoteClient, transactionID, item); | 66 | m_transactionManager.HandleItemUpdateFromTransaction(remoteClient, transactionID, item); |
68 | } | 67 | } |
68 | |||
69 | public void HandleTaskItemUpdateFromTransaction( | ||
70 | IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item) | ||
71 | { | ||
72 | m_transactionManager.HandleTaskItemUpdateFromTransaction(remoteClient, part, transactionID, item); | ||
73 | } | ||
69 | 74 | ||
70 | public void RemoveAgentAssetTransactions(UUID userID) | 75 | public void RemoveAgentAssetTransactions(UUID userID) |
71 | { | 76 | { |
@@ -141,8 +146,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
141 | private static readonly ILog m_log | 146 | private static readonly ILog m_log |
142 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 147 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
143 | 148 | ||
144 | // Fields | ||
145 | |||
146 | /// <summary> | 149 | /// <summary> |
147 | /// Each agent has its own singleton collection of transactions | 150 | /// Each agent has its own singleton collection of transactions |
148 | /// </summary> | 151 | /// </summary> |
@@ -218,8 +221,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
218 | uint callbackID, string description, string name, sbyte invType, | 221 | uint callbackID, string description, string name, sbyte invType, |
219 | sbyte type, byte wearableType, uint nextOwnerMask) | 222 | sbyte type, byte wearableType, uint nextOwnerMask) |
220 | { | 223 | { |
221 | m_log.DebugFormat( | 224 | // m_log.DebugFormat( |
222 | "[TRANSACTIONS MANAGER] Called HandleItemCreationFromTransaction with item {0}", name); | 225 | // "[TRANSACTIONS MANAGER] Called HandleItemCreationFromTransaction with item {0}", name); |
223 | 226 | ||
224 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); | 227 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); |
225 | 228 | ||
@@ -240,15 +243,36 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
240 | public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, | 243 | public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, |
241 | InventoryItemBase item) | 244 | InventoryItemBase item) |
242 | { | 245 | { |
243 | m_log.DebugFormat( | 246 | // m_log.DebugFormat( |
244 | "[TRANSACTIONS MANAGER] Called HandleItemUpdateFromTransaction with item {0}", | 247 | // "[TRANSACTIONS MANAGER] Called HandleItemUpdateFromTransaction with item {0}", |
245 | item.Name); | 248 | // item.Name); |
246 | 249 | ||
247 | AgentAssetTransactions transactions | 250 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); |
248 | = GetUserTransactions(remoteClient.AgentId); | ||
249 | 251 | ||
250 | transactions.RequestUpdateInventoryItem(remoteClient, transactionID, item); | 252 | transactions.RequestUpdateInventoryItem(remoteClient, transactionID, item); |
251 | } | 253 | } |
254 | |||
255 | /// <summary> | ||
256 | /// Update a task inventory item with data that has been received through a transaction. | ||
257 | /// | ||
258 | /// This is currently called when, for instance, a notecard in a prim is saved. The data is sent | ||
259 | /// up through a single AssetUploadRequest. A subsequent UpdateTaskInventory then references the transaction | ||
260 | /// and comes through this method. | ||
261 | /// </summary> | ||
262 | /// <param name="remoteClient"></param> | ||
263 | /// <param name="transactionID"></param> | ||
264 | /// <param name="item"></param> | ||
265 | public void HandleTaskItemUpdateFromTransaction( | ||
266 | IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item) | ||
267 | { | ||
268 | // m_log.DebugFormat( | ||
269 | // "[TRANSACTIONS MANAGER] Called HandleTaskItemUpdateFromTransaction with item {0}", | ||
270 | // item.Name); | ||
271 | |||
272 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); | ||
273 | |||
274 | transactions.RequestUpdateTaskInventoryItem(remoteClient, part, transactionID, item); | ||
275 | } | ||
252 | 276 | ||
253 | /// <summary> | 277 | /// <summary> |
254 | /// Request that a client (agent) begin an asset transfer. | 278 | /// Request that a client (agent) begin an asset transfer. |
@@ -270,6 +294,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
270 | { | 294 | { |
271 | Scene scene = (Scene)remoteClient.Scene; | 295 | Scene scene = (Scene)remoteClient.Scene; |
272 | IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); | 296 | IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); |
297 | |||
273 | if (mm != null) | 298 | if (mm != null) |
274 | { | 299 | { |
275 | if (!mm.UploadCovered(remoteClient)) | 300 | if (!mm.UploadCovered(remoteClient)) |
@@ -280,15 +305,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
280 | } | 305 | } |
281 | } | 306 | } |
282 | 307 | ||
283 | // Console.WriteLine("asset upload of " + assetID); | 308 | //Console.WriteLine("asset upload of " + assetID); |
284 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); | 309 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); |
285 | 310 | ||
286 | AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); | 311 | AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); |
287 | if (uploader != null) | 312 | if (uploader != null) |
288 | { | 313 | { |
289 | if (uploader.Initialise(remoteClient, assetID, transaction, type, data, storeLocal, tempFile)) | 314 | uploader.Initialise(remoteClient, assetID, transaction, type, data, storeLocal, tempFile); |
290 | { | ||
291 | } | ||
292 | } | 315 | } |
293 | } | 316 | } |
294 | 317 | ||