From 9468917b5f6ba6556bd9605e88227ea79e43d94e Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 25 Apr 2008 01:00:55 +0000 Subject: * Implements llTarget, llTargetRemove, at_target(), not_at_target() --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 6 +++--- .../ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 11 +++++++---- OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 35f8ee0..79b13cf 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -1181,14 +1181,14 @@ namespace OpenSim.Region.ScriptEngine.Common public int llTarget(LSL_Types.Vector3 position, double range) { m_host.AddScriptLPS(1); - NotImplemented("llTarget"); - return 0; + return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); + } public void llTargetRemove(int number) { m_host.AddScriptLPS(1); - NotImplemented("llTargetRemove"); + m_host.unregisterTargetWaypoint(number); } public int llRotTarget(LSL_Types.Quaternion rot, double error) diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index d3e9948..ce9f445 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs @@ -70,6 +70,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.World.EventManager.OnRezScript += OnRezScript; myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; + myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; + myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; + // TODO: HOOK ALL EVENTS UP TO SERVER! IMoneyModule money=myScriptEngine.World.RequestModuleInterface(); if(money != null) @@ -222,14 +225,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email", EventQueueManager.llDetectNull); } - public void at_target(uint localID, LLUUID itemID) + public void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos) { - myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_target", EventQueueManager.llDetectNull); + myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "at_target", EventQueueManager.llDetectNull, new object[] { (int)handle, new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z), new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) }); } - public void not_at_target(uint localID, LLUUID itemID) + public void not_at_target(uint localID) { - myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_target", EventQueueManager.llDetectNull); + myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "not_at_target", EventQueueManager.llDetectNull); } public void at_rot_target(uint localID, LLUUID itemID) diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index ea17e20..1c85646 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs @@ -57,8 +57,8 @@ namespace OpenSim.Region.ScriptEngine.Common void control(uint localID, LLUUID itemID); void money(uint LocalID, LLUUID agentID, int amount); void email(uint localID, LLUUID itemID); - void at_target(uint localID, LLUUID itemID); - void not_at_target(uint localID, LLUUID itemID); + void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); + void not_at_target(uint localID); void at_rot_target(uint localID, LLUUID itemID); void not_at_rot_target(uint localID, LLUUID itemID); void run_time_permissions(uint localID, LLUUID itemID); -- cgit v1.1