aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs)30
1 files changed, 13 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 8a25098..5833512 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -30,9 +30,10 @@ using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Environment.Scenes; 32using OpenSim.Region.Environment.Scenes;
33using OpenSim.Region.ScriptEngine.XEngine.Script; 33using OpenSim.Region.ScriptEngine.Shared;
34using OpenSim.Region.ScriptEngine.Shared.Api;
34 35
35namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins 36namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
36{ 37{
37 public class SensorRepeat 38 public class SensorRepeat
38 { 39 {
@@ -72,8 +73,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
72 string name, LLUUID keyID, int type, double range, 73 string name, LLUUID keyID, int type, double range,
73 double arc, double sec, SceneObjectPart host) 74 double arc, double sec, SceneObjectPart host)
74 { 75 {
75 Console.WriteLine("SetSensorEvent");
76
77 // Always remove first, in case this is a re-set 76 // Always remove first, in case this is a re-set
78 UnSetSenseRepeaterEvents(m_localID, m_itemID); 77 UnSetSenseRepeaterEvents(m_localID, m_itemID);
79 if (sec == 0) // Disabling timer 78 if (sec == 0) // Disabling timer
@@ -163,7 +162,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
163 Dictionary<LLUUID, LSL_Types.list> Obj = null; 162 Dictionary<LLUUID, LSL_Types.list> Obj = null;
164 if (!SenseEvents.TryGetValue(m_localID, out Obj)) 163 if (!SenseEvents.TryGetValue(m_localID, out Obj))
165 { 164 {
166 m_CmdManager.m_ScriptEngine.Log.Info("[AsyncLSL]: GetSensorList missing localID: " + m_localID);
167 return null; 165 return null;
168 } 166 }
169 lock (Obj) 167 lock (Obj)
@@ -172,7 +170,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
172 LSL_Types.list SenseList = null; 170 LSL_Types.list SenseList = null;
173 if (!Obj.TryGetValue(m_itemID, out SenseList)) 171 if (!Obj.TryGetValue(m_itemID, out SenseList))
174 { 172 {
175 m_CmdManager.m_ScriptEngine.Log.Info("[AsyncLSL]: GetSensorList missing itemID: " + m_itemID);
176 return null; 173 return null;
177 } 174 }
178 return SenseList; 175 return SenseList;
@@ -182,15 +179,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
182 179
183 private void SensorSweep(SenseRepeatClass ts) 180 private void SensorSweep(SenseRepeatClass ts)
184 { 181 {
185 //m_ScriptEngine.Log.Info("[AsyncLSL]:Enter SensorSweep");
186 SceneObjectPart SensePoint = ts.host; 182 SceneObjectPart SensePoint = ts.host;
187 183
188 if (SensePoint == null) 184 if (SensePoint == null)
189 { 185 {
190 //m_ScriptEngine.Log.Info("[AsyncLSL]: Enter SensorSweep (SensePoint == null) for "+ts.itemID.ToString());
191 return; 186 return;
192 } 187 }
193 //m_ScriptEngine.Log.Info("[AsyncLSL]: Enter SensorSweep Scan");
194 188
195 LLVector3 sensorPos = SensePoint.AbsolutePosition; 189 LLVector3 sensorPos = SensePoint.AbsolutePosition;
196 LLVector3 regionPos = new LLVector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); 190 LLVector3 regionPos = new LLVector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0);
@@ -220,7 +214,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
220 objtype |= 0x04; // passive non-moving 214 objtype |= 0x04; // passive non-moving
221 else 215 else
222 objtype |= 0x02; // active moving 216 objtype |= 0x02; // active moving
223 if (ent is IScript) objtype |= 0x08; // Scripted. It COULD have one hidden ... 217
218 SceneObjectPart part = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID);
219
220 if (part != null && part.ContainsScripts()) objtype |= 0x08; // Scripted. It COULD have one hidden ...
224 221
225 if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type)) 222 if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type))
226 { 223 {
@@ -288,7 +285,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
288 } 285 }
289 } 286 }
290 } 287 }
291 //m_ScriptEngine.Log.Info("[AsyncLSL]: Enter SensorSweep SenseLock");
292 288
293 lock (SenseLock) 289 lock (SenseLock)
294 { 290 {
@@ -311,24 +307,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
311 // send a "no_sensor" 307 // send a "no_sensor"
312 // Add it to queue 308 // Add it to queue
313 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID, 309 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
314 new XEventParams("no_sensor", new Object[0], 310 new EventParams("no_sensor", new Object[0],
315 new XDetectParams[0])); 311 new DetectParams[0]));
316 } 312 }
317 else 313 else
318 { 314 {
319 XDetectParams[] detect = 315 DetectParams[] detect =
320 new XDetectParams[SensedObjects.Length]; 316 new DetectParams[SensedObjects.Length];
321 317
322 int idx; 318 int idx;
323 for (idx = 0; idx < SensedObjects.Length; idx++) 319 for (idx = 0; idx < SensedObjects.Length; idx++)
324 { 320 {
325 detect[idx] = new XDetectParams(); 321 detect[idx] = new DetectParams();
326 detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]); 322 detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]);
327 detect[idx].Populate(m_CmdManager.m_ScriptEngine.World); 323 detect[idx].Populate(m_CmdManager.m_ScriptEngine.World);
328 } 324 }
329 325
330 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID, 326 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
331 new XEventParams("sensor", 327 new EventParams("sensor",
332 new Object[] { 328 new Object[] {
333 new LSL_Types.LSLInteger(SensedObjects.Length) }, 329 new LSL_Types.LSLInteger(SensedObjects.Length) },
334 detect)); 330 detect));