diff options
author | John Hurliman | 2010-04-22 18:56:06 -0700 |
---|---|---|
committer | John Hurliman | 2010-04-22 18:56:06 -0700 |
commit | 8692ac53f56c8db9942021709e7415b2b2add0c6 (patch) | |
tree | 5681611d23f8f89b38d2c19ef032d412fd3fe3d2 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | * Better error logging for failed SimianGrid web service calls (diff) | |
parent | Insert a ROLLBACK command on migration step failure. This ensures that (diff) | |
download | opensim-SC-8692ac53f56c8db9942021709e7415b2b2add0c6.zip opensim-SC-8692ac53f56c8db9942021709e7415b2b2add0c6.tar.gz opensim-SC-8692ac53f56c8db9942021709e7415b2b2add0c6.tar.bz2 opensim-SC-8692ac53f56c8db9942021709e7415b2b2add0c6.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 59 |
1 files changed, 12 insertions, 47 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 7c68ef4..15b5230 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -35,7 +35,6 @@ using OpenMetaverse; | |||
35 | using OpenMetaverse.Packets; | 35 | using OpenMetaverse.Packets; |
36 | using log4net; | 36 | using log4net; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | |||
39 | using OpenSim.Region.Framework; | 38 | using OpenSim.Region.Framework; |
40 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes.Serialization; | 40 | using OpenSim.Region.Framework.Scenes.Serialization; |
@@ -64,6 +63,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
64 | if (group is SceneObjectGroup) | 63 | if (group is SceneObjectGroup) |
65 | { | 64 | { |
66 | ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0); | 65 | ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0); |
66 | ((SceneObjectGroup) group).ResumeScripts(); | ||
67 | } | 67 | } |
68 | } | 68 | } |
69 | } | 69 | } |
@@ -202,7 +202,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
202 | 202 | ||
203 | // Update item with new asset | 203 | // Update item with new asset |
204 | item.AssetID = asset.FullID; | 204 | item.AssetID = asset.FullID; |
205 | group.UpdateInventoryItem(item); | 205 | if (group.UpdateInventoryItem(item)) |
206 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | ||
207 | |||
206 | part.GetProperties(remoteClient); | 208 | part.GetProperties(remoteClient); |
207 | 209 | ||
208 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) | 210 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) |
@@ -219,6 +221,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
219 | { | 221 | { |
220 | remoteClient.SendAgentAlertMessage("Script saved", false); | 222 | remoteClient.SendAgentAlertMessage("Script saved", false); |
221 | } | 223 | } |
224 | part.ParentGroup.ResumeScripts(); | ||
222 | return errors; | 225 | return errors; |
223 | } | 226 | } |
224 | 227 | ||
@@ -472,7 +475,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
472 | return null; | 475 | return null; |
473 | } | 476 | } |
474 | 477 | ||
475 | |||
476 | if (recipientParentFolderId == UUID.Zero) | 478 | if (recipientParentFolderId == UUID.Zero) |
477 | { | 479 | { |
478 | InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId); | 480 | InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId); |
@@ -1226,7 +1228,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1226 | remoteClient, part, transactionID, currentItem); | 1228 | remoteClient, part, transactionID, currentItem); |
1227 | } | 1229 | } |
1228 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | 1230 | if (part.Inventory.UpdateInventoryItem(itemInfo)) |
1231 | { | ||
1232 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | ||
1229 | part.GetProperties(remoteClient); | 1233 | part.GetProperties(remoteClient); |
1234 | } | ||
1230 | } | 1235 | } |
1231 | } | 1236 | } |
1232 | else | 1237 | else |
@@ -1278,6 +1283,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1278 | // "Rezzed script {0} into prim local ID {1} for user {2}", | 1283 | // "Rezzed script {0} into prim local ID {1} for user {2}", |
1279 | // item.inventoryName, localID, remoteClient.Name); | 1284 | // item.inventoryName, localID, remoteClient.Name); |
1280 | part.GetProperties(remoteClient); | 1285 | part.GetProperties(remoteClient); |
1286 | part.ParentGroup.ResumeScripts(); | ||
1281 | } | 1287 | } |
1282 | else | 1288 | else |
1283 | { | 1289 | { |
@@ -1347,6 +1353,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1347 | part.GetProperties(remoteClient); | 1353 | part.GetProperties(remoteClient); |
1348 | 1354 | ||
1349 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); | 1355 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); |
1356 | part.ParentGroup.ResumeScripts(); | ||
1350 | } | 1357 | } |
1351 | } | 1358 | } |
1352 | 1359 | ||
@@ -1450,6 +1457,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1450 | destPart.Inventory.CreateScriptInstance(destTaskItem, start_param, false, DefaultScriptEngine, 0); | 1457 | destPart.Inventory.CreateScriptInstance(destTaskItem, start_param, false, DefaultScriptEngine, 0); |
1451 | } | 1458 | } |
1452 | 1459 | ||
1460 | destPart.ParentGroup.ResumeScripts(); | ||
1461 | |||
1453 | ScenePresence avatar; | 1462 | ScenePresence avatar; |
1454 | 1463 | ||
1455 | if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar)) | 1464 | if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar)) |
@@ -1870,50 +1879,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1870 | EventManager.TriggerStopScript(part.LocalId, itemID); | 1879 | EventManager.TriggerStopScript(part.LocalId, itemID); |
1871 | } | 1880 | } |
1872 | 1881 | ||
1873 | internal void SendAttachEvent(uint localID, UUID itemID, UUID avatarID) | ||
1874 | { | ||
1875 | EventManager.TriggerOnAttach(localID, itemID, avatarID); | ||
1876 | } | ||
1877 | |||
1878 | public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, | ||
1879 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects) | ||
1880 | { | ||
1881 | foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects) | ||
1882 | { | ||
1883 | AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt); | ||
1884 | } | ||
1885 | } | ||
1886 | |||
1887 | public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient) | ||
1888 | { | ||
1889 | SceneObjectPart part = GetSceneObjectPart(itemID); | ||
1890 | if (part == null || part.ParentGroup == null) | ||
1891 | return; | ||
1892 | |||
1893 | UUID inventoryID = part.ParentGroup.GetFromItemID(); | ||
1894 | |||
1895 | ScenePresence presence; | ||
1896 | if (TryGetScenePresence(remoteClient.AgentId, out presence)) | ||
1897 | { | ||
1898 | if (!Permissions.CanRezObject(part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition)) | ||
1899 | return; | ||
1900 | |||
1901 | presence.Appearance.DetachAttachment(itemID); | ||
1902 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); | ||
1903 | if (ava != null) | ||
1904 | { | ||
1905 | ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | ||
1906 | } | ||
1907 | part.ParentGroup.DetachToGround(); | ||
1908 | |||
1909 | List<UUID> uuids = new List<UUID>(); | ||
1910 | uuids.Add(inventoryID); | ||
1911 | InventoryService.DeleteItems(remoteClient.AgentId, uuids); | ||
1912 | remoteClient.SendRemoveInventoryItem(inventoryID); | ||
1913 | } | ||
1914 | SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); | ||
1915 | } | ||
1916 | |||
1917 | public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | 1882 | public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) |
1918 | { | 1883 | { |
1919 | EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID); | 1884 | EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID); |