aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
diff options
context:
space:
mode:
authorlbsa712008-06-24 21:09:49 +0000
committerlbsa712008-06-24 21:09:49 +0000
commit6b7930104bdb845d3b9c085dc04f52b6446f23b1 (patch)
tree05ee45781a455817fa400bb99f30f4d19d4eb1f8 /OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
parentbased on positive feedback on performance of making keys fixed length (diff)
downloadopensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.zip
opensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.gz
opensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.bz2
opensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.xz
* Applied patch from Melanie, mantis issue #1581 - "Refactor LSL language, api and compiler out of XEngine"
"First stage in a major Script Engine refactor, that will result in the LSL implementaions ebing reconverged. Not there yet, but one major part is done." Thank you, Melanie!
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs99
1 files changed, 50 insertions, 49 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index c226a7e..8bfef79 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -33,7 +33,8 @@ using OpenSim.Framework;
33using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; 33using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney;
34using OpenSim.Region.Environment.Scenes; 34using OpenSim.Region.Environment.Scenes;
35using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
36using OpenSim.Region.ScriptEngine.XEngine.Script; 36using OpenSim.Region.ScriptEngine.Shared;
37using OpenSim.Region.ScriptEngine.Interfaces;
37using Axiom.Math; 38using Axiom.Math;
38 39
39namespace OpenSim.Region.ScriptEngine.XEngine 40namespace OpenSim.Region.ScriptEngine.XEngine
@@ -83,8 +84,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
83 IClientAPI remoteClient) 84 IClientAPI remoteClient)
84 { 85 {
85 // Add to queue for all scripts in ObjectID object 86 // Add to queue for all scripts in ObjectID object
86 XDetectParams[] det = new XDetectParams[1]; 87 DetectParams[] det = new DetectParams[1];
87 det[0] = new XDetectParams(); 88 det[0] = new DetectParams();
88 det[0].Key = remoteClient.AgentId; 89 det[0].Key = remoteClient.AgentId;
89 det[0].Populate(myScriptEngine.World); 90 det[0].Populate(myScriptEngine.World);
90 91
@@ -97,7 +98,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
97 if (part.ParentGroup.Children.Count > 0) 98 if (part.ParentGroup.Children.Count > 0)
98 det[0].LinkNum = part.LinkNum + 1; 99 det[0].LinkNum = part.LinkNum + 1;
99 100
100 myScriptEngine.PostObjectEvent(localID, new XEventParams( 101 myScriptEngine.PostObjectEvent(localID, new EventParams(
101 "touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, 102 "touch_start", new Object[] { new LSL_Types.LSLInteger(1) },
102 det)); 103 det));
103 } 104 }
@@ -106,8 +107,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
106 IClientAPI remoteClient) 107 IClientAPI remoteClient)
107 { 108 {
108 // Add to queue for all scripts in ObjectID object 109 // Add to queue for all scripts in ObjectID object
109 XDetectParams[] det = new XDetectParams[1]; 110 DetectParams[] det = new DetectParams[1];
110 det[0] = new XDetectParams(); 111 det[0] = new DetectParams();
111 det[0].Key = remoteClient.AgentId; 112 det[0].Key = remoteClient.AgentId;
112 det[0].Populate(myScriptEngine.World); 113 det[0].Populate(myScriptEngine.World);
113 det[0].OffsetPos = new LSL_Types.Vector3(offsetPos.X, 114 det[0].OffsetPos = new LSL_Types.Vector3(offsetPos.X,
@@ -123,7 +124,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
123 if (part.ParentGroup.Children.Count > 0) 124 if (part.ParentGroup.Children.Count > 0)
124 det[0].LinkNum = part.LinkNum + 1; 125 det[0].LinkNum = part.LinkNum + 1;
125 126
126 myScriptEngine.PostObjectEvent(localID, new XEventParams( 127 myScriptEngine.PostObjectEvent(localID, new EventParams(
127 "touch", new Object[] { new LSL_Types.LSLInteger(1) }, 128 "touch", new Object[] { new LSL_Types.LSLInteger(1) },
128 det)); 129 det));
129 } 130 }
@@ -131,8 +132,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
131 public void touch_end(uint localID, IClientAPI remoteClient) 132 public void touch_end(uint localID, IClientAPI remoteClient)
132 { 133 {
133 // Add to queue for all scripts in ObjectID object 134 // Add to queue for all scripts in ObjectID object
134 XDetectParams[] det = new XDetectParams[1]; 135 DetectParams[] det = new DetectParams[1];
135 det[0] = new XDetectParams(); 136 det[0] = new DetectParams();
136 det[0].Key = remoteClient.AgentId; 137 det[0].Key = remoteClient.AgentId;
137 det[0].Populate(myScriptEngine.World); 138 det[0].Populate(myScriptEngine.World);
138 139
@@ -145,7 +146,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
145 if (part.ParentGroup.Children.Count > 0) 146 if (part.ParentGroup.Children.Count > 0)
146 det[0].LinkNum = part.LinkNum + 1; 147 det[0].LinkNum = part.LinkNum + 1;
147 148
148 myScriptEngine.PostObjectEvent(localID, new XEventParams( 149 myScriptEngine.PostObjectEvent(localID, new EventParams(
149 "touch_end", new Object[] { new LSL_Types.LSLInteger(1) }, 150 "touch_end", new Object[] { new LSL_Types.LSLInteger(1) },
150 det)); 151 det));
151 } 152 }
@@ -153,9 +154,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
153 public void changed(uint localID, uint change) 154 public void changed(uint localID, uint change)
154 { 155 {
155 // Add to queue for all scripts in localID, Object pass change. 156 // Add to queue for all scripts in localID, Object pass change.
156 myScriptEngine.PostObjectEvent(localID, new XEventParams( 157 myScriptEngine.PostObjectEvent(localID, new EventParams(
157 "changed",new object[] { new LSL_Types.LSLInteger(change) }, 158 "changed",new object[] { new LSL_Types.LSLInteger(change) },
158 new XDetectParams[0])); 159 new DetectParams[0]));
159 } 160 }
160 161
161 // state_entry: not processed here 162 // state_entry: not processed here
@@ -163,27 +164,27 @@ namespace OpenSim.Region.ScriptEngine.XEngine
163 164
164 public void money(uint localID, LLUUID agentID, int amount) 165 public void money(uint localID, LLUUID agentID, int amount)
165 { 166 {
166 myScriptEngine.PostObjectEvent(localID, new XEventParams( 167 myScriptEngine.PostObjectEvent(localID, new EventParams(
167 "money", new object[] { 168 "money", new object[] {
168 new LSL_Types.LSLString(agentID.ToString()), 169 new LSL_Types.LSLString(agentID.ToString()),
169 new LSL_Types.LSLInteger(amount) }, 170 new LSL_Types.LSLInteger(amount) },
170 new XDetectParams[0])); 171 new DetectParams[0]));
171 } 172 }
172 173
173 public void collision_start(uint localID, ColliderArgs col) 174 public void collision_start(uint localID, ColliderArgs col)
174 { 175 {
175 // Add to queue for all scripts in ObjectID object 176 // Add to queue for all scripts in ObjectID object
176 List<XDetectParams> det = new List<XDetectParams>(); 177 List<DetectParams> det = new List<DetectParams>();
177 178
178 foreach (DetectedObject detobj in col.Colliders) 179 foreach (DetectedObject detobj in col.Colliders)
179 { 180 {
180 XDetectParams d = new XDetectParams(); 181 DetectParams d = new DetectParams();
181 d.Key =detobj.keyUUID; 182 d.Key =detobj.keyUUID;
182 d.Populate(myScriptEngine.World); 183 d.Populate(myScriptEngine.World);
183 det.Add(d); 184 det.Add(d);
184 } 185 }
185 186
186 myScriptEngine.PostObjectEvent(localID, new XEventParams( 187 myScriptEngine.PostObjectEvent(localID, new EventParams(
187 "collision_start", 188 "collision_start",
188 new Object[] { new LSL_Types.LSLInteger(1) }, 189 new Object[] { new LSL_Types.LSLInteger(1) },
189 det.ToArray())); 190 det.ToArray()));
@@ -192,17 +193,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
192 public void collision(uint localID, ColliderArgs col) 193 public void collision(uint localID, ColliderArgs col)
193 { 194 {
194 // Add to queue for all scripts in ObjectID object 195 // Add to queue for all scripts in ObjectID object
195 List<XDetectParams> det = new List<XDetectParams>(); 196 List<DetectParams> det = new List<DetectParams>();
196 197
197 foreach (DetectedObject detobj in col.Colliders) 198 foreach (DetectedObject detobj in col.Colliders)
198 { 199 {
199 XDetectParams d = new XDetectParams(); 200 DetectParams d = new DetectParams();
200 d.Key =detobj.keyUUID; 201 d.Key =detobj.keyUUID;
201 d.Populate(myScriptEngine.World); 202 d.Populate(myScriptEngine.World);
202 det.Add(d); 203 det.Add(d);
203 } 204 }
204 205
205 myScriptEngine.PostObjectEvent(localID, new XEventParams( 206 myScriptEngine.PostObjectEvent(localID, new EventParams(
206 "collision", new Object[] { new LSL_Types.LSLInteger(1) }, 207 "collision", new Object[] { new LSL_Types.LSLInteger(1) },
207 det.ToArray())); 208 det.ToArray()));
208 } 209 }
@@ -210,17 +211,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
210 public void collision_end(uint localID, ColliderArgs col) 211 public void collision_end(uint localID, ColliderArgs col)
211 { 212 {
212 // Add to queue for all scripts in ObjectID object 213 // Add to queue for all scripts in ObjectID object
213 List<XDetectParams> det = new List<XDetectParams>(); 214 List<DetectParams> det = new List<DetectParams>();
214 215
215 foreach (DetectedObject detobj in col.Colliders) 216 foreach (DetectedObject detobj in col.Colliders)
216 { 217 {
217 XDetectParams d = new XDetectParams(); 218 DetectParams d = new DetectParams();
218 d.Key =detobj.keyUUID; 219 d.Key =detobj.keyUUID;
219 d.Populate(myScriptEngine.World); 220 d.Populate(myScriptEngine.World);
220 det.Add(d); 221 det.Add(d);
221 } 222 }
222 223
223 myScriptEngine.PostObjectEvent(localID, new XEventParams( 224 myScriptEngine.PostObjectEvent(localID, new EventParams(
224 "collision_end", 225 "collision_end",
225 new Object[] { new LSL_Types.LSLInteger(1) }, 226 new Object[] { new LSL_Types.LSLInteger(1) },
226 det.ToArray())); 227 det.ToArray()));
@@ -228,26 +229,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
228 229
229 public void land_collision_start(uint localID, LLUUID itemID) 230 public void land_collision_start(uint localID, LLUUID itemID)
230 { 231 {
231 myScriptEngine.PostObjectEvent(localID, new XEventParams( 232 myScriptEngine.PostObjectEvent(localID, new EventParams(
232 "land_collision_start", 233 "land_collision_start",
233 new object[0], 234 new object[0],
234 new XDetectParams[0])); 235 new DetectParams[0]));
235 } 236 }
236 237
237 public void land_collision(uint localID, LLUUID itemID) 238 public void land_collision(uint localID, LLUUID itemID)
238 { 239 {
239 myScriptEngine.PostObjectEvent(localID, new XEventParams( 240 myScriptEngine.PostObjectEvent(localID, new EventParams(
240 "land_collision", 241 "land_collision",
241 new object[0], 242 new object[0],
242 new XDetectParams[0])); 243 new DetectParams[0]));
243 } 244 }
244 245
245 public void land_collision_end(uint localID, LLUUID itemID) 246 public void land_collision_end(uint localID, LLUUID itemID)
246 { 247 {
247 myScriptEngine.PostObjectEvent(localID, new XEventParams( 248 myScriptEngine.PostObjectEvent(localID, new EventParams(
248 "land_collision_end", 249 "land_collision_end",
249 new object[0], 250 new object[0],
250 new XDetectParams[0])); 251 new DetectParams[0]));
251 } 252 }
252 253
253 // timer: not handled here 254 // timer: not handled here
@@ -255,75 +256,75 @@ namespace OpenSim.Region.ScriptEngine.XEngine
255 256
256 public void on_rez(uint localID, LLUUID itemID, int startParam) 257 public void on_rez(uint localID, LLUUID itemID, int startParam)
257 { 258 {
258 myScriptEngine.PostObjectEvent(localID, new XEventParams( 259 myScriptEngine.PostObjectEvent(localID, new EventParams(
259 "on_rez",new object[] { 260 "on_rez",new object[] {
260 new LSL_Types.LSLInteger(startParam)}, 261 new LSL_Types.LSLInteger(startParam)},
261 new XDetectParams[0])); 262 new DetectParams[0]));
262 } 263 }
263 264
264 public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change) 265 public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change)
265 { 266 {
266 myScriptEngine.PostObjectEvent(localID, new XEventParams( 267 myScriptEngine.PostObjectEvent(localID, new EventParams(
267 "control",new object[] { 268 "control",new object[] {
268 new LSL_Types.LSLString(agentID.ToString()), 269 new LSL_Types.LSLString(agentID.ToString()),
269 new LSL_Types.LSLInteger(held), 270 new LSL_Types.LSLInteger(held),
270 new LSL_Types.LSLInteger(change)}, 271 new LSL_Types.LSLInteger(change)},
271 new XDetectParams[0])); 272 new DetectParams[0]));
272 } 273 }
273 274
274 public void email(uint localID, LLUUID itemID, string timeSent, 275 public void email(uint localID, LLUUID itemID, string timeSent,
275 string address, string subject, string message, int numLeft) 276 string address, string subject, string message, int numLeft)
276 { 277 {
277 myScriptEngine.PostObjectEvent(localID, new XEventParams( 278 myScriptEngine.PostObjectEvent(localID, new EventParams(
278 "email",new object[] { 279 "email",new object[] {
279 new LSL_Types.LSLString(timeSent), 280 new LSL_Types.LSLString(timeSent),
280 new LSL_Types.LSLString(address), 281 new LSL_Types.LSLString(address),
281 new LSL_Types.LSLString(subject), 282 new LSL_Types.LSLString(subject),
282 new LSL_Types.LSLString(message), 283 new LSL_Types.LSLString(message),
283 new LSL_Types.LSLInteger(numLeft)}, 284 new LSL_Types.LSLInteger(numLeft)},
284 new XDetectParams[0])); 285 new DetectParams[0]));
285 } 286 }
286 287
287 public void at_target(uint localID, uint handle, LLVector3 targetpos, 288 public void at_target(uint localID, uint handle, LLVector3 targetpos,
288 LLVector3 atpos) 289 LLVector3 atpos)
289 { 290 {
290 myScriptEngine.PostObjectEvent(localID, new XEventParams( 291 myScriptEngine.PostObjectEvent(localID, new EventParams(
291 "at_target", new object[] { 292 "at_target", new object[] {
292 new LSL_Types.LSLInteger(handle), 293 new LSL_Types.LSLInteger(handle),
293 new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z), 294 new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z),
294 new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) }, 295 new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) },
295 new XDetectParams[0])); 296 new DetectParams[0]));
296 } 297 }
297 298
298 public void not_at_target(uint localID) 299 public void not_at_target(uint localID)
299 { 300 {
300 myScriptEngine.PostObjectEvent(localID, new XEventParams( 301 myScriptEngine.PostObjectEvent(localID, new EventParams(
301 "not_at_target",new object[0], 302 "not_at_target",new object[0],
302 new XDetectParams[0])); 303 new DetectParams[0]));
303 } 304 }
304 305
305 public void at_rot_target(uint localID, LLUUID itemID) 306 public void at_rot_target(uint localID, LLUUID itemID)
306 { 307 {
307 myScriptEngine.PostObjectEvent(localID, new XEventParams( 308 myScriptEngine.PostObjectEvent(localID, new EventParams(
308 "at_rot_target",new object[0], 309 "at_rot_target",new object[0],
309 new XDetectParams[0])); 310 new DetectParams[0]));
310 } 311 }
311 312
312 public void not_at_rot_target(uint localID, LLUUID itemID) 313 public void not_at_rot_target(uint localID, LLUUID itemID)
313 { 314 {
314 myScriptEngine.PostObjectEvent(localID, new XEventParams( 315 myScriptEngine.PostObjectEvent(localID, new EventParams(
315 "not_at_rot_target",new object[0], 316 "not_at_rot_target",new object[0],
316 new XDetectParams[0])); 317 new DetectParams[0]));
317 } 318 }
318 319
319 // run_time_permissions: not handled here 320 // run_time_permissions: not handled here
320 321
321 public void attach(uint localID, LLUUID itemID, LLUUID avatar) 322 public void attach(uint localID, LLUUID itemID, LLUUID avatar)
322 { 323 {
323 myScriptEngine.PostObjectEvent(localID, new XEventParams( 324 myScriptEngine.PostObjectEvent(localID, new EventParams(
324 "attach",new object[] { 325 "attach",new object[] {
325 new LSL_Types.LSLString(avatar.ToString()) }, 326 new LSL_Types.LSLString(avatar.ToString()) },
326 new XDetectParams[0])); 327 new DetectParams[0]));
327 } 328 }
328 329
329 // dataserver: not handled here 330 // dataserver: not handled here
@@ -331,16 +332,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
331 332
332 public void moving_start(uint localID, LLUUID itemID) 333 public void moving_start(uint localID, LLUUID itemID)
333 { 334 {
334 myScriptEngine.PostObjectEvent(localID, new XEventParams( 335 myScriptEngine.PostObjectEvent(localID, new EventParams(
335 "moving_start",new object[0], 336 "moving_start",new object[0],
336 new XDetectParams[0])); 337 new DetectParams[0]));
337 } 338 }
338 339
339 public void moving_end(uint localID, LLUUID itemID) 340 public void moving_end(uint localID, LLUUID itemID)
340 { 341 {
341 myScriptEngine.PostObjectEvent(localID, new XEventParams( 342 myScriptEngine.PostObjectEvent(localID, new EventParams(
342 "moving_end",new object[0], 343 "moving_end",new object[0],
343 new XDetectParams[0])); 344 new DetectParams[0]));
344 } 345 }
345 346
346 // object_rez: not handled here 347 // object_rez: not handled here