From b75c1b2191640f4a140dc4cd0e8ce35ab64863d9 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 25 Aug 2007 19:08:15 +0000 Subject: Added class for "long commands" (command that returns as event) with dedicated thread for processing. Added support for llSetTimerEvent(). Deleting old compiled scripts before new compile is attempted (avoids loading wrong script on compile error). --- .../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 187ac59..bfee3e5 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs @@ -19,15 +19,20 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler { private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); - private ScriptManager m_manager; + private ScriptEngine m_ScriptEngine; private IScriptHost m_host; + private uint m_localID; + private LLUUID m_itemID; - public LSL_BuiltIn_Commands(ScriptManager manager, IScriptHost host) + public LSL_BuiltIn_Commands(ScriptEngine ScriptEngine, IScriptHost host, uint localID, LLUUID itemID) { - m_manager = manager; + m_ScriptEngine = ScriptEngine; m_host = host; + m_localID = localID; + m_itemID = itemID; + - MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); + //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); } @@ -39,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler // Object never expires public override Object InitializeLifetimeService() { - Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); + //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); // return null; ILease lease = (ILease)base.InitializeLifetimeService(); @@ -55,7 +60,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public Scene World { - get { return m_manager.World; } + get { return m_ScriptEngine.World; } } //These are the implementations of the various ll-functions used by the LSL scripts. @@ -258,7 +263,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { } public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { } public void llStopLookAt() { } - public void llSetTimerEvent(double sec) { } + public void llSetTimerEvent(double sec) + { + // Setting timer repeat + m_ScriptEngine.myLSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec); + } public void llSleep(double sec) { System.Threading.Thread.Sleep((int)(sec * 1000)); } public double llGetMass() { return 0; } public void llCollisionFilter(string name, string id, int accept) { } @@ -416,7 +425,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } public int llGetAttached() { return 0; } public int llGetFreeMemory() { return 0; } - public string llGetRegionName() { return m_manager.RegionName; } + public string llGetRegionName() { return World.RegionInfo.RegionName; } public double llGetRegionTimeDilation() { return 1.0f; } public double llGetRegionFPS() { return 10.0f; } public void llParticleSystem(List rules) { } -- cgit v1.1