aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2014-05-05 16:09:51 +0300
committerOren Hurvitz2014-05-06 07:28:46 +0100
commit614b9e14c42d69bf8048218c889cc047756b0b5a (patch)
treec65dfeb957a25f6c328c740611f73167c65d94b6 /OpenSim
parentShow more meaningful error messages when failed to move an item from a prim t... (diff)
downloadopensim-SC_OLD-614b9e14c42d69bf8048218c889cc047756b0b5a.zip
opensim-SC_OLD-614b9e14c42d69bf8048218c889cc047756b0b5a.tar.gz
opensim-SC_OLD-614b9e14c42d69bf8048218c889cc047756b0b5a.tar.bz2
opensim-SC_OLD-614b9e14c42d69bf8048218c889cc047756b0b5a.tar.xz
When moving an item from a prim to a user's inventory, don't delete the item from the prim until it was successfully copied to the user
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs29
1 files changed, 25 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 4988868..91f1b63 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1196,6 +1196,10 @@ namespace OpenSim.Region.Framework.Scenes
1196 } 1196 }
1197 } 1197 }
1198 1198
1199
1200 /// <summary>
1201 /// Creates (in memory only) a user inventory item that will contain a copy of a task inventory item.
1202 /// </summary>
1199 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId, out string message) 1203 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId, out string message)
1200 { 1204 {
1201 TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId); 1205 TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId);
@@ -1259,11 +1263,24 @@ namespace OpenSim.Region.Framework.Scenes
1259 agentItem.GroupPermissions = taskItem.GroupPermissions; 1263 agentItem.GroupPermissions = taskItem.GroupPermissions;
1260 } 1264 }
1261 1265
1266 message = null;
1267 return agentItem;
1268 }
1269
1270 /// <summary>
1271 /// If the task item is not-copyable then remove it from the prim.
1272 /// </summary>
1273 private void RemoveNonCopyTaskItemFromPrim(SceneObjectPart part, UUID itemId)
1274 {
1275 TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId);
1276 if (taskItem == null)
1277 return;
1278
1262 if (!Permissions.BypassPermissions()) 1279 if (!Permissions.BypassPermissions())
1263 { 1280 {
1264 if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 1281 if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1265 { 1282 {
1266 if (taskItem.Type == 10) 1283 if (taskItem.Type == (int)AssetType.LSLText)
1267 { 1284 {
1268 part.RemoveScriptEvents(itemId); 1285 part.RemoveScriptEvents(itemId);
1269 EventManager.TriggerRemoveScript(part.LocalId, itemId); 1286 EventManager.TriggerRemoveScript(part.LocalId, itemId);
@@ -1272,9 +1289,6 @@ namespace OpenSim.Region.Framework.Scenes
1272 part.Inventory.RemoveInventoryItem(itemId); 1289 part.Inventory.RemoveInventoryItem(itemId);
1273 } 1290 }
1274 } 1291 }
1275
1276 message = null;
1277 return agentItem;
1278 } 1292 }
1279 1293
1280 /// <summary> 1294 /// <summary>
@@ -1296,6 +1310,9 @@ namespace OpenSim.Region.Framework.Scenes
1296 1310
1297 agentItem.Folder = folderId; 1311 agentItem.Folder = folderId;
1298 AddInventoryItem(remoteClient, agentItem); 1312 AddInventoryItem(remoteClient, agentItem);
1313
1314 RemoveNonCopyTaskItemFromPrim(part, itemId);
1315
1299 message = null; 1316 message = null;
1300 return agentItem; 1317 return agentItem;
1301 } 1318 }
@@ -1384,6 +1401,8 @@ namespace OpenSim.Region.Framework.Scenes
1384 1401
1385 AddInventoryItem(agentItem); 1402 AddInventoryItem(agentItem);
1386 1403
1404 RemoveNonCopyTaskItemFromPrim(part, itemId);
1405
1387 return agentItem; 1406 return agentItem;
1388 } 1407 }
1389 } 1408 }
@@ -1511,6 +1530,8 @@ namespace OpenSim.Region.Framework.Scenes
1511 agentItem.Folder = newFolderID; 1530 agentItem.Folder = newFolderID;
1512 1531
1513 AddInventoryItem(agentItem); 1532 AddInventoryItem(agentItem);
1533
1534 RemoveNonCopyTaskItemFromPrim(host, itemID);
1514 } 1535 }
1515 else 1536 else
1516 { 1537 {