aboutsummaryrefslogtreecommitdiffstatshomepage
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
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.
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs56
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs6
2 files changed, 60 insertions, 2 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)
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index afde685..0ff2da3 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -62,6 +62,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
62 myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; 62 myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target;
63 myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; 63 myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target;
64 myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; 64 myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target;
65 myScriptEngine.World.EventManager.OnScriptMovingStartEvent += moving_start;
66 myScriptEngine.World.EventManager.OnScriptMovingEndEvent += moving_end;
65 myScriptEngine.World.EventManager.OnScriptControlEvent += control; 67 myScriptEngine.World.EventManager.OnScriptControlEvent += control;
66 myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; 68 myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start;
67 myScriptEngine.World.EventManager.OnScriptColliding += collision; 69 myScriptEngine.World.EventManager.OnScriptColliding += collision;
@@ -419,14 +421,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
419 // dataserver: not handled here 421 // dataserver: not handled here
420 // link_message: not handled here 422 // link_message: not handled here
421 423
422 public void moving_start(uint localID, UUID itemID) 424 public void moving_start(uint localID)
423 { 425 {
424 myScriptEngine.PostObjectEvent(localID, new EventParams( 426 myScriptEngine.PostObjectEvent(localID, new EventParams(
425 "moving_start",new object[0], 427 "moving_start",new object[0],
426 new DetectParams[0])); 428 new DetectParams[0]));
427 } 429 }
428 430
429 public void moving_end(uint localID, UUID itemID) 431 public void moving_end(uint localID)
430 { 432 {
431 myScriptEngine.PostObjectEvent(localID, new EventParams( 433 myScriptEngine.PostObjectEvent(localID, new EventParams(
432 "moving_end",new object[0], 434 "moving_end",new object[0],