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).

This commit is contained in:
Tedd Hansen
2007-08-25 19:08:15 +00:00
parent 53be4774b3
commit b75c1b2191
9 changed files with 261 additions and 79 deletions

View File

@@ -249,6 +249,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
{
// Create a new instance of the compiler (currently we don't want reuse)
OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler();
// Compile (We assume LSL)
@@ -272,11 +274,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// We need to give (untrusted) assembly a private instance of BuiltIns
// this private copy will contain Read-Only FullitemID so that it can bring that on to the server whenever needed.
LSL_BuiltIn_Commands LSLB = new LSL_BuiltIn_Commands(this, World.GetSceneObjectPart(localID));
LSL_BuiltIn_Commands LSLB = new LSL_BuiltIn_Commands(m_scriptEngine, World.GetSceneObjectPart(localID), localID, itemID);
// Start the script - giving it BuiltIns
CompiledScript.Start(LSLB);
// Fire the first start-event
m_scriptEngine.myEventQueueManager.AddToObjectQueue(localID, "state_entry", new object[] { });
}
catch (Exception e)
{
@@ -291,6 +297,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Stop script
Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString());
// Stop long command on script
m_scriptEngine.myLSLLongCmdHandler.RemoveScript(localID, itemID);
// Get AppDomain
AppDomain ad = GetScript(localID, itemID).Exec.GetAppDomain();
// Tell script not to accept new requests
@@ -328,12 +337,5 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
}
public string RegionName
{
get
{
return World.RegionInfo.RegionName;
}
}
}
}