diff options
author | Robert Adams | 2012-02-17 09:12:41 -0800 |
---|---|---|
committer | Robert Adams | 2012-02-17 09:12:41 -0800 |
commit | 6baa13ab7aeb7d0ee08f2460f52961dbd79bada1 (patch) | |
tree | 164b3fb1a8ab98f125b98d39d4720cb915bf3fa8 /OpenSim/Region/Framework/Scenes/EventManager.cs | |
parent | Merge branch 'master' of /home/opensim/src/opensim (diff) | |
download | opensim-SC-6baa13ab7aeb7d0ee08f2460f52961dbd79bada1.zip opensim-SC-6baa13ab7aeb7d0ee08f2460f52961dbd79bada1.tar.gz opensim-SC-6baa13ab7aeb7d0ee08f2460f52961dbd79bada1.tar.bz2 opensim-SC-6baa13ab7aeb7d0ee08f2460f52961dbd79bada1.tar.xz |
Add new and updated script events
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index d31d380..34d3da7 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -184,10 +184,62 @@ namespace OpenSim.Region.Framework.Scenes | |||
184 | 184 | ||
185 | public event ClientClosed OnClientClosed; | 185 | public event ClientClosed OnClientClosed; |
186 | 186 | ||
187 | // Fired when a script is created | ||
188 | // The indication that a new script exists in this region. | ||
189 | public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); | ||
190 | public event NewScript OnNewScript; | ||
191 | public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) | ||
192 | { | ||
193 | NewScript handlerNewScript = OnNewScript; | ||
194 | if (handlerNewScript != null) | ||
195 | { | ||
196 | foreach (NewScript d in handlerNewScript.GetInvocationList()) | ||
197 | { | ||
198 | try | ||
199 | { | ||
200 | d(clientID, part, itemID); | ||
201 | } | ||
202 | catch (Exception e) | ||
203 | { | ||
204 | m_log.ErrorFormat( | ||
205 | "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}", | ||
206 | e.Message, e.StackTrace); | ||
207 | } | ||
208 | } | ||
209 | } | ||
210 | } | ||
211 | |||
212 | //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset | ||
213 | // An indication that the script has changed. | ||
214 | public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); | ||
215 | public event UpdateScript OnUpdateScript; | ||
216 | public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) | ||
217 | { | ||
218 | UpdateScript handlerUpdateScript = OnUpdateScript; | ||
219 | if (handlerUpdateScript != null) | ||
220 | { | ||
221 | foreach (UpdateScript d in handlerUpdateScript.GetInvocationList()) | ||
222 | { | ||
223 | try | ||
224 | { | ||
225 | d(clientId, itemId, primId, isScriptRunning, newAssetID); | ||
226 | } | ||
227 | catch (Exception e) | ||
228 | { | ||
229 | m_log.ErrorFormat( | ||
230 | "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}", | ||
231 | e.Message, e.StackTrace); | ||
232 | } | ||
233 | } | ||
234 | } | ||
235 | } | ||
236 | |||
187 | /// <summary> | 237 | /// <summary> |
188 | /// This is fired when a scene object property that a script might be interested in (such as color, scale or | 238 | /// ScriptChangedEvent is fired when a scene object property that a script might be interested |
189 | /// inventory) changes. Only enough information is sent for the LSL changed event | 239 | /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event. |
190 | /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) | 240 | /// This is not an indication that the script has changed (see OnUpdateScript for that). |
241 | /// This event is sent to a script to tell it that some property changed on | ||
242 | /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed . | ||
191 | /// </summary> | 243 | /// </summary> |
192 | public event ScriptChangedEvent OnScriptChangedEvent; | 244 | public event ScriptChangedEvent OnScriptChangedEvent; |
193 | public delegate void ScriptChangedEvent(uint localID, uint change); | 245 | public delegate void ScriptChangedEvent(uint localID, uint change); |