diff options
Diffstat (limited to 'OpenSim/Region/Framework')
5 files changed, 109 insertions, 42 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs index 600ecfe..461c880 100644 --- a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | using OpenSim.Framework; | ||
29 | using OpenSim.Services.Interfaces; | 30 | using OpenSim.Services.Interfaces; |
30 | 31 | ||
31 | namespace OpenSim.Region.Framework.Interfaces | 32 | namespace OpenSim.Region.Framework.Interfaces |
@@ -44,6 +45,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
44 | 45 | ||
45 | string SetEstateOwner(int estateID, UserAccount account); | 46 | string SetEstateOwner(int estateID, UserAccount account); |
46 | string SetEstateName(int estateID, string newName); | 47 | string SetEstateName(int estateID, string newName); |
48 | string SetRegionEstate(RegionInfo regionInfo, int estateID); | ||
49 | string CreateEstate(string estateName, UUID ownerID); | ||
47 | 50 | ||
48 | /// <summary> | 51 | /// <summary> |
49 | /// Tell all clients about the current state of the region (terrain textures, water height, etc.). | 52 | /// Tell all clients about the current state of the region (terrain textures, water height, etc.). |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 64da5f6..3c3d077 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
46 | { | 46 | { |
47 | public partial class Scene | 47 | public partial class Scene |
48 | { | 48 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | private static readonly string LogHeader = "[SCENE INVENTORY]"; | 50 | private static readonly string LogHeader = "[SCENE INVENTORY]"; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
@@ -541,9 +541,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
541 | /// <param name="recipientClient"></param> | 541 | /// <param name="recipientClient"></param> |
542 | /// <param name="senderId">ID of the sender of the item</param> | 542 | /// <param name="senderId">ID of the sender of the item</param> |
543 | /// <param name="itemId"></param> | 543 | /// <param name="itemId"></param> |
544 | public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) | 544 | public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId, out string message) |
545 | { | 545 | { |
546 | InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId); | 546 | InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId, out message); |
547 | 547 | ||
548 | if (itemCopy != null) | 548 | if (itemCopy != null) |
549 | recipientClient.SendBulkUpdateInventory(itemCopy); | 549 | recipientClient.SendBulkUpdateInventory(itemCopy); |
@@ -556,9 +556,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
556 | /// <param name="senderId">ID of the sender of the item</param> | 556 | /// <param name="senderId">ID of the sender of the item</param> |
557 | /// <param name="itemId"></param> | 557 | /// <param name="itemId"></param> |
558 | /// <returns>The inventory item copy given, null if the give was unsuccessful</returns> | 558 | /// <returns>The inventory item copy given, null if the give was unsuccessful</returns> |
559 | public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId) | 559 | public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId, out string message) |
560 | { | 560 | { |
561 | return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); | 561 | return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero, out message); |
562 | } | 562 | } |
563 | 563 | ||
564 | /// <summary> | 564 | /// <summary> |
@@ -575,12 +575,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
575 | /// The inventory item copy given, null if the give was unsuccessful | 575 | /// The inventory item copy given, null if the give was unsuccessful |
576 | /// </returns> | 576 | /// </returns> |
577 | public virtual InventoryItemBase GiveInventoryItem( | 577 | public virtual InventoryItemBase GiveInventoryItem( |
578 | UUID recipient, UUID senderId, UUID itemId, UUID recipientFolderId) | 578 | UUID recipient, UUID senderId, UUID itemId, UUID recipientFolderId, out string message) |
579 | { | 579 | { |
580 | //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); | 580 | //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); |
581 | 581 | ||
582 | if (!Permissions.CanTransferUserInventory(itemId, senderId, recipient)) | 582 | if (!Permissions.CanTransferUserInventory(itemId, senderId, recipient)) |
583 | { | ||
584 | message = "Not allowed to transfer this item."; | ||
583 | return null; | 585 | return null; |
586 | } | ||
584 | 587 | ||
585 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); | 588 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); |
586 | item = InventoryService.GetItem(item); | 589 | item = InventoryService.GetItem(item); |
@@ -589,6 +592,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
589 | { | 592 | { |
590 | m_log.WarnFormat( | 593 | m_log.WarnFormat( |
591 | "[AGENT INVENTORY]: Failed to find item {0} sent by {1} to {2}", itemId, senderId, recipient); | 594 | "[AGENT INVENTORY]: Failed to find item {0} sent by {1} to {2}", itemId, senderId, recipient); |
595 | message = string.Format("Item not found: {0}.", itemId); | ||
592 | return null; | 596 | return null; |
593 | } | 597 | } |
594 | 598 | ||
@@ -597,6 +601,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
597 | m_log.WarnFormat( | 601 | m_log.WarnFormat( |
598 | "[AGENT INVENTORY]: Attempt to send item {0} {1} to {2} failed because sender {3} did not match item owner {4}", | 602 | "[AGENT INVENTORY]: Attempt to send item {0} {1} to {2} failed because sender {3} did not match item owner {4}", |
599 | item.Name, item.ID, recipient, senderId, item.Owner); | 603 | item.Name, item.ID, recipient, senderId, item.Owner); |
604 | message = "Sender did not match item owner."; | ||
600 | return null; | 605 | return null; |
601 | } | 606 | } |
602 | 607 | ||
@@ -607,7 +612,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
607 | if (!Permissions.BypassPermissions()) | 612 | if (!Permissions.BypassPermissions()) |
608 | { | 613 | { |
609 | if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) | 614 | if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) |
615 | { | ||
616 | message = "Item doesn't have the Transfer permission."; | ||
610 | return null; | 617 | return null; |
618 | } | ||
611 | } | 619 | } |
612 | 620 | ||
613 | // Insert a copy of the item into the recipient | 621 | // Insert a copy of the item into the recipient |
@@ -743,9 +751,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
743 | InventoryFolderBase root = InventoryService.GetRootFolder(recipient); | 751 | InventoryFolderBase root = InventoryService.GetRootFolder(recipient); |
744 | 752 | ||
745 | if (root != null) | 753 | if (root != null) |
754 | { | ||
746 | itemCopy.Folder = root.ID; | 755 | itemCopy.Folder = root.ID; |
756 | } | ||
747 | else | 757 | else |
748 | return null; // No destination | 758 | { |
759 | message = "Can't find a folder to add the item to."; | ||
760 | return null; | ||
761 | } | ||
749 | } | 762 | } |
750 | } | 763 | } |
751 | 764 | ||
@@ -770,6 +783,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
770 | } | 783 | } |
771 | } | 784 | } |
772 | 785 | ||
786 | message = null; | ||
773 | return itemCopy; | 787 | return itemCopy; |
774 | } | 788 | } |
775 | 789 | ||
@@ -787,7 +801,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
787 | /// <returns> | 801 | /// <returns> |
788 | /// The inventory folder copy given, null if the copy was unsuccessful | 802 | /// The inventory folder copy given, null if the copy was unsuccessful |
789 | /// </returns> | 803 | /// </returns> |
790 | public virtual InventoryFolderBase GiveInventoryFolder( | 804 | public virtual InventoryFolderBase GiveInventoryFolder(IClientAPI client, |
791 | UUID recipientId, UUID senderId, UUID folderId, UUID recipientParentFolderId) | 805 | UUID recipientId, UUID senderId, UUID folderId, UUID recipientParentFolderId) |
792 | { | 806 | { |
793 | //// Retrieve the folder from the sender | 807 | //// Retrieve the folder from the sender |
@@ -822,13 +836,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
822 | InventoryCollection contents = InventoryService.GetFolderContent(senderId, folderId); | 836 | InventoryCollection contents = InventoryService.GetFolderContent(senderId, folderId); |
823 | foreach (InventoryFolderBase childFolder in contents.Folders) | 837 | foreach (InventoryFolderBase childFolder in contents.Folders) |
824 | { | 838 | { |
825 | GiveInventoryFolder(recipientId, senderId, childFolder.ID, newFolder.ID); | 839 | GiveInventoryFolder(client, recipientId, senderId, childFolder.ID, newFolder.ID); |
826 | } | 840 | } |
827 | 841 | ||
828 | // Give all the items | 842 | // Give all the items |
829 | foreach (InventoryItemBase item in contents.Items) | 843 | foreach (InventoryItemBase item in contents.Items) |
830 | { | 844 | { |
831 | GiveInventoryItem(recipientId, senderId, item.ID, newFolder.ID); | 845 | string message; |
846 | if (GiveInventoryItem(recipientId, senderId, item.ID, newFolder.ID, out message) == null) | ||
847 | { | ||
848 | if (client != null) | ||
849 | client.SendAgentAlertMessage(message, false); | ||
850 | } | ||
832 | } | 851 | } |
833 | 852 | ||
834 | return newFolder; | 853 | return newFolder; |
@@ -1155,11 +1174,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1155 | 1174 | ||
1156 | InventoryFolderBase destFolder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder); | 1175 | InventoryFolderBase destFolder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder); |
1157 | 1176 | ||
1158 | // Move the item to trash. If this is a copiable item, only | 1177 | // Move the item to trash. If this is a copyable item, only |
1159 | // a copy will be moved and we will still need to delete | 1178 | // a copy will be moved and we will still need to delete |
1160 | // the item from the prim. If it was no copy, is will be | 1179 | // the item from the prim. If it was no copy, it will be |
1161 | // deleted by this method. | 1180 | // deleted by this method. |
1162 | MoveTaskInventoryItem(remoteClient, destFolder.ID, part, itemID); | 1181 | string message; |
1182 | InventoryItemBase item2 = MoveTaskInventoryItem(remoteClient, destFolder.ID, part, itemID, out message); | ||
1183 | |||
1184 | if (item2 == null) | ||
1185 | { | ||
1186 | m_log.WarnFormat("[SCENE INVENTORY]: RemoveTaskInventory of item {0} failed: {1}", itemID, message); | ||
1187 | remoteClient.SendAgentAlertMessage(message, false); | ||
1188 | return; | ||
1189 | } | ||
1163 | 1190 | ||
1164 | if (group.GetInventoryItem(localID, itemID) != null) | 1191 | if (group.GetInventoryItem(localID, itemID) != null) |
1165 | { | 1192 | { |
@@ -1171,11 +1198,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1171 | 1198 | ||
1172 | group.RemoveInventoryItem(localID, itemID); | 1199 | group.RemoveInventoryItem(localID, itemID); |
1173 | } | 1200 | } |
1201 | |||
1174 | part.SendPropertiesToClient(remoteClient); | 1202 | part.SendPropertiesToClient(remoteClient); |
1175 | } | 1203 | } |
1176 | } | 1204 | } |
1177 | 1205 | ||
1178 | private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId) | 1206 | |
1207 | /// <summary> | ||
1208 | /// Creates (in memory only) a user inventory item that will contain a copy of a task inventory item. | ||
1209 | /// </summary> | ||
1210 | private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId, out string message) | ||
1179 | { | 1211 | { |
1180 | TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId); | 1212 | TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId); |
1181 | 1213 | ||
@@ -1186,12 +1218,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1186 | + " inventory item from a prim's inventory item " | 1218 | + " inventory item from a prim's inventory item " |
1187 | + " but the required item does not exist in the prim's inventory", | 1219 | + " but the required item does not exist in the prim's inventory", |
1188 | itemId, part.Name, part.UUID); | 1220 | itemId, part.Name, part.UUID); |
1189 | 1221 | message = "Item not found: " + itemId; | |
1190 | return null; | 1222 | return null; |
1191 | } | 1223 | } |
1192 | 1224 | ||
1193 | if ((destAgent != taskItem.OwnerID) && ((taskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)) | 1225 | if ((destAgent != taskItem.OwnerID) && ((taskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)) |
1194 | { | 1226 | { |
1227 | message = "Item doesn't have the Transfer permission."; | ||
1195 | return null; | 1228 | return null; |
1196 | } | 1229 | } |
1197 | 1230 | ||
@@ -1237,11 +1270,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1237 | agentItem.GroupPermissions = taskItem.GroupPermissions; | 1270 | agentItem.GroupPermissions = taskItem.GroupPermissions; |
1238 | } | 1271 | } |
1239 | 1272 | ||
1273 | message = null; | ||
1274 | return agentItem; | ||
1275 | } | ||
1276 | |||
1277 | /// <summary> | ||
1278 | /// If the task item is not-copyable then remove it from the prim. | ||
1279 | /// </summary> | ||
1280 | private void RemoveNonCopyTaskItemFromPrim(SceneObjectPart part, UUID itemId) | ||
1281 | { | ||
1282 | TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId); | ||
1283 | if (taskItem == null) | ||
1284 | return; | ||
1285 | |||
1240 | if (!Permissions.BypassPermissions()) | 1286 | if (!Permissions.BypassPermissions()) |
1241 | { | 1287 | { |
1242 | if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1288 | if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1243 | { | 1289 | { |
1244 | if (taskItem.Type == 10) | 1290 | if (taskItem.Type == (int)AssetType.LSLText) |
1245 | { | 1291 | { |
1246 | part.RemoveScriptEvents(itemId); | 1292 | part.RemoveScriptEvents(itemId); |
1247 | EventManager.TriggerRemoveScript(part.LocalId, itemId); | 1293 | EventManager.TriggerRemoveScript(part.LocalId, itemId); |
@@ -1250,8 +1296,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1250 | part.Inventory.RemoveInventoryItem(itemId); | 1296 | part.Inventory.RemoveInventoryItem(itemId); |
1251 | } | 1297 | } |
1252 | } | 1298 | } |
1253 | |||
1254 | return agentItem; | ||
1255 | } | 1299 | } |
1256 | 1300 | ||
1257 | /// <summary> | 1301 | /// <summary> |
@@ -1261,19 +1305,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
1261 | /// <param name="folderID"></param> | 1305 | /// <param name="folderID"></param> |
1262 | /// <param name="part"></param> | 1306 | /// <param name="part"></param> |
1263 | /// <param name="itemID"></param> | 1307 | /// <param name="itemID"></param> |
1264 | public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId) | 1308 | public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId, out string message) |
1265 | { | 1309 | { |
1266 | m_log.DebugFormat( | 1310 | m_log.DebugFormat( |
1267 | "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}", | 1311 | "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}", |
1268 | itemId, part.Name, folderId, remoteClient.Name); | 1312 | itemId, part.Name, folderId, remoteClient.Name); |
1269 | 1313 | ||
1270 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId); | 1314 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId, out message); |
1271 | |||
1272 | if (agentItem == null) | 1315 | if (agentItem == null) |
1273 | return null; | 1316 | return null; |
1274 | 1317 | ||
1275 | agentItem.Folder = folderId; | 1318 | agentItem.Folder = folderId; |
1276 | AddInventoryItem(remoteClient, agentItem); | 1319 | AddInventoryItem(remoteClient, agentItem); |
1320 | |||
1321 | RemoveNonCopyTaskItemFromPrim(part, itemId); | ||
1322 | |||
1323 | message = null; | ||
1277 | return agentItem; | 1324 | return agentItem; |
1278 | } | 1325 | } |
1279 | 1326 | ||
@@ -1324,7 +1371,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1324 | return; | 1371 | return; |
1325 | } | 1372 | } |
1326 | 1373 | ||
1327 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 1374 | string message; |
1375 | InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message); | ||
1376 | |||
1377 | if (item == null) | ||
1378 | remoteClient.SendAgentAlertMessage(message, false); | ||
1328 | } | 1379 | } |
1329 | 1380 | ||
1330 | /// <summary> | 1381 | /// <summary> |
@@ -1338,17 +1389,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1338 | /// </param> | 1389 | /// </param> |
1339 | /// <param name="part"></param> | 1390 | /// <param name="part"></param> |
1340 | /// <param name="itemID"></param> | 1391 | /// <param name="itemID"></param> |
1341 | public InventoryItemBase MoveTaskInventoryItem(UUID avatarId, UUID folderId, SceneObjectPart part, UUID itemId) | 1392 | public InventoryItemBase MoveTaskInventoryItem(UUID avatarId, UUID folderId, SceneObjectPart part, UUID itemId, out string message) |
1342 | { | 1393 | { |
1343 | ScenePresence avatar; | 1394 | ScenePresence avatar; |
1344 | 1395 | ||
1345 | if (TryGetScenePresence(avatarId, out avatar)) | 1396 | if (TryGetScenePresence(avatarId, out avatar)) |
1346 | { | 1397 | { |
1347 | return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId); | 1398 | return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId, out message); |
1348 | } | 1399 | } |
1349 | else | 1400 | else |
1350 | { | 1401 | { |
1351 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId); | 1402 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId, out message); |
1352 | 1403 | ||
1353 | if (agentItem == null) | 1404 | if (agentItem == null) |
1354 | return null; | 1405 | return null; |
@@ -1357,6 +1408,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1357 | 1408 | ||
1358 | AddInventoryItem(agentItem); | 1409 | AddInventoryItem(agentItem); |
1359 | 1410 | ||
1411 | RemoveNonCopyTaskItemFromPrim(part, itemId); | ||
1412 | |||
1360 | return agentItem; | 1413 | return agentItem; |
1361 | } | 1414 | } |
1362 | } | 1415 | } |
@@ -1462,6 +1515,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1462 | 1515 | ||
1463 | public UUID MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List<UUID> items) | 1516 | public UUID MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List<UUID> items) |
1464 | { | 1517 | { |
1518 | ScenePresence avatar; | ||
1519 | IClientAPI remoteClient = null; | ||
1520 | if (TryGetScenePresence(destID, out avatar)) | ||
1521 | remoteClient = avatar.ControllingClient; | ||
1522 | |||
1465 | InventoryFolderBase rootFolder = InventoryService.GetRootFolder(destID); | 1523 | InventoryFolderBase rootFolder = InventoryService.GetRootFolder(destID); |
1466 | 1524 | ||
1467 | UUID newFolderID = UUID.Random(); | 1525 | UUID newFolderID = UUID.Random(); |
@@ -1471,26 +1529,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
1471 | 1529 | ||
1472 | foreach (UUID itemID in items) | 1530 | foreach (UUID itemID in items) |
1473 | { | 1531 | { |
1474 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(destID, host, itemID); | 1532 | string message; |
1533 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(destID, host, itemID, out message); | ||
1475 | 1534 | ||
1476 | if (agentItem != null) | 1535 | if (agentItem != null) |
1477 | { | 1536 | { |
1478 | agentItem.Folder = newFolderID; | 1537 | agentItem.Folder = newFolderID; |
1479 | 1538 | ||
1480 | AddInventoryItem(agentItem); | 1539 | AddInventoryItem(agentItem); |
1540 | |||
1541 | RemoveNonCopyTaskItemFromPrim(host, itemID); | ||
1542 | } | ||
1543 | else | ||
1544 | { | ||
1545 | if (remoteClient != null) | ||
1546 | remoteClient.SendAgentAlertMessage(message, false); | ||
1481 | } | 1547 | } |
1482 | } | 1548 | } |
1483 | 1549 | ||
1484 | ScenePresence avatar = null; | 1550 | if (remoteClient != null) |
1485 | if (TryGetScenePresence(destID, out avatar)) | ||
1486 | { | 1551 | { |
1487 | //profile.SendInventoryDecendents(avatar.ControllingClient, | 1552 | SendInventoryUpdate(remoteClient, rootFolder, true, false); |
1488 | // profile.RootFolder.ID, true, false); | 1553 | SendInventoryUpdate(remoteClient, newFolder, false, true); |
1489 | //profile.SendInventoryDecendents(avatar.ControllingClient, | ||
1490 | // newFolderID, false, true); | ||
1491 | |||
1492 | SendInventoryUpdate(avatar.ControllingClient, rootFolder, true, false); | ||
1493 | SendInventoryUpdate(avatar.ControllingClient, newFolder, false, true); | ||
1494 | } | 1554 | } |
1495 | 1555 | ||
1496 | return newFolderID; | 1556 | return newFolderID; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 0356599..3b1c5d8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1421,7 +1421,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1421 | 1421 | ||
1422 | Scene.ForEachScenePresence(sp => | 1422 | Scene.ForEachScenePresence(sp => |
1423 | { | 1423 | { |
1424 | if (!sp.IsChildAgent && sp.ParentID == LocalId) | 1424 | if (!sp.IsChildAgent && sp.ParentID == part.LocalId) |
1425 | sp.StandUp(); | 1425 | sp.StandUp(); |
1426 | 1426 | ||
1427 | if (!silent) | 1427 | if (!silent) |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 6e0ea7d..f809267 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -136,7 +136,8 @@ namespace OpenSim.Region.Framework.Tests | |||
136 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; | 136 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; |
137 | 137 | ||
138 | // Perform test | 138 | // Perform test |
139 | scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID); | 139 | string message; |
140 | scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID, out message); | ||
140 | 141 | ||
141 | InventoryItemBase ncUserItem | 142 | InventoryItemBase ncUserItem |
142 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem"); | 143 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem"); |
@@ -165,7 +166,8 @@ namespace OpenSim.Region.Framework.Tests | |||
165 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); | 166 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
166 | 167 | ||
167 | // Perform test | 168 | // Perform test |
168 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); | 169 | string message; |
170 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID, out message); | ||
169 | 171 | ||
170 | InventoryItemBase ncUserItem | 172 | InventoryItemBase ncUserItem |
171 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Notecards/ncItem"); | 173 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Notecards/ncItem"); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs index e50b4da..0736278 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs | |||
@@ -95,7 +95,9 @@ namespace OpenSim.Region.Framework.Tests | |||
95 | UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); | 95 | UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); |
96 | InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID); | 96 | InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID); |
97 | 97 | ||
98 | scene.GiveInventoryItem(user2.PrincipalID, user1.PrincipalID, item1.ID); | 98 | string message; |
99 | |||
100 | scene.GiveInventoryItem(user2.PrincipalID, user1.PrincipalID, item1.ID, out message); | ||
99 | 101 | ||
100 | InventoryItemBase retrievedItem1 | 102 | InventoryItemBase retrievedItem1 |
101 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, user2.PrincipalID, "Notecards/item1"); | 103 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, user2.PrincipalID, "Notecards/item1"); |
@@ -103,7 +105,7 @@ namespace OpenSim.Region.Framework.Tests | |||
103 | Assert.That(retrievedItem1, Is.Not.Null); | 105 | Assert.That(retrievedItem1, Is.Not.Null); |
104 | 106 | ||
105 | // Try giving back the freshly received item | 107 | // Try giving back the freshly received item |
106 | scene.GiveInventoryItem(user1.PrincipalID, user2.PrincipalID, retrievedItem1.ID); | 108 | scene.GiveInventoryItem(user1.PrincipalID, user2.PrincipalID, retrievedItem1.ID, out message); |
107 | 109 | ||
108 | List<InventoryItemBase> reretrievedItems | 110 | List<InventoryItemBase> reretrievedItems |
109 | = UserInventoryHelpers.GetInventoryItems(scene.InventoryService, user1.PrincipalID, "Notecards/item1"); | 111 | = UserInventoryHelpers.GetInventoryItems(scene.InventoryService, user1.PrincipalID, "Notecards/item1"); |
@@ -123,7 +125,7 @@ namespace OpenSim.Region.Framework.Tests | |||
123 | InventoryFolderBase folder1 | 125 | InventoryFolderBase folder1 |
124 | = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, "folder1", false); | 126 | = UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, "folder1", false); |
125 | 127 | ||
126 | scene.GiveInventoryFolder(user2.PrincipalID, user1.PrincipalID, folder1.ID, UUID.Zero); | 128 | scene.GiveInventoryFolder(null, user2.PrincipalID, user1.PrincipalID, folder1.ID, UUID.Zero); |
127 | 129 | ||
128 | InventoryFolderBase retrievedFolder1 | 130 | InventoryFolderBase retrievedFolder1 |
129 | = UserInventoryHelpers.GetInventoryFolder(scene.InventoryService, user2.PrincipalID, "folder1"); | 131 | = UserInventoryHelpers.GetInventoryFolder(scene.InventoryService, user2.PrincipalID, "folder1"); |
@@ -131,7 +133,7 @@ namespace OpenSim.Region.Framework.Tests | |||
131 | Assert.That(retrievedFolder1, Is.Not.Null); | 133 | Assert.That(retrievedFolder1, Is.Not.Null); |
132 | 134 | ||
133 | // Try giving back the freshly received folder | 135 | // Try giving back the freshly received folder |
134 | scene.GiveInventoryFolder(user1.PrincipalID, user2.PrincipalID, retrievedFolder1.ID, UUID.Zero); | 136 | scene.GiveInventoryFolder(null, user1.PrincipalID, user2.PrincipalID, retrievedFolder1.ID, UUID.Zero); |
135 | 137 | ||
136 | List<InventoryFolderBase> reretrievedFolders | 138 | List<InventoryFolderBase> reretrievedFolders |
137 | = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, "folder1"); | 139 | = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, "folder1"); |