diff options
author | Melanie Thielker | 2009-04-10 19:07:41 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-04-10 19:07:41 +0000 |
commit | 0377ddb5de48406f6d72d676ca853fcb0b8ff497 (patch) | |
tree | c922312fa040ebed786db3531b1ed720c0aaec0d /OpenSim/Region/ScriptEngine/XEngine | |
parent | Thank you, OwenOyen, for a patch that corrects the behavior of llRot2Euler. (diff) | |
download | opensim-SC_OLD-0377ddb5de48406f6d72d676ca853fcb0b8ff497.zip opensim-SC_OLD-0377ddb5de48406f6d72d676ca853fcb0b8ff497.tar.gz opensim-SC_OLD-0377ddb5de48406f6d72d676ca853fcb0b8ff497.tar.bz2 opensim-SC_OLD-0377ddb5de48406f6d72d676ca853fcb0b8ff497.tar.xz |
Add events to IScriptEngine to notify scripting modules of the removal
of objects from the scene, and of scripts from objects. This facilitates
the development of modules that can register prims with externall servers
for inbound email and XMLRPC. Currently implemented in XEngine only.
Also applying cmickeyb's compiler locking patch, since it seems risk-free.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 09480f6..357ee32 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -142,6 +142,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
142 | get { return m_ScriptConfig; } | 142 | get { return m_ScriptConfig; } |
143 | } | 143 | } |
144 | 144 | ||
145 | public event ScriptRemoved OnScriptRemoved; | ||
146 | public event ObjectRemoved OnObjectRemoved; | ||
147 | |||
145 | // | 148 | // |
146 | // IRegionModule functions | 149 | // IRegionModule functions |
147 | // | 150 | // |
@@ -702,6 +705,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
702 | if (part != null) | 705 | if (part != null) |
703 | part.RemoveScriptEvents(itemID); | 706 | part.RemoveScriptEvents(itemID); |
704 | 707 | ||
708 | bool objectRemoved = false; | ||
709 | |||
705 | lock (m_PrimObjects) | 710 | lock (m_PrimObjects) |
706 | { | 711 | { |
707 | // Remove the script from it's prim | 712 | // Remove the script from it's prim |
@@ -715,6 +720,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
715 | if (m_PrimObjects[localID].Count == 0) | 720 | if (m_PrimObjects[localID].Count == 0) |
716 | { | 721 | { |
717 | m_PrimObjects.Remove(localID); | 722 | m_PrimObjects.Remove(localID); |
723 | objectRemoved = true; | ||
718 | } | 724 | } |
719 | } | 725 | } |
720 | } | 726 | } |
@@ -731,8 +737,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
731 | 737 | ||
732 | instance = null; | 738 | instance = null; |
733 | 739 | ||
740 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; | ||
741 | if (handlerObjectRemoved != null) | ||
742 | handlerObjectRemoved(part.UUID); | ||
743 | |||
734 | CleanAssemblies(); | 744 | CleanAssemblies(); |
735 | } | 745 | } |
746 | |||
747 | ScriptRemoved handlerScriptRemoved = OnScriptRemoved; | ||
748 | if (handlerScriptRemoved != null) | ||
749 | handlerScriptRemoved(itemID); | ||
736 | } | 750 | } |
737 | 751 | ||
738 | public void OnScriptReset(uint localID, UUID itemID) | 752 | public void OnScriptReset(uint localID, UUID itemID) |