diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 902ded1..9ee1520 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -549,6 +549,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
549 | /// </remarks> | 549 | /// </remarks> |
550 | public event ScriptControlEvent OnScriptControlEvent; | 550 | public event ScriptControlEvent OnScriptControlEvent; |
551 | 551 | ||
552 | public delegate void ScriptMovingStartEvent(uint localID); | ||
553 | |||
554 | /// <summary> | ||
555 | /// TODO: Should be triggered when a physics object starts moving. | ||
556 | /// </summary> | ||
557 | public event ScriptMovingStartEvent OnScriptMovingStartEvent; | ||
558 | |||
559 | public delegate void ScriptMovingEndEvent(uint localID); | ||
560 | |||
561 | /// <summary> | ||
562 | /// TODO: Should be triggered when a physics object stops moving. | ||
563 | /// </summary> | ||
564 | public event ScriptMovingEndEvent OnScriptMovingEndEvent; | ||
565 | |||
552 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); | 566 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); |
553 | 567 | ||
554 | /// <summary> | 568 | /// <summary> |
@@ -2212,6 +2226,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
2212 | } | 2226 | } |
2213 | } | 2227 | } |
2214 | 2228 | ||
2229 | public void TriggerMovingStartEvent(uint localID) | ||
2230 | { | ||
2231 | ScriptMovingStartEvent handlerScriptMovingStartEvent = OnScriptMovingStartEvent; | ||
2232 | if (handlerScriptMovingStartEvent != null) | ||
2233 | { | ||
2234 | foreach (ScriptMovingStartEvent d in handlerScriptMovingStartEvent.GetInvocationList()) | ||
2235 | { | ||
2236 | try | ||
2237 | { | ||
2238 | d(localID); | ||
2239 | } | ||
2240 | catch (Exception e) | ||
2241 | { | ||
2242 | m_log.ErrorFormat( | ||
2243 | "[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing. {0} {1}", | ||
2244 | e.Message, e.StackTrace); | ||
2245 | } | ||
2246 | } | ||
2247 | } | ||
2248 | } | ||
2249 | |||
2250 | public void TriggerMovingEndEvent(uint localID) | ||
2251 | { | ||
2252 | ScriptMovingEndEvent handlerScriptMovingEndEvent = OnScriptMovingEndEvent; | ||
2253 | if (handlerScriptMovingEndEvent != null) | ||
2254 | { | ||
2255 | foreach (ScriptMovingEndEvent d in handlerScriptMovingEndEvent.GetInvocationList()) | ||
2256 | { | ||
2257 | try | ||
2258 | { | ||
2259 | d(localID); | ||
2260 | } | ||
2261 | catch (Exception e) | ||
2262 | { | ||
2263 | m_log.ErrorFormat( | ||
2264 | "[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing. {0} {1}", | ||
2265 | e.Message, e.StackTrace); | ||
2266 | } | ||
2267 | } | ||
2268 | } | ||
2269 | } | ||
2270 | |||
2215 | public void TriggerRequestChangeWaterHeight(float height) | 2271 | public void TriggerRequestChangeWaterHeight(float height) |
2216 | { | 2272 | { |
2217 | if (height < 0) | 2273 | if (height < 0) |