29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Reflection;
33 using OpenSim.Framework;
34 using OpenSim.Region.Framework.Scenes;
35 using OpenSim.Region.Framework.Interfaces;
36 using OpenSim.Region.ScriptEngine.Shared;
37 using OpenSim.Region.ScriptEngine.Interfaces;
40 namespace OpenSim.
Region.ScriptEngine.XEngine
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 myScriptEngine = _ScriptEngine;
56 myScriptEngine.World.EventManager.OnAttach +=
attach;
57 myScriptEngine.World.EventManager.OnObjectGrab +=
touch_start;
58 myScriptEngine.World.EventManager.OnObjectGrabbing +=
touch;
59 myScriptEngine.World.EventManager.OnObjectDeGrab +=
touch_end;
60 myScriptEngine.World.EventManager.OnScriptChangedEvent += changed;
61 myScriptEngine.World.EventManager.OnScriptAtTargetEvent +=
at_target;
62 myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent +=
not_at_target;
63 myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent +=
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;
67 myScriptEngine.World.EventManager.OnScriptControlEvent +=
control;
68 myScriptEngine.World.EventManager.OnScriptColliderStart +=
collision_start;
69 myScriptEngine.World.EventManager.OnScriptColliding +=
collision;
70 myScriptEngine.World.EventManager.OnScriptCollidingEnd +=
collision_end;
72 myScriptEngine.World.EventManager.OnScriptLandColliding +=
land_collision;
77 money.OnObjectPaid+=HandleObjectPaid;
88 private void HandleObjectPaid(UUID objectID, UUID agentID,
96 myScriptEngine.World.GetSceneObjectPart(objectID);
104 m_log.Debug(
"Paid: " + objectID +
" from " + agentID +
", amount " + amount);
119 public void touch_start(uint localID, uint originalID, Vector3 offsetPos,
125 det[0].Key = remoteClient.AgentId;
126 det[0].Populate(myScriptEngine.World);
130 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
134 det[0].LinkNum = part.LinkNum;
138 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
139 det[0].LinkNum = originalPart.LinkNum;
142 if (surfaceArgs != null)
144 det[0].SurfaceTouchArgs = surfaceArgs;
147 myScriptEngine.PostObjectEvent(localID,
new EventParams(
152 public void touch(uint localID, uint originalID, Vector3 offsetPos,
158 det[0].Key = remoteClient.AgentId;
159 det[0].Populate(myScriptEngine.World);
160 det[0].OffsetPos = offsetPos;
164 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
168 det[0].LinkNum = part.LinkNum;
172 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
173 det[0].LinkNum = originalPart.LinkNum;
175 if (surfaceArgs != null)
177 det[0].SurfaceTouchArgs = surfaceArgs;
180 myScriptEngine.PostObjectEvent(localID,
new EventParams(
191 det[0].Key = remoteClient.AgentId;
192 det[0].Populate(myScriptEngine.World);
196 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
200 det[0].LinkNum = part.LinkNum;
204 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
205 det[0].LinkNum = originalPart.LinkNum;
208 if (surfaceArgs != null)
210 det[0].SurfaceTouchArgs = surfaceArgs;
213 myScriptEngine.PostObjectEvent(localID,
new EventParams(
218 public void changed(uint localID, uint change)
221 myScriptEngine.PostObjectEvent(localID,
new EventParams(
229 public void money(uint localID, UUID agentID,
int amount)
231 myScriptEngine.PostObjectEvent(localID,
new EventParams(
232 "money",
new object[] {
241 List<DetectParams> det =
new List<DetectParams>();
246 d.Key =detobj.keyUUID;
247 d.Populate(myScriptEngine.World);
248 d.LinkNum = detobj.linkNumber;
253 myScriptEngine.PostObjectEvent(localID,
new EventParams(
262 List<DetectParams> det =
new List<DetectParams>();
267 d.Key =detobj.keyUUID;
268 d.Populate(myScriptEngine.World);
269 d.LinkNum = detobj.linkNumber;
274 myScriptEngine.PostObjectEvent(localID,
new EventParams(
282 List<DetectParams> det =
new List<DetectParams>();
287 d.Key =detobj.keyUUID;
288 d.Populate(myScriptEngine.World);
289 d.LinkNum = detobj.linkNumber;
294 myScriptEngine.PostObjectEvent(localID,
new EventParams(
302 List<DetectParams> det =
new List<DetectParams>();
307 d.Position = detobj.posVector;
308 d.Populate(myScriptEngine.World);
310 myScriptEngine.PostObjectEvent(localID,
new EventParams(
311 "land_collision_start",
320 List<DetectParams> det =
new List<DetectParams>();
325 d.Position = detobj.posVector;
326 d.Populate(myScriptEngine.World);
328 myScriptEngine.PostObjectEvent(localID,
new EventParams(
337 List<DetectParams> det =
new List<DetectParams>();
342 d.Position = detobj.posVector;
343 d.Populate(myScriptEngine.World);
345 myScriptEngine.PostObjectEvent(localID,
new EventParams(
346 "land_collision_end",
355 public void control(UUID itemID, UUID agentID, uint held, uint change)
357 myScriptEngine.PostScriptEvent(itemID,
new EventParams(
358 "control",
new object[] {
365 public void email(uint localID, UUID itemID,
string timeSent,
366 string address,
string subject,
string message,
int numLeft)
368 myScriptEngine.PostObjectEvent(localID,
new EventParams(
369 "email",
new object[] {
378 public void at_target(uint localID, uint handle, Vector3 targetpos,
381 myScriptEngine.PostObjectEvent(localID,
new EventParams(
382 "at_target",
new object[] {
391 myScriptEngine.PostObjectEvent(localID,
new EventParams(
392 "not_at_target",
new object[0],
399 myScriptEngine.PostObjectEvent(localID,
new EventParams(
400 "at_rot_target",
new object[] {
409 myScriptEngine.PostObjectEvent(localID,
new EventParams(
410 "not_at_rot_target",
new object[0],
416 public void attach(uint localID, UUID itemID, UUID avatar)
418 myScriptEngine.PostObjectEvent(localID,
new EventParams(
419 "attach",
new object[] {
429 myScriptEngine.PostObjectEvent(localID,
new EventParams(
430 "moving_start",
new object[0],
436 myScriptEngine.PostObjectEvent(localID,
new EventParams(
437 "moving_end",
new object[0],
void touch(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
void touch_end(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
void at_target(uint localID, uint handle, Vector3 targetpos, Vector3 atpos)
void control(UUID itemID, UUID agentID, uint held, uint change)
EventManager(XEngine _ScriptEngine)
void collision(uint localID, ColliderArgs col)
void moving_start(uint localID)
void money(uint localID, UUID agentID, int amount)
void at_rot_target(uint localID, uint handle, Quaternion targetrot, Quaternion atrot)
void land_collision(uint localID, ColliderArgs col)
void attach(uint localID, UUID itemID, UUID avatar)
void changed(uint localID, uint change)
Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it.
void not_at_target(uint localID)
scriptEvents ScriptEvents
void land_collision_start(uint localID, ColliderArgs col)
SceneObjectGroup ParentGroup
void email(uint localID, UUID itemID, string timeSent, string address, string subject, string message, int numLeft)
void collision_end(uint localID, ColliderArgs col)
void touch_start(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
Handles piping the proper stuff to The script engine for touching Including DetectedParams ...
void moving_end(uint localID)
void land_collision_end(uint localID, ColliderArgs col)
Holds all the data required to execute a scripting event.
void not_at_rot_target(uint localID)
void collision_start(uint localID, ColliderArgs col)