aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-26 03:57:51 +0000
committerJustin Clark-Casey (justincc)2013-01-26 03:57:51 +0000
commit53833babf99d83a27d0be2b820efbe41067ef723 (patch)
treedf928412445e06b228f9730941999e38fcbc9783 /OpenSim/Region/Framework
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-53833babf99d83a27d0be2b820efbe41067ef723.zip
opensim-SC_OLD-53833babf99d83a27d0be2b820efbe41067ef723.tar.gz
opensim-SC_OLD-53833babf99d83a27d0be2b820efbe41067ef723.tar.bz2
opensim-SC_OLD-53833babf99d83a27d0be2b820efbe41067ef723.tar.xz
Add OnScriptMovingStartEvent and OnScriptMovingEndEvent to EventManager so that these can be triggered by future code (not yet implemented).
Also hooks up moving_start and moving_end script events, eliminating itemID on XEngine EventManager methods since this is completely unused. An adaptation of the patch in http://opensimulator.org/mantis/view.php?id=6515 Thanks Garmin Kawaguichi and Signpost Marv.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs56
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)