aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
diff options
context:
space:
mode:
authorUbitUmarov2012-07-17 00:54:23 +0100
committerUbitUmarov2012-07-17 00:54:23 +0100
commitd5f4fb7b50fb7c594b018f8241399e22f88fc951 (patch)
tree8f3dab3d170596f02b1d1d836a0bc08a3e6b8ebd /OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
parentUbitOde: remove useless water collider from active code. (diff)
parentMerge branch 'avination' into careminster (diff)
downloadopensim-SC_OLD-d5f4fb7b50fb7c594b018f8241399e22f88fc951.zip
opensim-SC_OLD-d5f4fb7b50fb7c594b018f8241399e22f88fc951.tar.gz
opensim-SC_OLD-d5f4fb7b50fb7c594b018f8241399e22f88fc951.tar.bz2
opensim-SC_OLD-d5f4fb7b50fb7c594b018f8241399e22f88fc951.tar.xz
Merge branch 'avination' into ubitwork
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs28
1 files changed, 24 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 2effa25..26524fb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -54,20 +54,32 @@ namespace OpenSim.Region.Framework.Scenes
54 /// <summary> 54 /// <summary>
55 /// Start the scripts contained in all the prims in this group. 55 /// Start the scripts contained in all the prims in this group.
56 /// </summary> 56 /// </summary>
57 public void CreateScriptInstances(int startParam, bool postOnRez, 57 /// <param name="startParam"></param>
58 string engine, int stateSource) 58 /// <param name="postOnRez"></param>
59 /// <param name="engine"></param>
60 /// <param name="stateSource"></param>
61 /// <returns>
62 /// Number of scripts that were valid for starting. This does not guarantee that all these scripts
63 /// were actually started, but just that the start could be attempt (e.g. the asset data for the script could be found)
64 /// </returns>
65 public int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
59 { 66 {
67 int scriptsStarted = 0;
68
60 // Don't start scripts if they're turned off in the region! 69 // Don't start scripts if they're turned off in the region!
61 if (!m_scene.RegionInfo.RegionSettings.DisableScripts) 70 if (!m_scene.RegionInfo.RegionSettings.DisableScripts)
62 { 71 {
63 SceneObjectPart[] parts = m_parts.GetArray(); 72 SceneObjectPart[] parts = m_parts.GetArray();
64 for (int i = 0; i < parts.Length; i++) 73 for (int i = 0; i < parts.Length; i++)
65 parts[i].Inventory.CreateScriptInstances(startParam, postOnRez, engine, stateSource); 74 scriptsStarted
75 += parts[i].Inventory.CreateScriptInstances(startParam, postOnRez, engine, stateSource);
66 } 76 }
77
78 return scriptsStarted;
67 } 79 }
68 80
69 /// <summary> 81 /// <summary>
70 /// Stop the scripts contained in all the prims in this group 82 /// Stop and remove the scripts contained in all the prims in this group
71 /// </summary> 83 /// </summary>
72 public void RemoveScriptInstances(bool sceneObjectBeingDeleted) 84 public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
73 { 85 {
@@ -77,6 +89,14 @@ namespace OpenSim.Region.Framework.Scenes
77 } 89 }
78 90
79 /// <summary> 91 /// <summary>
92 /// Stop the scripts contained in all the prims in this group
93 /// </summary>
94 public void StopScriptInstances()
95 {
96 Array.ForEach<SceneObjectPart>(m_parts.GetArray(), p => p.Inventory.StopScriptInstances());
97 }
98
99 /// <summary>
80 /// Add an inventory item from a user's inventory to a prim in this scene object. 100 /// Add an inventory item from a user's inventory to a prim in this scene object.
81 /// </summary> 101 /// </summary>
82 /// <param name="agentID">The agent adding the item.</param> 102 /// <param name="agentID">The agent adding the item.</param>