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 | |
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_OLD-8692ac53f56c8db9942021709e7415b2b2add0c6.zip opensim-SC_OLD-8692ac53f56c8db9942021709e7415b2b2add0c6.tar.gz opensim-SC_OLD-8692ac53f56c8db9942021709e7415b2b2add0c6.tar.bz2 opensim-SC_OLD-8692ac53f56c8db9942021709e7415b2b2add0c6.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework')
10 files changed, 127 insertions, 101 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 0222b02..f8af367 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenMetaverse.Packets; | ||
30 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
31 | using OpenSim.Region.Framework.Scenes; | 32 | using OpenSim.Region.Framework.Scenes; |
32 | 33 | ||
@@ -82,6 +83,34 @@ namespace OpenSim.Region.Framework.Interfaces | |||
82 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus); | 83 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus); |
83 | 84 | ||
84 | /// <summary> | 85 | /// <summary> |
86 | /// Rez multiple attachments from a user's inventory | ||
87 | /// </summary> | ||
88 | /// <param name="remoteClient"></param> | ||
89 | /// <param name="header"></param> | ||
90 | /// <param name="objects"></param> | ||
91 | void RezMultipleAttachmentsFromInventory( | ||
92 | IClientAPI remoteClient, | ||
93 | RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, | ||
94 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects); | ||
95 | |||
96 | /// <summary> | ||
97 | /// Detach an object from the avatar. | ||
98 | /// </summary> | ||
99 | /// | ||
100 | /// This method is called in response to a client's detach request, so we only update the information in | ||
101 | /// inventory | ||
102 | /// <param name="objectLocalID"></param> | ||
103 | /// <param name="remoteClient"></param> | ||
104 | void DetachObject(uint objectLocalID, IClientAPI remoteClient); | ||
105 | |||
106 | /// <summary> | ||
107 | /// Detach the given item to the ground. | ||
108 | /// </summary> | ||
109 | /// <param name="itemID"></param> | ||
110 | /// <param name="remoteClient"></param> | ||
111 | void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient); | ||
112 | |||
113 | /// <summary> | ||
85 | /// Update the user inventory to the attachment of an item | 114 | /// Update the user inventory to the attachment of an item |
86 | /// </summary> | 115 | /// </summary> |
87 | /// <param name="att"></param> | 116 | /// <param name="att"></param> |
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index f58904f..2b90960 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -74,6 +74,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
74 | void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); | 74 | void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); |
75 | 75 | ||
76 | ArrayList GetScriptErrors(UUID itemID); | 76 | ArrayList GetScriptErrors(UUID itemID); |
77 | void ResumeScripts(); | ||
77 | 78 | ||
78 | /// <summary> | 79 | /// <summary> |
79 | /// Stop all the scripts in this entity. | 80 | /// Stop all the scripts in this entity. |
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs index 991d60c..89e59d0 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs | |||
@@ -90,8 +90,12 @@ namespace OpenSim.Region.Framework.Interfaces | |||
90 | /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region | 90 | /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region |
91 | /// settings in the archive will be ignored. | 91 | /// settings in the archive will be ignored. |
92 | /// </param> | 92 | /// </param> |
93 | /// <param name="skipAssets"> | ||
94 | /// If true, the archive is loaded without loading any assets contained within it. This is useful if the | ||
95 | /// assets are already known to be present in the grid's asset service. | ||
96 | /// </param> | ||
93 | /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> | 97 | /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> |
94 | void DearchiveRegion(string loadPath, bool merge, Guid requestId); | 98 | void DearchiveRegion(string loadPath, bool merge, bool skipAssets, Guid requestId); |
95 | 99 | ||
96 | /// <summary> | 100 | /// <summary> |
97 | /// Dearchive a region from a stream. This replaces the existing scene. | 101 | /// Dearchive a region from a stream. This replaces the existing scene. |
@@ -113,7 +117,11 @@ namespace OpenSim.Region.Framework.Interfaces | |||
113 | /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region | 117 | /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region |
114 | /// settings in the archive will be ignored. | 118 | /// settings in the archive will be ignored. |
115 | /// </param> | 119 | /// </param> |
120 | /// <param name="skipAssets"> | ||
121 | /// If true, the archive is loaded without loading any assets contained within it. This is useful if the | ||
122 | /// assets are already known to be present in the grid's asset service. | ||
123 | /// </param | ||
116 | /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> | 124 | /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> |
117 | void DearchiveRegion(Stream loadStream, bool merge, Guid requestId); | 125 | void DearchiveRegion(Stream loadStream, bool merge, bool skipAssets, Guid requestId); |
118 | } | 126 | } |
119 | } | 127 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index e90b300..fecdd1b 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -41,6 +41,14 @@ namespace OpenSim.Region.Framework.Interfaces | |||
41 | bool PostScriptEvent(UUID itemID, string name, Object[] args); | 41 | bool PostScriptEvent(UUID itemID, string name, Object[] args); |
42 | bool PostObjectEvent(UUID itemID, string name, Object[] args); | 42 | bool PostObjectEvent(UUID itemID, string name, Object[] args); |
43 | 43 | ||
44 | // Suspend ALL scripts in a given scene object. The item ID | ||
45 | // is the UUID of a SOG, and the method acts on all contained | ||
46 | // scripts. This is different from the suspend/resume that | ||
47 | // can be issued by a client. | ||
48 | // | ||
49 | void SuspendScript(UUID itemID); | ||
50 | void ResumeScript(UUID itemID); | ||
51 | |||
44 | ArrayList GetScriptErrors(UUID itemID); | 52 | ArrayList GetScriptErrors(UUID itemID); |
45 | } | 53 | } |
46 | } | 54 | } |
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); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 685a678..57587be 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1131,7 +1131,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1131 | { | 1131 | { |
1132 | if (m_scripts_enabled != !ScriptEngine) | 1132 | if (m_scripts_enabled != !ScriptEngine) |
1133 | { | 1133 | { |
1134 | // Tedd! Here's the method to disable the scripting engine! | ||
1135 | if (ScriptEngine) | 1134 | if (ScriptEngine) |
1136 | { | 1135 | { |
1137 | m_log.Info("Stopping all Scripts in Scene"); | 1136 | m_log.Info("Stopping all Scripts in Scene"); |
@@ -1153,6 +1152,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1153 | if (ent is SceneObjectGroup) | 1152 | if (ent is SceneObjectGroup) |
1154 | { | 1153 | { |
1155 | ((SceneObjectGroup)ent).CreateScriptInstances(0, false, DefaultScriptEngine, 0); | 1154 | ((SceneObjectGroup)ent).CreateScriptInstances(0, false, DefaultScriptEngine, 0); |
1155 | ((SceneObjectGroup)ent).ResumeScripts(); | ||
1156 | } | 1156 | } |
1157 | } | 1157 | } |
1158 | } | 1158 | } |
@@ -2769,14 +2769,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2769 | } | 2769 | } |
2770 | 2770 | ||
2771 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) | 2771 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) |
2772 | { | 2772 | { |
2773 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; | ||
2774 | client.OnObjectDetach += m_sceneGraph.DetachObject; | ||
2775 | |||
2776 | if (AttachmentsModule != null) | 2773 | if (AttachmentsModule != null) |
2777 | { | 2774 | { |
2778 | client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; | 2775 | client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; |
2776 | client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory; | ||
2779 | client.OnObjectAttach += AttachmentsModule.AttachObject; | 2777 | client.OnObjectAttach += AttachmentsModule.AttachObject; |
2778 | client.OnObjectDetach += AttachmentsModule.DetachObject; | ||
2780 | client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; | 2779 | client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; |
2781 | } | 2780 | } |
2782 | } | 2781 | } |
@@ -2925,14 +2924,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2925 | } | 2924 | } |
2926 | 2925 | ||
2927 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) | 2926 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) |
2928 | { | 2927 | { |
2929 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments; | ||
2930 | client.OnObjectDetach -= m_sceneGraph.DetachObject; | ||
2931 | |||
2932 | if (AttachmentsModule != null) | 2928 | if (AttachmentsModule != null) |
2933 | { | 2929 | { |
2934 | client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; | 2930 | client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; |
2931 | client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory; | ||
2935 | client.OnObjectAttach -= AttachmentsModule.AttachObject; | 2932 | client.OnObjectAttach -= AttachmentsModule.AttachObject; |
2933 | client.OnObjectDetach -= AttachmentsModule.DetachObject; | ||
2936 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; | 2934 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; |
2937 | } | 2935 | } |
2938 | } | 2936 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 23a4ee9..1421d0e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -443,9 +443,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
443 | { | 443 | { |
444 | SceneObjectGroup group = GetGroupByPrim(objectLocalID); | 444 | SceneObjectGroup group = GetGroupByPrim(objectLocalID); |
445 | if (group != null) | 445 | if (group != null) |
446 | { | 446 | m_parentScene.AttachmentsModule.DetachSingleAttachmentToGround(group.UUID, remoteClient); |
447 | m_parentScene.DetachSingleAttachmentToGround(group.UUID, remoteClient); | ||
448 | } | ||
449 | } | 447 | } |
450 | 448 | ||
451 | protected internal void DetachObject(uint objectLocalID, IClientAPI remoteClient) | 449 | protected internal void DetachObject(uint objectLocalID, IClientAPI remoteClient) |
@@ -1757,6 +1755,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1757 | copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); | 1755 | copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); |
1758 | copy.HasGroupChanged = true; | 1756 | copy.HasGroupChanged = true; |
1759 | copy.ScheduleGroupForFullUpdate(); | 1757 | copy.ScheduleGroupForFullUpdate(); |
1758 | copy.ResumeScripts(); | ||
1760 | 1759 | ||
1761 | // required for physics to update it's position | 1760 | // required for physics to update it's position |
1762 | copy.AbsolutePosition = copy.AbsolutePosition; | 1761 | copy.AbsolutePosition = copy.AbsolutePosition; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 4034744..f7e46af 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -416,5 +416,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
416 | scriptModule.SetXMLState(itemID, n.OuterXml); | 416 | scriptModule.SetXMLState(itemID, n.OuterXml); |
417 | } | 417 | } |
418 | } | 418 | } |
419 | |||
420 | public void ResumeScripts() | ||
421 | { | ||
422 | foreach (SceneObjectPart part in m_parts.Values) | ||
423 | { | ||
424 | part.Inventory.ResumeScripts(); | ||
425 | } | ||
426 | } | ||
419 | } | 427 | } |
420 | } | 428 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 2e13f90..3b1b567 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -282,36 +282,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
282 | return; | 282 | return; |
283 | } | 283 | } |
284 | 284 | ||
285 | m_part.ParentGroup.Scene.AssetService.Get( | 285 | AssetBase asset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); |
286 | item.AssetID.ToString(), this, delegate(string id, object sender, AssetBase asset) | 286 | if (null == asset) |
287 | { | 287 | { |
288 | if (null == asset) | 288 | m_log.ErrorFormat( |
289 | { | 289 | "[PRIM INVENTORY]: " + |
290 | m_log.ErrorFormat( | 290 | "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", |
291 | "[PRIM INVENTORY]: " + | 291 | item.Name, item.ItemID, m_part.AbsolutePosition, |
292 | "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", | 292 | m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); |
293 | item.Name, item.ItemID, m_part.AbsolutePosition, | 293 | } |
294 | m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); | 294 | else |
295 | } | 295 | { |
296 | else | 296 | if (m_part.ParentGroup.m_savedScriptState != null) |
297 | { | 297 | RestoreSavedScriptState(item.OldItemID, item.ItemID); |
298 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
299 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
300 | 298 | ||
301 | lock (m_items) | 299 | lock (m_items) |
302 | { | 300 | { |
303 | m_items[item.ItemID].PermsMask = 0; | 301 | m_items[item.ItemID].PermsMask = 0; |
304 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 302 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
305 | } | ||
306 | |||
307 | string script = Utils.BytesToString(asset.Data); | ||
308 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
309 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
310 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
311 | m_part.ScheduleFullUpdate(); | ||
312 | } | ||
313 | } | 303 | } |
314 | ); | 304 | |
305 | string script = Utils.BytesToString(asset.Data); | ||
306 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
307 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
308 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
309 | m_part.ScheduleFullUpdate(); | ||
310 | } | ||
315 | } | 311 | } |
316 | } | 312 | } |
317 | 313 | ||
@@ -630,16 +626,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
630 | { | 626 | { |
631 | item.AssetID = m_items[item.ItemID].AssetID; | 627 | item.AssetID = m_items[item.ItemID].AssetID; |
632 | } | 628 | } |
633 | else if ((InventoryType)item.Type == InventoryType.Notecard) | ||
634 | { | ||
635 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); | ||
636 | |||
637 | if (presence != null) | ||
638 | { | ||
639 | presence.ControllingClient.SendAgentAlertMessage( | ||
640 | "Notecard saved", false); | ||
641 | } | ||
642 | } | ||
643 | 629 | ||
644 | m_items[item.ItemID] = item; | 630 | m_items[item.ItemID] = item; |
645 | m_inventorySerial++; | 631 | m_inventorySerial++; |
@@ -1042,5 +1028,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
1042 | 1028 | ||
1043 | return ret; | 1029 | return ret; |
1044 | } | 1030 | } |
1031 | |||
1032 | public void ResumeScripts() | ||
1033 | { | ||
1034 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
1035 | if (engines == null) | ||
1036 | return; | ||
1037 | |||
1038 | |||
1039 | lock (m_items) | ||
1040 | { | ||
1041 | foreach (TaskInventoryItem item in m_items.Values) | ||
1042 | { | ||
1043 | if (item.InvType == (int)InventoryType.LSL) | ||
1044 | { | ||
1045 | foreach (IScriptModule engine in engines) | ||
1046 | { | ||
1047 | if (engine != null) | ||
1048 | engine.ResumeScript(item.ItemID); | ||
1049 | } | ||
1050 | } | ||
1051 | } | ||
1052 | } | ||
1053 | } | ||
1045 | } | 1054 | } |
1046 | } \ No newline at end of file | 1055 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index cf0f345..b6677f0 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | |||
@@ -182,6 +182,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
182 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 182 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
183 | { | 183 | { |
184 | sceneObject.CreateScriptInstances(0, true, scene.DefaultScriptEngine, 0); | 184 | sceneObject.CreateScriptInstances(0, true, scene.DefaultScriptEngine, 0); |
185 | sceneObject.ResumeScripts(); | ||
185 | } | 186 | } |
186 | } | 187 | } |
187 | 188 | ||