mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 19:35:41 +08:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user