diff options
author | Melanie | 2010-04-19 06:29:26 +0100 |
---|---|---|
committer | Melanie | 2010-04-19 06:29:26 +0100 |
commit | 21cad5d3ac68ceb4ac48346835ac087ecb107446 (patch) | |
tree | b413c2c0e42a38008bd61cdd8191787bccb45b13 /OpenSim/Region/Framework | |
parent | Slightly tweak README to account for the fact that first-time standalone user... (diff) | |
download | opensim-SC_OLD-21cad5d3ac68ceb4ac48346835ac087ecb107446.zip opensim-SC_OLD-21cad5d3ac68ceb4ac48346835ac087ecb107446.tar.gz opensim-SC_OLD-21cad5d3ac68ceb4ac48346835ac087ecb107446.tar.bz2 opensim-SC_OLD-21cad5d3ac68ceb4ac48346835ac087ecb107446.tar.xz |
All scripts are now created suspended and are only unsuspended when the object
is fully rezzed and all scripts in it are instantiated. This ensures that link
messages will not be lost on rez/region crossing and makes heavily scripted
objects reliable.
Diffstat (limited to 'OpenSim/Region/Framework')
8 files changed, 46 insertions, 2 deletions
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/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 7661068..435026c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -63,6 +63,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
63 | if (group is SceneObjectGroup) | 63 | if (group is SceneObjectGroup) |
64 | { | 64 | { |
65 | ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0); | 65 | ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0); |
66 | ((SceneObjectGroup) group).ResumeScripts(); | ||
66 | } | 67 | } |
67 | } | 68 | } |
68 | } | 69 | } |
@@ -218,6 +219,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
218 | { | 219 | { |
219 | remoteClient.SendAgentAlertMessage("Script saved", false); | 220 | remoteClient.SendAgentAlertMessage("Script saved", false); |
220 | } | 221 | } |
222 | part.ParentGroup.ResumeScripts(); | ||
221 | return errors; | 223 | return errors; |
222 | } | 224 | } |
223 | 225 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a34f57e..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 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 89eb54d..1421d0e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1755,6 +1755,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1755 | copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); | 1755 | copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); |
1756 | copy.HasGroupChanged = true; | 1756 | copy.HasGroupChanged = true; |
1757 | copy.ScheduleGroupForFullUpdate(); | 1757 | copy.ScheduleGroupForFullUpdate(); |
1758 | copy.ResumeScripts(); | ||
1758 | 1759 | ||
1759 | // required for physics to update it's position | 1760 | // required for physics to update it's position |
1760 | 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..2b6be29 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -1042,5 +1042,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
1042 | 1042 | ||
1043 | return ret; | 1043 | return ret; |
1044 | } | 1044 | } |
1045 | |||
1046 | public void ResumeScripts() | ||
1047 | { | ||
1048 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
1049 | if (engines == null) | ||
1050 | return; | ||
1051 | |||
1052 | |||
1053 | lock (m_items) | ||
1054 | { | ||
1055 | foreach (TaskInventoryItem item in m_items.Values) | ||
1056 | { | ||
1057 | if (item.InvType == (int)InventoryType.LSL) | ||
1058 | { | ||
1059 | foreach (IScriptModule engine in engines) | ||
1060 | { | ||
1061 | if (engine != null) | ||
1062 | engine.ResumeScript(item.ItemID); | ||
1063 | } | ||
1064 | } | ||
1065 | } | ||
1066 | } | ||
1067 | } | ||
1045 | } | 1068 | } |
1046 | } \ No newline at end of file | 1069 | } |
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 | ||