aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs18
4 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index ae148a9..9f6ea35 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -81,6 +81,9 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
81 81
82 void PostEvent(EventParams data); 82 void PostEvent(EventParams data);
83 83
84 void Suspend();
85 void Resume();
86
84 /// <summary> 87 /// <summary>
85 /// Process the next event queued for this script 88 /// Process the next event queued for this script
86 /// </summary> 89 /// </summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 2296379..4d7ead6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -302,6 +302,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
302 float dz; 302 float dz;
303 303
304 Quaternion q = SensePoint.RotationOffset; 304 Quaternion q = SensePoint.RotationOffset;
305 if (SensePoint.ParentGroup.RootPart.IsAttachment)
306 {
307 // In attachments, the sensor cone always orients with the
308 // avatar rotation. This may include a nonzero elevation if
309 // in mouselook.
310
311 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
312 q = avatar.Rotation;
313 }
305 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 314 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
306 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); 315 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
307 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); 316 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index d30d2dc..3dd381d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -95,6 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
95 private bool m_startedFromSavedState; 95 private bool m_startedFromSavedState;
96 private UUID m_CurrentStateHash; 96 private UUID m_CurrentStateHash;
97 private UUID m_RegionID; 97 private UUID m_RegionID;
98 private bool m_Suspended = false;
98 99
99 private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> 100 private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>>
100 m_LineMap; 101 m_LineMap;
@@ -638,6 +639,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
638 /// <returns></returns> 639 /// <returns></returns>
639 public object EventProcessor() 640 public object EventProcessor()
640 { 641 {
642 if (m_Suspended)
643 return 0;
644
641 lock (m_Script) 645 lock (m_Script)
642 { 646 {
643 EventParams data = null; 647 EventParams data = null;
@@ -1011,5 +1015,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
1011 { 1015 {
1012 get { return m_RegionID; } 1016 get { return m_RegionID; }
1013 } 1017 }
1018
1019 public void Suspend()
1020 {
1021 m_Suspended = true;
1022 }
1023
1024 public void Resume()
1025 {
1026 m_Suspended = false;
1027 }
1014 } 1028 }
1015} 1029}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 98e77c0..54074ed 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1488,5 +1488,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1488 return new ArrayList(); 1488 return new ArrayList();
1489 } 1489 }
1490 } 1490 }
1491
1492 public void SuspendScript(UUID itemID)
1493 {
1494 IScriptInstance instance = GetInstance(itemID);
1495 if (instance == null)
1496 return;
1497
1498 instance.Suspend();
1499 }
1500
1501 public void ResumeScript(UUID itemID)
1502 {
1503 IScriptInstance instance = GetInstance(itemID);
1504 if (instance == null)
1505 return;
1506
1507 instance.Resume();
1508 }
1491 } 1509 }
1492} 1510}