diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 69 |
1 files changed, 61 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 5b1c9f4..052a05e 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -550,6 +550,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
550 | /// </remarks> | 550 | /// </remarks> |
551 | public event ScriptControlEvent OnScriptControlEvent; | 551 | public event ScriptControlEvent OnScriptControlEvent; |
552 | 552 | ||
553 | public delegate void ScriptMovingStartEvent(uint localID); | ||
554 | |||
555 | /// <summary> | ||
556 | /// TODO: Should be triggered when a physics object starts moving. | ||
557 | /// </summary> | ||
558 | public event ScriptMovingStartEvent OnScriptMovingStartEvent; | ||
559 | |||
560 | public delegate void ScriptMovingEndEvent(uint localID); | ||
561 | |||
562 | /// <summary> | ||
563 | /// TODO: Should be triggered when a physics object stops moving. | ||
564 | /// </summary> | ||
565 | public event ScriptMovingEndEvent OnScriptMovingEndEvent; | ||
566 | |||
553 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); | 567 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); |
554 | 568 | ||
555 | /// <summary> | 569 | /// <summary> |
@@ -755,7 +769,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
755 | public event ScriptTimerEvent OnScriptTimerEvent; | 769 | public event ScriptTimerEvent OnScriptTimerEvent; |
756 | */ | 770 | */ |
757 | 771 | ||
758 | public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); | 772 | public delegate void EstateToolsSunUpdate(ulong regionHandle); |
759 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); | 773 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); |
760 | 774 | ||
761 | public event EstateToolsSunUpdate OnEstateToolsSunUpdate; | 775 | public event EstateToolsSunUpdate OnEstateToolsSunUpdate; |
@@ -2238,6 +2252,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
2238 | } | 2252 | } |
2239 | } | 2253 | } |
2240 | 2254 | ||
2255 | public void TriggerMovingStartEvent(uint localID) | ||
2256 | { | ||
2257 | ScriptMovingStartEvent handlerScriptMovingStartEvent = OnScriptMovingStartEvent; | ||
2258 | if (handlerScriptMovingStartEvent != null) | ||
2259 | { | ||
2260 | foreach (ScriptMovingStartEvent d in handlerScriptMovingStartEvent.GetInvocationList()) | ||
2261 | { | ||
2262 | try | ||
2263 | { | ||
2264 | d(localID); | ||
2265 | } | ||
2266 | catch (Exception e) | ||
2267 | { | ||
2268 | m_log.ErrorFormat( | ||
2269 | "[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing. {0} {1}", | ||
2270 | e.Message, e.StackTrace); | ||
2271 | } | ||
2272 | } | ||
2273 | } | ||
2274 | } | ||
2275 | |||
2276 | public void TriggerMovingEndEvent(uint localID) | ||
2277 | { | ||
2278 | ScriptMovingEndEvent handlerScriptMovingEndEvent = OnScriptMovingEndEvent; | ||
2279 | if (handlerScriptMovingEndEvent != null) | ||
2280 | { | ||
2281 | foreach (ScriptMovingEndEvent d in handlerScriptMovingEndEvent.GetInvocationList()) | ||
2282 | { | ||
2283 | try | ||
2284 | { | ||
2285 | d(localID); | ||
2286 | } | ||
2287 | catch (Exception e) | ||
2288 | { | ||
2289 | m_log.ErrorFormat( | ||
2290 | "[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing. {0} {1}", | ||
2291 | e.Message, e.StackTrace); | ||
2292 | } | ||
2293 | } | ||
2294 | } | ||
2295 | } | ||
2296 | |||
2241 | public void TriggerRequestChangeWaterHeight(float height) | 2297 | public void TriggerRequestChangeWaterHeight(float height) |
2242 | { | 2298 | { |
2243 | if (height < 0) | 2299 | if (height < 0) |
@@ -2536,13 +2592,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2536 | } | 2592 | } |
2537 | 2593 | ||
2538 | /// <summary> | 2594 | /// <summary> |
2539 | /// Updates the system as to how the position of the sun should be handled. | 2595 | /// Called when the sun's position parameters have changed in the Region and/or Estate |
2540 | /// </summary> | 2596 | /// </summary> |
2541 | /// <param name="regionHandle"></param> | 2597 | /// <param name="regionHandle">The region that changed</param> |
2542 | /// <param name="FixedTime">True if the Sun Position is fixed</param> | 2598 | public void TriggerEstateToolsSunUpdate(ulong regionHandle) |
2543 | /// <param name="useEstateTime">True if the Estate Settings should be used instead of region</param> | ||
2544 | /// <param name="FixedSunHour">The hour 0.0 <= FixedSunHour <= 24.0 at which the sun is fixed at. Sun Hour 0 is sun-rise, when Day/Night ratio is 1:1</param> | ||
2545 | public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour) | ||
2546 | { | 2599 | { |
2547 | EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; | 2600 | EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; |
2548 | if (handlerEstateToolsSunUpdate != null) | 2601 | if (handlerEstateToolsSunUpdate != null) |
@@ -2551,7 +2604,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2551 | { | 2604 | { |
2552 | try | 2605 | try |
2553 | { | 2606 | { |
2554 | d(regionHandle, FixedTime, useEstateTime, FixedSunHour); | 2607 | d(regionHandle); |
2555 | } | 2608 | } |
2556 | catch (Exception e) | 2609 | catch (Exception e) |
2557 | { | 2610 | { |