aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/EventManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs59
1 files changed, 41 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index 06277a1..c226a7e 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -26,6 +26,8 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
30using System.Collections.Generic;
29using libsecondlife; 31using libsecondlife;
30using OpenSim.Framework; 32using OpenSim.Framework;
31using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; 33using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney;
@@ -55,6 +57,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
55 myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; 57 myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target;
56 myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; 58 myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target;
57 myScriptEngine.World.EventManager.OnScriptControlEvent += control; 59 myScriptEngine.World.EventManager.OnScriptControlEvent += control;
60 myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start;
61 myScriptEngine.World.EventManager.OnScriptColliding += collision;
62 myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end;
58 IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); 63 IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>();
59 if (money != null) 64 if (money != null)
60 { 65 {
@@ -81,6 +86,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
81 XDetectParams[] det = new XDetectParams[1]; 86 XDetectParams[] det = new XDetectParams[1];
82 det[0] = new XDetectParams(); 87 det[0] = new XDetectParams();
83 det[0].Key = remoteClient.AgentId; 88 det[0].Key = remoteClient.AgentId;
89 det[0].Populate(myScriptEngine.World);
84 90
85 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 91 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(
86 localID); 92 localID);
@@ -103,6 +109,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
103 XDetectParams[] det = new XDetectParams[1]; 109 XDetectParams[] det = new XDetectParams[1];
104 det[0] = new XDetectParams(); 110 det[0] = new XDetectParams();
105 det[0].Key = remoteClient.AgentId; 111 det[0].Key = remoteClient.AgentId;
112 det[0].Populate(myScriptEngine.World);
106 det[0].OffsetPos = new LSL_Types.Vector3(offsetPos.X, 113 det[0].OffsetPos = new LSL_Types.Vector3(offsetPos.X,
107 offsetPos.Y, 114 offsetPos.Y,
108 offsetPos.Z); 115 offsetPos.Z);
@@ -127,6 +134,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
127 XDetectParams[] det = new XDetectParams[1]; 134 XDetectParams[] det = new XDetectParams[1];
128 det[0] = new XDetectParams(); 135 det[0] = new XDetectParams();
129 det[0].Key = remoteClient.AgentId; 136 det[0].Key = remoteClient.AgentId;
137 det[0].Populate(myScriptEngine.World);
130 138
131 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 139 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(
132 localID); 140 localID);
@@ -162,45 +170,60 @@ namespace OpenSim.Region.ScriptEngine.XEngine
162 new XDetectParams[0])); 170 new XDetectParams[0]));
163 } 171 }
164 172
165 public void collision_start(uint localID, LLUUID itemID, 173 public void collision_start(uint localID, ColliderArgs col)
166 IClientAPI remoteClient)
167 { 174 {
168 // Add to queue for all scripts in ObjectID object 175 // Add to queue for all scripts in ObjectID object
169 XDetectParams[] det = new XDetectParams[1]; 176 List<XDetectParams> det = new List<XDetectParams>();
170 det[0] = new XDetectParams(); 177
171 det[0].Key = remoteClient.AgentId; 178 foreach (DetectedObject detobj in col.Colliders)
179 {
180 XDetectParams d = new XDetectParams();
181 d.Key =detobj.keyUUID;
182 d.Populate(myScriptEngine.World);
183 det.Add(d);
184 }
172 185
173 myScriptEngine.PostObjectEvent(localID, new XEventParams( 186 myScriptEngine.PostObjectEvent(localID, new XEventParams(
174 "collision_start", 187 "collision_start",
175 new Object[] { new LSL_Types.LSLInteger(1) }, 188 new Object[] { new LSL_Types.LSLInteger(1) },
176 det)); 189 det.ToArray()));
177 } 190 }
178 191
179 public void collision(uint localID, LLUUID itemID, 192 public void collision(uint localID, ColliderArgs col)
180 IClientAPI remoteClient)
181 { 193 {
182 // Add to queue for all scripts in ObjectID object 194 // Add to queue for all scripts in ObjectID object
183 XDetectParams[] det = new XDetectParams[1]; 195 List<XDetectParams> det = new List<XDetectParams>();
184 det[0] = new XDetectParams(); 196
185 det[0].Key = remoteClient.AgentId; 197 foreach (DetectedObject detobj in col.Colliders)
198 {
199 XDetectParams d = new XDetectParams();
200 d.Key =detobj.keyUUID;
201 d.Populate(myScriptEngine.World);
202 det.Add(d);
203 }
186 204
187 myScriptEngine.PostObjectEvent(localID, new XEventParams( 205 myScriptEngine.PostObjectEvent(localID, new XEventParams(
188 "collision", new Object[] { new LSL_Types.LSLInteger(1) }, 206 "collision", new Object[] { new LSL_Types.LSLInteger(1) },
189 det)); 207 det.ToArray()));
190 } 208 }
191 209
192 public void collision_end(uint localID, LLUUID itemID, 210 public void collision_end(uint localID, ColliderArgs col)
193 IClientAPI remoteClient)
194 { 211 {
195 // Add to queue for all scripts in ObjectID object 212 // Add to queue for all scripts in ObjectID object
196 XDetectParams[] det = new XDetectParams[1]; 213 List<XDetectParams> det = new List<XDetectParams>();
197 det[0] = new XDetectParams(); 214
198 det[0].Key = remoteClient.AgentId; 215 foreach (DetectedObject detobj in col.Colliders)
216 {
217 XDetectParams d = new XDetectParams();
218 d.Key =detobj.keyUUID;
219 d.Populate(myScriptEngine.World);
220 det.Add(d);
221 }
199 222
200 myScriptEngine.PostObjectEvent(localID, new XEventParams( 223 myScriptEngine.PostObjectEvent(localID, new XEventParams(
201 "collision_end", 224 "collision_end",
202 new Object[] { new LSL_Types.LSLInteger(1) }, 225 new Object[] { new LSL_Types.LSLInteger(1) },
203 det)); 226 det.ToArray()));
204 } 227 }
205 228
206 public void land_collision_start(uint localID, LLUUID itemID) 229 public void land_collision_start(uint localID, LLUUID itemID)