aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-14 00:23:11 +0000
committerJustin Clark-Casey (justincc)2012-01-14 00:23:11 +0000
commitb5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f (patch)
treec4516b37b09c2a104019845ef167c262836487e9 /OpenSim/Region/Framework
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.zip
opensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.tar.gz
opensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.tar.bz2
opensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.tar.xz
Register the UrlModule for script engine events OnScriptRemoved and OnObjectRemoved just once in the UrlModule itself, rather than repeatedly for every script.
Doing this in every script is unnecessary since the event trigger is parameterized by the item id. All that would happen is 2000 scripts would trigger 1999 unnecessary calls, and a large number of initialized scripts may eventually trigger a StackOverflowException. Registration moved to UrlModule so that the handler is registered for all script engine implementations. This required moving the OnScriptRemoved and OnObjectRemoved events (only used by UrlModule in core) from IScriptEngine to IScriptModule to avoid circular references.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index 950e4b0..18c45dd 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -31,8 +31,21 @@ using OpenMetaverse;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 public delegate void ScriptRemoved(UUID script);
35 public delegate void ObjectRemoved(UUID prim);
36
34 public interface IScriptModule: INonSharedRegionModule 37 public interface IScriptModule: INonSharedRegionModule
35 { 38 {
39 /// <summary>
40 /// Triggered when a script is removed from the script module.
41 /// </summary>
42 event ScriptRemoved OnScriptRemoved;
43
44 /// <summary>
45 /// Triggered when an object is removed via the script module.
46 /// </summary>
47 event ObjectRemoved OnObjectRemoved;
48
36 string ScriptEngineName { get; } 49 string ScriptEngineName { get; }
37 50
38 string GetXMLState(UUID itemID); 51 string GetXMLState(UUID itemID);